Skip to content

offgridauthor/verif-demo

Repository files navigation

Smart Contract Bytecode Verification

Example repo to demonstrate bytecode verification review feature for contract upgrade proposals in OpenZeppelin Defender.

Scripts

  • yarn deploy - Deploy token contract, add to Defender Admin and verify bytecode
  • yarn upgrade - Deploy token contract V2, verify bytecode and create Admin proposal for signers to review

Walkthrough

Deploy Proxy and Verify

  1. Write an upgradeable smart contract (or use wizard.openzeppelin.com to generate one) and save in /contracts
  2. Compile with yarn hardhat compile to generate build artifacts and ABI
  3. Remove artifacts folder from .gitignore
  4. Add the new files, commit and push to remote repository (git add . && git commit -m "add build artifacts" && git push origin main)
  5. Copy URL of build artifact (ie https://raw.githubusercontent.com/offgridauthor/verification-contracts/main/artifacts/build-info/1ca3e45b97b92b131128688d9d9faf68.json)
  6. Add ABI and URL to remote build artifact to deploy-and-verify.js script
  7. Run yarn deploy

Automate Upgrade Proposal and Verification (using Github Actions)

  1. Add environment variables to Github Secrets
  2. Add ci.yml file to /.github/workflows, supplying proxy address and contract owner
  3. Make changes to code and push to repo

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published