Time to read: 1 min
Verify Smart Contracts on Rootstock CLI
To verify a smart contract on the Rootstock CLI, the rsk-cli
verify command allows developers to submit their contract source code and other information to the Rootstock Explorer API.
The rsk-cli
verify command enables the verification of a smart contract on Rootstock's mainnet or testnet by providing the contract code, address, and other metadata through a JSON file.
Verification on Rootstock's blockchain allows users to confirm that the compiled bytecode on the blockchain matches the source code.
- Mainnet
- Testnet
rsk-cli verify --json <path_to_json> --address <address> --name <contract_name> --decodedArgs <arg1> <arg2> ...
rsk-cli verify --testnet --json <path_to_json> --address <address> --name <contract_name> --decodedArgs <arg1> <arg2> ...
información
--json \<path\_to\_json\>
- This specifies the path to the JSON file that contains all necessary information for verifying the contract. The JSON file should typically contain:
- Source code of the contract.
- Compiler version and settings.
- ABI (Application Binary Interface) data for interacting with the contract.
- Metadata for libraries if the contract has dependencies.
- Example: If your JSON file is named
fb7b3667b850d874bffe750e005d2477.json
and it is usually in thebuild-info
folder under theartifacts folder
, you would use--json .artifacts/build-info/fb7b3667b850d874bffe750e005d2477.json
.
├── artifacts
│ └── build-info