From 8e83dbf9368037ddd505e1d980c9ce552a50c49c Mon Sep 17 00:00:00 2001 From: EjembiEmmanuel Date: Wed, 28 Aug 2024 17:35:06 +0100 Subject: [PATCH 1/3] feat: add verify-contracts script --- Readme.md | 9 +++++++++ package.json | 1 + 2 files changed, 10 insertions(+) diff --git a/Readme.md b/Readme.md index 68fd40e..7ad9ebe 100644 --- a/Readme.md +++ b/Readme.md @@ -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 | ✅ | @@ -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-name= +``` + #### Test contracts To run your tests: diff --git a/package.json b/package.json index 23e7041..bc1a758 100644 --- a/package.json +++ b/package.json @@ -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", "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", From 614380f4fca4164e3e24097275d7574df156c6c2 Mon Sep 17 00:00:00 2001 From: EjembiEmmanuel Date: Sat, 31 Aug 2024 13:10:09 +0100 Subject: [PATCH 2/3] feat: add --network flag to verify-contracts script --- Readme.md | 2 +- docs/src/chapter_5.md | 8 ++++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 7ad9ebe..0f693b9 100644 --- a/Readme.md +++ b/Readme.md @@ -99,7 +99,7 @@ npm run format-contracts To verify your smart contracts, from the base repository run: ``` -npm run verify-contracts --contract-address= --contract-name= +npm run verify-contracts --contract-address= --contract-name= --network= ``` #### Test contracts diff --git a/docs/src/chapter_5.md b/docs/src/chapter_5.md index 141b9ab..8bf433d 100644 --- a/docs/src/chapter_5.md +++ b/docs/src/chapter_5.md @@ -17,6 +17,14 @@ Leverage `Scarb’s` native formatting capabilities by running: npm run format-contracts ``` +#### Verify contracts + +To verify your smart contracts, from the base repository run: + +``` +npm run verify-contracts --contract-address= --contract-name= --network= +``` + ### Test contracts To run your Starknet Foundry tests: ``` diff --git a/package.json b/package.json index bc1a758..8dcc7ce 100644 --- a/package.json +++ b/package.json @@ -7,7 +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", + "verify-contracts": "cd contracts && sncast verify --contract-address ${npm_config_contract-address} --contract-name ${npm_config_contract-name} --verifier walnut --network ${npm_config_network}", "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", From f5acec90b5d2c1b1ec9e13a774f8c4a01040e9c0 Mon Sep 17 00:00:00 2001 From: EjembiEmmanuel Date: Sat, 31 Aug 2024 13:13:12 +0100 Subject: [PATCH 3/3] fix: fix verify-contracts script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dcc7ce..930bbe7 100644 --- a/package.json +++ b/package.json @@ -7,7 +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 ${npm_config_network}", + "verify-contracts": "cd contracts && sncast verify --contract-address ${npm_config_contract-address} --contract-name ${npm_config_contract-name} --verifier walnut --network ${npm_config-network}", "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",