Verifying Code Updates
How to verify code updates of smart contracts deployed on Libre.
Code Verification Instructions
About Code Verification
The purpose here is to be able to read and even deploy locally both the current version and the proposed changes for testing.
Ideally, you should know how to use git, how to run a diff on code changes, and how to calculate a sha256sum. That being said, we have written it all out for you anyway.
Generally, there are 3 steps here:
Verify currently deployed code locally
Verify proposed code locally
Compare proposed changes to deployed code (can be done in Gitlab UI or VS Code)
Steps are listed below and we are working on a video walkthrough for the future so basically anyone with a terminal and a keyboard will be able to do this verification.
Steps to verify:
Clone repo
Get sha256sum hash of currently deployed contract
libre.sh get code stake.libre
- compare to table above “currently deployed”Git checkout commit of currently deployed contract (provided in proposal)
Build WASM (docker if avail)
./docker-build.sh
(or older repos)./build.sh
Verify sha256sum of built wasm matches deployed contract (from step 2) sha256sum $PATH_TO_WASM (provided in proposal)
Git checkout commit of proposed update (provided in proposal)
Build WASM of the proposed update
./docker-build.sh
(or older repos)./build.sh
Check sha256sum of wasm you built
sha256sum $PATH_TO_WASM
(provided in proposal)If it matches the sha256sum in the multisig on-chain, then you are looking at the correct version of code! (only the sha256sum of the wasm matters here - abi will not match, but you can download it from the multisig proposal and review if you like)
Inspect code changes between proposed update and deployed version using the Code Comparison link (provided in proposal) or by running a diff between commits (source: proposed, target: deployed)
Multisig Execution Instructions
How to Approve
Use Anchor and login to local.blocks.io and click “Approve” (recommended)
Use these CLI multisig commands below (2 versions that require cleos to be installed)
CLI Example 1 - use libre.sh
Create libre.sh for CLI transactions on Linux
Replace "sweden" with your account name in the "actor" key below:
CLI example 2 - simple cleos
Replace sweden with your producer name in all 4 actor keys:
Last updated