What you need
Verification succeeds only when the source you submit reproduces the exact bytecode on chain. Before you start, gather these, in the order the request expects them:- Contract address (
contractaddress): where the contract is deployed, with the0xprefix. - Source code (
sourceCode): the exact code that was deployed, as a single file or a Standard JSON input. - Contract name (
contractname): the name of the contract to verify, with its path when needed, such ascontracts/MyToken.sol:MyToken. - Compiler version (
compilerversion): the full version string, such asv0.8.28+commit.7893614a. See the supported list. - Optimization settings (
optimizationUsed,runs): whether optimization was on and the number of runs. These must match the deployment. - Constructor arguments (
constructorArguments): the ABI-encoded arguments, in hex, if your contract used a constructor. Leave empty otherwise. - EVM version (
evmVersion): the target EVM version, or the compilerdefault. - License type (
licenseType): the license to publish with the code, such as3for MIT.
Choose a source format
Setcodeformat to match how you submit the source:
solidity-standard-json-input: the compiler’s Standard JSON input. It carries the source, imports, and every compiler setting in one object, sooptimizationUsed,runs, andevmVersiondo not need to be sent separately. Use this for any contract with imports (such as OpenZeppelin) or non-default settings. Most build tools can output it.solidity-single-file: one flattened.solfile with no external imports. With this format the compiler settings are not embedded, so you sendoptimizationUsedandrunsas separate fields (per the endpoint’s field notes,optimizationUsedis required for single-file submissions).
Verify your contract
1
Submit the source code
Send a For
POST to the verifysourcecode action. The chainid in the URL selects the network, so use the chainid of the chain your contract is deployed to. The example uses Standard JSON input, with the fields in the order the endpoint lists them.solidity-single-file, set codeformat=solidity-single-file, put the flattened source in sourceCode, and add optimizationUsed and runs (they follow codeformat, before constructorArguments, in the field order).A successful submission returns a result containing a GUID. This is your request ID, not a confirmation. Keep it for the next step.Verifying on one chain’s explorer does not verify the contract on any other. Repeat this flow with the matching
chainid for each chain the contract is deployed to.2
Check the verification status
Pass the GUID to the The If verification does not succeed,
checkverifystatus action to check the result. Verification is queued, so the request may still be processing when you first check: call it again until the result resolves.result field reports the outcome. On success it reads Pass - Verified.result returns the reason. Correct the mismatched input and submit again.3
Confirm the verified source
Once the status reads
Pass - Verified, a green verified checkmark appears on the Contract tab of the contract’s page on the explorer, showing the contract is verified. You can also read the published source back with getsourcecode.