Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add verify-contracts script #146

Merged
merged 3 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Scripts exists to make your life easier! Here are available scripts and features
| :---: | :---: |
| Build Contract | ✅ |
| Format Contract | ✅ |
| Verify Contract | ✅ |
| Run custom scripts | ✅ |
| Generate SRC5 Interface | ✅ |
| Prepare Account | ✅ |
Expand Down Expand Up @@ -93,6 +94,14 @@ Scarb comes with an in-built cairo formatter. To utilize it run:
npm run format-contracts
```

#### Verify contracts

To verify your smart contracts, from the base repository run:

```
npm run verify-contracts --contract-address=<CONTRACT_ADDRESS> --contract-name=<CONTRACT_NAME>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also add this command to the documentation in docs folder. chapter 5 on scripts

```

#### Test contracts

To run your tests:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build-contracts": "cd contracts && scarb build",
"test-contracts": "cd contracts && snforge test",
"format-contracts": "cd contracts && scarb fmt",
"verify-contracts": "cd contracts && sncast verify --contract-address ${npm_config_contract-address} --contract-name ${npm_config_contract-name} --verifier walnut --network mainnet",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the verifier supported on testnet? if yes can we make it possible to also verify contracts on testnet too? by making the network value passed in by users

"contract-scripts": "cd contracts/scripts && sncast script run ${npm_config_script} --url ${npm_config_url}",
"generate-interface": "cd contracts && src5_rs parse",
"prepare-account": "cd contracts && sncast account create --url ${npm_config_url} --name ${npm_config_name} --add-profile",
Expand Down
Loading