Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
🐛 Fixes wrong url for OpenZeppelin's cairo-contract (#222)
Browse files Browse the repository at this point in the history
* Fixes wrong url for OpenZeppelin's cairo-contract

* Apply linter

---------

Co-authored-by: Omar U. Espejel <[email protected]>
  • Loading branch information
ccolorado and omarespejel authored Oct 19, 2023
1 parent 5f81c62 commit 2ac0f4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ch02-07-01-01-erc20-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
```
Expand Down
9 changes: 6 additions & 3 deletions src/ch02-11-foundry-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tree . -L 1

The project structure is as follows:


```shell
.
├── README.md
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down Expand Up @@ -164,6 +166,7 @@ mod HelloStarknet {
}
// Returns the balance.
fn get_balance(self: @ContractState) -> felt252 {
self.balance.read()
}
Expand All @@ -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 };
Expand All @@ -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
```
```
12 changes: 6 additions & 6 deletions src/ch02-12-01-deployment-script.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -153,18 +153,18 @@ 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

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
```
Expand All @@ -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.
- For greater flexibility, consider moving hardcoded values like accounts or contract names to a configuration file. This approach simplifies updates and overall management.

0 comments on commit 2ac0f4a

Please sign in to comment.