diff --git a/CHANGELOG.md b/CHANGELOG.md index a350709fe..238ba66a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.2.108](https://github.com/starknet-edu/starknetbook/compare/v1.2.107...v1.2.108) (2023-08-24) + +### [1.2.107](https://github.com/starknet-edu/starknetbook/compare/v1.2.106...v1.2.107) (2023-08-11) + ### [1.2.106](https://github.com/starknet-edu/starknetbook/compare/v1.2.105...v1.2.106) (2023-08-11) ### [1.2.105](https://github.com/starknet-edu/starknetbook/compare/v1.2.104...v1.2.105) (2023-08-11) diff --git a/chapters/book/modules/chapter_1/pages/first_contract.adoc b/chapters/book/modules/chapter_1/pages/first_contract.adoc index cf1201168..1f1a0ca25 100644 --- a/chapters/book/modules/chapter_1/pages/first_contract.adoc +++ b/chapters/book/modules/chapter_1/pages/first_contract.adoc @@ -56,11 +56,19 @@ starkli account fetch --help Fetch account config from an already deployed account contract ---- -Currently, the "fetch" command does not support Braavos or Argent X smart wallets. However, there's an open PR to add this functionality. For now, we have to create the account descriptor file manually. + +Currently, the "fetch" command does support Braavos or Argent X smart wallets. Make sure your wallet address is already deployed and input following command to create and save the account descriptor file. [source,shell] ---- -touch ~/.starkli-wallets/deployer/account.json +starkli account fetch ~/.starkli-wallets/deployer/account.json +---- + +You can see the details of the account descriptor with the following command. + +[source,shell] +---- +cat ~/.starkli-wallets/deployer/account.json ---- The account descriptor should have the following structure: @@ -70,9 +78,11 @@ The account descriptor should have the following structure: { "version": 1, "variant": { - "type": "open_zeppelin", + "type": "argent", "version": 1, - "public_key": "" + "implementation": "", + "signer": "", + "guardian": "0x0" }, "deployment": { "status": "deployed", @@ -82,25 +92,7 @@ The account descriptor should have the following structure: } ---- -Edit the file with the right fields for the public key, class hash, and address. Here is how to find them: - -The public key was returned by the "starkli signer keystore from-key ~/.starkli-wallets/deployer/keystore.json" command. However, you can also find it using the following command and writing the password you used to create the keystore file: - -[source,shell] ----- -starkli signer keystore inspect ~/.starkli-wallets/deployer/keystore.json ----- - -The address is the address of your smart wallet. You can find it in the Braavos or Argent X browser extensions. Then use this address to fetch the class hash of your smart wallet with the following Starkli command: - -[source,shell] ----- -starkli class-hash-at ----- - -You might be wondering why the type is defined as "open_zeppelin" even though we're working with a Braavos wallet. This is because the CLI uses Open Zeppelin's default algorithm to sign transactions, which happens to be the same one used by Braavos and Argent X by default. - -However, note that a Braavos smart wallet with a hardware signer enabled will not work in this context, as a hardware signer uses a different elliptic curve to sign transactions. +If you are working with Braavos wallet, the type is defined as "braavos" and the account descriptor strcuture might be slightly different. == Setting up Environment Variables @@ -148,10 +140,10 @@ Here's the structure for the declaration command using the Starknet Sequencer's [source,bash] ---- -starkli declare target/dev/contracts_Ownable.sierra.json --network=goerli-1 --compiler-version=2.0.1 +starkli declare target/dev/contracts_Ownable.sierra.json --network=goerli-1 --compiler-version=2.1.0 ---- -The network flag is used to specify the network you want to use, it could also be "mainnet" for example. The compiler-version flag is used to specify the version of the compiler you want to use. Starkli is currently running on version 2.0.1 of the compiler. You can know the compiler version supported by Starkli by running: +The network flag is used to specify the network you want to use, it could also be "mainnet" for example. The compiler-version flag is used to specify the version of the compiler you want to use. Starkli is currently running on version 2.1.0 and 2.0.1 of the compiler. You can know the compiler version supported by Starkli by running: [source,bash] ---- @@ -163,21 +155,21 @@ In the --compiler-version flag you will see possible versions of the compiler: [source,bash] ---- --compiler-version - Statically-linked Sierra compiler version [possible values: 2.0.1] + Statically-linked Sierra compiler version [possible values: 2.0.1, 2.1.0] ---- -However, it could be that the Scarb compiler version is 2.0.2, you can know this by running: +However, it could be that the Scarb compiler version is 2.2.0, you can know this by running: [source,bash] ---- scarb --version ---- -This is because Starkli and Scarb are not always in sync. In this case you would need to use the compiler version that Starkli is using by installing a previous version of Scarb (check out the releases in the https://github.com/software-mansion/scarb/releases[Scarb github repo]). For example, you can do this by running the following command for installing Scarb version 0.5.1: +This is because Starkli and Scarb are not always in sync. In this case you would need to use the compiler version that Starkli is using by installing a previous version of Scarb (check out the releases in the https://github.com/software-mansion/scarb/releases[Scarb github repo]). For example, you can do this by running the following command for installing Scarb version 0.6.1: [source,bash] ---- -curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 0.5.1 +curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 0.6.1 ---- If you get an error "Error: Invalid contract class", it means that you are using a version of Scarb that is not supported by Starkli. In this case, you need to install a previous version of Scarb as explained above. @@ -188,7 +180,7 @@ If you were using a provider like Infura or Alchemy, the declaration command wou ---- starkli declare target/dev/contracts_Ownable.sierra.json \ --rpc=https://starknet-goerli.infura.io/v3/ \ - --compiler-version=2.0.1 + --compiler-version=2.1.0 ---- The result of the declaration command is a contract class hash (Class hash declared: diff --git a/package.json b/package.json index 535db4f9c..f129be8f6 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,5 @@ "simple-git": "^3.15.0", "standard-version": "^9.3.2" }, - "version": "1.2.106" + "version": "1.2.108" }