> For a complete page index, fetch https://docs.conduit.xyz/llms.txt

# Verify contracts with Sourcify

> Verify smart contracts on any Conduit chain using Sourcify. Conduit hosts a Sourcify-compatible verification service at https://contracts.conduit.xyz that works with Foundry, Hardhat, and the Sourcify UI.

Conduit runs a hosted [Sourcify](https://github.com/argotorg/sourcify/tree/master/services/server) instance at [contracts.conduit.xyz](https://contracts.conduit.xyz). It speaks the same API as the public Sourcify server, so you can verify contracts with the same tooling—Foundry, Hardhat, the Sourcify UI, or direct API calls.

The main difference: **Conduit's server automatically supports every Conduit chain.** You don't need to submit chain metadata to the [Sourcify chains repository](https://github.com/sourcifyeth/sourcify-chains) before verifying—Conduit recognizes newly launched chains immediately.

Verified contracts show source code and ABIs in [Conduit Explorer](/chains/explorer), making it easier for users to read and interact with your contracts.

## Verify with Foundry

The easiest way to verify a contract is to pass `--verifier sourcify` and Conduit's verifier URL to Foundry. The chain ID is auto-detected from your RPC URL.

You can either set the verifier URL with an environment variable:

```bash
export VERIFIER_URL=https://contracts.conduit.xyz
```

Or pass `--verifier-url https://contracts.conduit.xyz` directly.

### Verify during deployment

Deploy and verify in a single command:

```bash
# forge create
forge create src/Token.sol:Token \
  --rpc-url $RPC_URL \
  --interactive \
  --broadcast \
  --verify \
  --verifier sourcify \
  --verifier-url https://contracts.conduit.xyz

# forge script
forge script script/Deploy.s.sol \
  --rpc-url $RPC_URL \
  --interactive \
  --sender <YOUR_WALLET_ADDRESS> \
  --broadcast \
  --verify \
  --verifier sourcify \
  --verifier-url https://contracts.conduit.xyz
```

### Verify an already-deployed contract

Use `forge verify-contract` for contracts that are already on-chain:

```bash
forge verify-contract \
  --rpc-url $RPC_URL \
  --verifier sourcify \
  --verifier-url https://contracts.conduit.xyz \
  <CONTRACT_ADDRESS> \
  src/MyContract.sol:MyContract
```

Make sure the compiler settings (version, optimizer, EVM version) match the ones you used at deploy time.

For more verification flags, see the [Sourcify Foundry guide](https://docs.sourcify.dev/docs/verify-via-foundry/) and the [Foundry deployment docs](https://getfoundry.sh/forge/deploying).

## Verify with Hardhat

Add Sourcify verification to your `hardhat.config.ts` using [`@nomicfoundation/hardhat-verify`](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify):

```ts
import "@nomicfoundation/hardhat-verify";

const config: HardhatUserConfig = {
  // ... your existing config
  sourcify: {
    enabled: true,
    apiUrl: "https://contracts.conduit.xyz",
    // Your chain's Conduit Explorer URL (where users view verified contracts)
    browserUrl: "https://fast-explorer-<your-network-id>.t.conduit.xyz",
  },
};
```

Then verify:

```bash
npx hardhat verify --network <your-network> <CONTRACT_ADDRESS> [constructor args...]
```

## Verify with the Sourcify UI

The hosted [Sourcify Verify UI](https://verify.sourcify.dev/) can point at any Sourcify-compatible server. To use it with Conduit:

1. Open [verify.sourcify.dev](https://verify.sourcify.dev/).
2. Click the **Settings** (gear) icon in the top right.
3. Under **Add Custom Server URL**, enter `https://contracts.conduit.xyz` and click **Add**.
4. Select the new entry from the **Sourcify Server URL** dropdown.
5. Pick your Conduit chain, paste the contract address, and upload your sources or metadata.

![Sourcify Verify UI configured with the Conduit server](/_fern-img/3c3acfcaeffe8cc9f65810e8c4cd3902ed163f9d90cccd6fae4138f5f9d957c2.webp)

Once verification completes, the contract is available on both the Sourcify server and Conduit Explorer for your chain.

## Troubleshooting

If verification fails, double-check that:

* **Compiler version** matches the deploy-time version, including the commit hash (for example, `0.8.20+commit.a1b79de6`).
* **Optimizer** settings (enabled and runs) match deployment.
* **EVM version** matches what was used at deployment.
* **All imported sources** are included in the verification request.
* **Contract identifier** uses the `path/to/Contract.sol:ContractName` format.