> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dokrypt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# dokrypt verify

> Verify contract source code on block explorers.

## Usage

```bash theme={null}
dokrypt verify contract <address> [flags]
dokrypt verify status <guid> [flags]
dokrypt verify sources [directory]
```

## Subcommands

### `verify contract`

Verify a deployed contract's source code on Etherscan, Arbiscan, Sourcify, or Blockscout.

```bash theme={null}
dokrypt verify contract 0x1234... --platform arbiscan --source contracts/MyToken.sol --api-key YOUR_KEY
dokrypt verify contract 0x1234... --platform sourcify --chain-id 42161 --source contracts/MyToken.sol
dokrypt verify contract 0x1234... --platform blockscout --api-url http://localhost:4000/api --source contracts/MyToken.sol
```

| Flag                 | Default                   | Description                                                                             |
| -------------------- | ------------------------- | --------------------------------------------------------------------------------------- |
| `--platform`         | `etherscan`               | Verification platform: etherscan, arbiscan, polygonscan, basescan, sourcify, blockscout |
| `--api-key`          |                           | Explorer API key (or set ETHERSCAN\_API\_KEY / ARBISCAN\_API\_KEY env var)              |
| `--source`           |                           | Path to Solidity source file (required)                                                 |
| `--name`             |                           | Contract name (defaults to filename)                                                    |
| `--compiler`         | `v0.8.20+commit.a1b79de6` | Solidity compiler version                                                               |
| `--optimize`         | `true`                    | Optimizer was enabled during compilation                                                |
| `--opt-runs`         | `200`                     | Optimizer runs                                                                          |
| `--constructor-args` |                           | ABI-encoded constructor arguments (hex)                                                 |
| `--chain-id`         | `42161`                   | Chain ID (for Sourcify)                                                                 |
| `--api-url`          |                           | Custom API endpoint URL                                                                 |
| `--flatten`          |                           | Path to flattened source file                                                           |

### `verify status`

Check the status of a pending verification.

```bash theme={null}
dokrypt verify status abc123-guid --platform arbiscan --api-key YOUR_KEY
```

| Flag         | Default     | Description             |
| ------------ | ----------- | ----------------------- |
| `--platform` | `etherscan` | Verification platform   |
| `--api-key`  |             | Explorer API key        |
| `--api-url`  |             | Custom API endpoint URL |

### `verify sources`

List all Solidity source files in a directory.

```bash theme={null}
dokrypt verify sources
dokrypt verify sources contracts
```

## Supported Platforms

| Platform             | API Key Env Var       | Notes                            |
| -------------------- | --------------------- | -------------------------------- |
| Etherscan            | `ETHERSCAN_API_KEY`   | Ethereum mainnet                 |
| Arbiscan             | `ARBISCAN_API_KEY`    | Arbitrum One                     |
| Polygonscan          | `POLYGONSCAN_API_KEY` | Polygon                          |
| Basescan             | `BASESCAN_API_KEY`    | Base                             |
| Optimistic Etherscan | `OPTIMISTIC_API_KEY`  | Optimism                         |
| BscScan              | `BSCSCAN_API_KEY`     | BNB Chain                        |
| Sourcify             | (none)                | Decentralized, no API key needed |
| Blockscout           | (none)                | Requires `--api-url`             |

## Examples

Verify on Arbiscan:

```bash theme={null}
export ARBISCAN_API_KEY=your-key
dokrypt verify contract 0xAbC... --platform arbiscan --source contracts/MyToken.sol
```

Verify on local Blockscout:

```bash theme={null}
dokrypt verify contract 0xAbC... --platform blockscout --api-url http://localhost:4000/api --source contracts/MyToken.sol
```

Verify on Sourcify:

```bash theme={null}
dokrypt verify contract 0xAbC... --platform sourcify --chain-id 42161 --source contracts/MyToken.sol
```
