Skip to main content

Verify with Foundry

URL Changed

The verification API URL has been updated. Please update your configuration accordingly.

  • Old (no longer supported):
    • https://mainnet-api.kaiascan.io/forge-verify
    • https://kairos-api.kaiascan.io/forge-verify
  • New:
    • https://compiler-api-v2.kaiascan.io/mainnet/forge-verify
    • https://compiler-api-v2.kaiascan.io/kairos/forge-verify

You can verify contracts directly using the Standard JSON input format. This approach supports multi-file projects and preserves the original contract structure.

Mainnet

forge verify-contract --verifier-url https://compiler-api-v2.kaiascan.io/mainnet/forge-verify \
--chain-id 8217 \
{CONTRACT_ADDRESS} src/{CONTRACT_FILE}.sol:{CONTRACT_NAME} \
--retries 1

Kairos

forge verify-contract --verifier-url https://compiler-api-v2.kaiascan.io/kairos/forge-verify \
--chain-id 1001 \
{CONTRACT_ADDRESS} src/{CONTRACT_FILE}.sol:{CONTRACT_NAME} \
--retries 1

Option Descriptions

  • {CONTRACT_ADDRESS}: The address of the deployed contract.
  • {CONTRACT_FILE}: The Solidity source file name (e.g., Counter).
  • {CONTRACT_NAME}: The name of the contract to verify (e.g., Counter).
  • [--retries N] (Optional): Number of retry attempts if verification fails (default: 5, but 1 is recommended).
note

Compiler settings such as optimizer, viaIR, libraries, and EVM version are automatically included in the Standard JSON input generated by Forge from your project configuration. No additional flags are needed.


Troubleshooting

If you encounter any issues during the verification process, please contact us through our support page with details about the error.

Contact Support for Contract Verification Issues


Additional Resources