diff --git a/src/ch02-07-01-01-erc20-ui.md b/src/ch02-07-01-01-erc20-ui.md index 5f2cf1f3d..50337f425 100644 --- a/src/ch02-07-01-01-erc20-ui.md +++ b/src/ch02-07-01-01-erc20-ui.md @@ -45,7 +45,7 @@ version = "0.1.0" [dependencies] starknet = ">=2.2.0" -openzeppelin = { git = "https://github.com/OpenZeppelin-contracts.git", tag = "v0.7.0" } +openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.7.0" } [[target.starknet-contract]] ``` diff --git a/src/ch02-11-foundry-forge.md b/src/ch02-11-foundry-forge.md index e9384964f..431bd9a23 100644 --- a/src/ch02-11-foundry-forge.md +++ b/src/ch02-11-foundry-forge.md @@ -32,6 +32,7 @@ tree . -L 1 The project structure is as follows: + ```shell . ├── README.md @@ -90,7 +91,6 @@ scarb add snforge_std --git https://github.com/foundry-rs/starknet-foundry.git - With these steps, your existing Scarb project is now **`snforge`**-ready. - ## Testing with `snforge` Utilize Starknet Foundry's `snforge` command to efficiently run tests. @@ -118,6 +118,7 @@ Tests: 3 passed, 0 failed, 0 skipped Run specific tests using a filter string after the `snforge` command. Tests matching the filter based on their absolute module tree path will be executed: + ```shell $ snforge calling ``` @@ -126,6 +127,7 @@ $ snforge calling Use the `--exact` flag and a fully qualified test name to run a particular test: + ```shell snforge package_name::calling --exact ``` @@ -164,6 +166,7 @@ mod HelloStarknet { } // Returns the balance. + fn get_balance(self: @ContractState) -> felt252 { self.balance.read() } @@ -185,7 +188,7 @@ fn call_and_invoke() { // Declare and deploy the contract let contract = declare('HelloStarknet'); let contract_address = contract.deploy(@ArrayTrait::new()).unwrap(); - + // Instantiate a Dispatcher object for contract interactions let dispatcher = IHelloStarknetDispatcher { contract_address }; @@ -209,4 +212,4 @@ Collected 1 test(s) from using_dispatchers package Running 1 test(s) from src/ [PASS] using_dispatchers::call_and_invoke Tests: 1 passed, 0 failed, 0 skipped -``` +``` \ No newline at end of file diff --git a/src/ch02-12-01-deployment-script.md b/src/ch02-12-01-deployment-script.md index 817ff4f8b..e97f1fabe 100644 --- a/src/ch02-12-01-deployment-script.md +++ b/src/ch02-12-01-deployment-script.md @@ -1,6 +1,6 @@ # Deployment Script Example -This tutorial explains how to set up a test and deployment environment for smart contracts. The given script initializes accounts, runs tests, and carries out multicalls. +This tutorial explains how to set up a test and deployment environment for smart contracts. The given script initializes accounts, runs tests, and carries out multicalls. Disclaimer: This is an example. Use it as a foundation for your own work, adjusting as needed. @@ -153,10 +153,10 @@ fi The line `#!/usr/bin/env bash` indicates the path to the bash interpreter. If you require a different version or location of bash, determine its path using: -```sh -which bash +```sh +which bash ``` - + Then replace `#!/usr/bin/env` bash in the script with the resulting path, such as `#!/path/to/your/bash`. ## Execution @@ -164,7 +164,7 @@ Then replace `#!/usr/bin/env` bash in the script with the resulting path, such a When running the script, you'll need to provide the environment variables `ACCOUNT1_PRIVATE_KEY` and `ACCOUNT2_PRIVATE_KEY`. Example: - + ```sh ACCOUNT1_PRIVATE_KEY="0x259f4329e6f4590b" ACCOUNT2_PRIVATE_KEY="0xb4862b21fb97d" ./script.sh ``` @@ -173,4 +173,4 @@ ACCOUNT1_PRIVATE_KEY="0x259f4329e6f4590b" ACCOUNT2_PRIVATE_KEY="0xb4862b21fb97d" - The **`set -e`** directive in the script ensures it exits if any command fails, enhancing the reliability of the deployment and testing process. - Always secure private keys and sensitive information. Keep them away from logs and visible outputs. -- For greater flexibility, consider moving hardcoded values like accounts or contract names to a configuration file. This approach simplifies updates and overall management. \ No newline at end of file +- For greater flexibility, consider moving hardcoded values like accounts or contract names to a configuration file. This approach simplifies updates and overall management.