> For the complete documentation index, see [llms.txt](https://docs.mento.org/mento-v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mento.org/mento-v3/build/deployments/verification.md).

# Verification

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](https://book.getfoundry.sh/getting-started/installation), node, and yarn.

1. Clone the [mento-deployments](https://github.com/mento-protocol/mento-deployment)
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](/mento-v3/build/smart-contracts/audits.md) 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
```

<figure><img src="/files/0cRmglExCi2OczDZHK0D" alt=""><figcaption></figcaption></figure>

#### 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:

{% embed url="<https://github.com/mento-protocol/mento-deployment/blob/main/bin/verify-bytecodes.ts>" %}
verify-bytecodes.ts
{% endembed %}

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 [broadcast folders](#user-content-fn-1)[^1] 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.

[^1]: This is where Foundry stores the artifacts of on-chain operations done via scripts. We commit all relevant runs to the repository and use them to reconstruct the state of the system.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mento.org/mento-v3/build/deployments/verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
