# Verifying A Contract

**EVM**

**Foundry**

{% embed url="<https://getfoundry.sh/forge/deploying/#verifying-a-pre-existing-contract>" %}
Verify a pre-existing contract
{% endembed %}

**Hardhat**

{% embed url="<https://hardhat.org/hardhat-runner/docs/guides/verifying>" %}

**Solana**

In Anchor you need to build a verifiable build using Docker to produce a consistent executable.

{% embed url="<https://www.anchor-lang.com/docs/references/verifiable-builds>" %}

IDL (Interface Definition Language) is Solana's lingo for ABI. An IDL is uploaded to an account on-chain and block explorers are able to pick it up automatically.

```sh
anchor idl init --filepath target/idl/your_program.json $PROGRAM_ID --provider.cluster mainnet
```

To verify that it is stored correctly, run

```
anchor idl fetch $PROGRAM_ID --provider.cluster mainnet
```

Solana programs are upgradeable by default, so you can also upgrade the IDL:

```
anchor idl upgrade --filepath target/idl/your_program.json $PROGRAM_ID --provider.cluster mainnet
```


---

# Agent Instructions: 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://0xkowloon.gitbook.io/anchor-for-evm-developers/verifying-a-contract.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.
