Skip to main content

Usage

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.
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
FlagDefaultDescription
--platformetherscanVerification platform: etherscan, arbiscan, polygonscan, basescan, sourcify, blockscout
--api-keyExplorer API key (or set ETHERSCAN_API_KEY / ARBISCAN_API_KEY env var)
--sourcePath to Solidity source file (required)
--nameContract name (defaults to filename)
--compilerv0.8.20+commit.a1b79de6Solidity compiler version
--optimizetrueOptimizer was enabled during compilation
--opt-runs200Optimizer runs
--constructor-argsABI-encoded constructor arguments (hex)
--chain-id42161Chain ID (for Sourcify)
--api-urlCustom API endpoint URL
--flattenPath to flattened source file

verify status

Check the status of a pending verification.
dokrypt verify status abc123-guid --platform arbiscan --api-key YOUR_KEY
FlagDefaultDescription
--platformetherscanVerification platform
--api-keyExplorer API key
--api-urlCustom API endpoint URL

verify sources

List all Solidity source files in a directory.
dokrypt verify sources
dokrypt verify sources contracts

Supported Platforms

PlatformAPI Key Env VarNotes
EtherscanETHERSCAN_API_KEYEthereum mainnet
ArbiscanARBISCAN_API_KEYArbitrum One
PolygonscanPOLYGONSCAN_API_KEYPolygon
BasescanBASESCAN_API_KEYBase
Optimistic EtherscanOPTIMISTIC_API_KEYOptimism
BscScanBSCSCAN_API_KEYBNB Chain
Sourcify(none)Decentralized, no API key needed
Blockscout(none)Requires --api-url

Examples

Verify on Arbiscan:
export ARBISCAN_API_KEY=your-key
dokrypt verify contract 0xAbC... --platform arbiscan --source contracts/MyToken.sol
Verify on local Blockscout:
dokrypt verify contract 0xAbC... --platform blockscout --api-url http://localhost:4000/api --source contracts/MyToken.sol
Verify on Sourcify:
dokrypt verify contract 0xAbC... --platform sourcify --chain-id 42161 --source contracts/MyToken.sol