Mento Protocol
  • Overview
    • Getting Started
      • What Is Mento?
      • Quick Start Guides
      • Analytics & Dashboards
    • Core Concepts
      • Stability Mechanisms
      • The Reserve
      • Oracles & Price Feeds
      • Trading Limits & Circuit Breakers
      • The Broker & Virtual AMMs
      • Fixed-Price Market Makers (FPMMs)
      • Research & Economics
    • Governance & the MENTO Token
      • Understanding Mento Governance
      • Participating in Governance
        • veMENTO & Voting Power
        • Creating Proposals
        • Voting Process
      • MENTO Tokenomics
      • Watchdogs & Safety
    • Security & Risk
      • Overview
      • Audit Reports
  • Build On Mento
    • Integration Overview
      • Integrate Stables
      • Integrate the Broker
      • Integrate Oracles
    • Mento SDK
      • Installation
      • Guides
        • Getting Exchange Pairs
        • Getting a Quote
        • Initiating a Swap
    • Smart Contracts
      • Broker
      • TradingLimits
      • BiPoolManager
      • Pricing Modules
      • SortedOracles
      • BreakerBox
      • Reserve
      • StableToken
      • Audits
    • Deployments
      • Addresses
      • Verification
  • Use Mento
    • Getting Mento Stables
      • On Celo
      • On Mobile
      • From Other Chains
      • Via Centralized Exchanges
Powered by GitBook
On this page
Edit on GitHub
  1. Build On Mento
  2. Deployments

Verification

PreviousAddressesNextGetting Mento Stables

Last updated 3 months ago

CtrlK

We've built a handy tool to verify that the on-chain bytecode of deployed Mento contracts matches what has been audited. This is a bit technical and requires at least some knowledge of the stack used for smart contract development and how to use the terminal.

Before you get started make sure you have installed: git, foundry, node, and yarn.

  1. Clone the mento-deployments

  2. Run forge install

  3. Run yarn verify:bytecodes -n <network> -u <upgrade> -c <commit or tag>

For the verifyBytecodes command, you need to pick three parameters as follows:

  • network one of baklava, alfajores or celo

  • upgrade currently only MU01 exists which upgrades Mento from v1.0 to v2.0

  • commit or tag what version of the source files to check against, this should come from the audit report associated with the upgrade.

For example, if we want to verify on Celo mainnet we would run this command:

$ yarn verify:bytecodes -n celo -u MU01 -c v2.0.0

Verification script (verifying the verifier)

In order to trust the results, you also have to trust the verification script. Luckily it's short enough to be able to read comfortably. You can find it here:

https://github.com/mento-protocol/mento-deployment/blob/main/bin/verify-bytecodes.ts
verify-bytecodes.ts

The script flow is the following:

  1. Check out the mento-core submodule at the supplied commit

  2. Clean and recompile all contracts

  3. Find deployed contracts by looking at the related to the upgrade

  4. Compare the bytecode found on-chain for a deployed contract with the local compilation results

  5. Print a pretty table.