Verifying Smart Contracts
The following are the steps needed to verify any contract from the chain. In this particular example a brand new contract uploaded to the testnet.
Create new contract
Follow this guide to create a new contract with Beaker.
Once the contract is created query the contract information. Assuming you are connected to the testnet.
osmosisd query wasm contract osmo1mpf0guu0t363xrshhedandypq003ahzaxvsxzgu69n3ej03mh2zqx5gk8l
Get the contract version by running the following command
osmosisd query wasm contract-state raw osmo1mpf0guu0t363xrshhedandypq003ahzaxvsxzgu69n3ej03mh2zqx5gk8l 636F6E74726163745F696E666F --node https://rpc.testnet.osmosis.zone:443 --output json | jq -r .data | base64 -d | jq
What in the world is
ContractInfo is must be stored under "contract_info" key which translates to "636F6E74726163745F696E666F" in hex format. As documented here.
Downloading the Contract from the network
osmosisd query wasm code 205 205_code.wasm --node https://rpc.testnet.osmosis.zone:443
Getting the hash
Now it's time to verify the hash with the source repos. All contracts should provide a repository with a hash for their contracts the same way that cw-plus does on their checksum as shown below: