Skip to content

Instantly share code, notes, and snippets.

@maurelian
Last active June 8, 2024 01:23
Show Gist options
  • Save maurelian/12cd1dd41fbb653dc19908a296942d07 to your computer and use it in GitHub Desktop.
Save maurelian/12cd1dd41fbb653dc19908a296942d07 to your computer and use it in GitHub Desktop.

Verifying Correctness of the Safe Extensions Bytecode

The following steps can be taken in order to verify that the Safe Modules and Guard match the governance approved source code, and should work with tooling you already have. Do these from the root directory of the superchain-ops repo.

  1. Update forge by running: foundryup.
  2. Clone the Optimism monorepo: git clone https://github.com/ethereum-optimism/optimism.git
  3. cd optimism
  4. Move into the contract-bedrock dir of the optimism monorepo: cd packages/contracts-bedrock
  5. Checkout the tag which was proposed to governance: git checkout op-contracts/v1.5.0-rc.1
  6. Run forge verify-bytecode for each of the addresses (run these commands one at a time):
     forge verify-bytecode 0x24424336F04440b1c28685a38303aC33C9D14a25 src/Safe/LivenessGuard.sol:LivenessGuard
     forge verify-bytecode 0x0454092516c9A4d636d3CAfA1e82161376C8a748 src/Safe/LivenessModule.sol:LivenessModule
     forge verify-bytecode 0x5dc91d01290af474ce21de14c17335a6dee4d2a8 src/Safe/DeputyGuardianModule.sol:DeputyGuardianModule

For each you will see:

Creation code matched with status partial
Runtime code matched with status partial

Partial verification does not affect the logic or behavior of the deployed bytecode, the meaning is described here in detail: https://docs.sourcify.dev/docs/full-vs-partial-match/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment