Contract Verification via Sourcify

Along with contract verification through a flattened source file (the default option in Blockscout), a Sourcify API verification option is also available. Projects who want to use this feature need to set the following ENV variables.

SOURCIFY_INTEGRATION_ENABLED=true
SOURCIFY_SERVER_URL=https://sourcify.dev/server
SOURCIFY_REPO_URL=https://repo.sourcify.dev/select-contract/

Usage Example

Verify your contract using Sourcify:

1) Go to the Verify contract page (Other -> Verify contract)

2) Enter the deployed contract address, select Solidity (Sourcify) from the Verification method dropdown.

3) Drag and drop (or click the button to add files from your computer) all .sol files used by the target contract you want to verify and the .json file containing the contract's metadata. For example, hardhat stores the outputs of the compilations under the artifacts/build-info/ folder inside the project. More info is available here.

If your contract has linked libraries you should also drag & drop .json files _for those libraries. Once all files are added, start verification by clicking the _Verify & Publish button.

5) After several seconds your contract should be verified through Sourcify's API (If verification fails, you will see the reason in the dropzone). Verification metadata will be saved in the Blockscout DB and you will see the verified contract page with the link to the same metadata in the Sourcify contract repository.

Example Contract:

Last updated