curl --request POST \
--url https://sourcify.dev/server/v2/verify/{chainId}/{address} \
--header 'Content-Type: application/json' \
--data '
{
"stdJsonInput": {
"language": "Solidity",
"sources": {
"contracts/Storage.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Storage {\n uint256 number;\n\n function setNumber(uint256 newNumber) public {\n number = newNumber;\n }\n\n function getNumber() public view returns (uint256) {\n return number;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
}
}
},
"compilerVersion": "0.8.7+commit.e28d00a7",
"contractIdentifier": "contracts/Storage.sol:Storage",
"creationTransactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206"
}
'{
"verificationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"customCode": "unsupported_chain",
"message": "The chain with chainId 9429413 is not supported",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}{
"customCode": "already_verified",
"message": "Contract 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 on chain 31337 is already verified with runtimeMatch and creationMatch both being exact matches.",
"errorId": "23aaf52e-168a-4cfa-8463-65ddfb792efc"
}{
"customCode": "too_many_requests",
"message": "You are sending too many requests",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}{
"customCode": "internal_error",
"message": "Something went wrong",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}Verify Contract (Standard JSON)
Submit a contract for verification via the Solidity standard JSON input, Vyper JSON input, or Fe JSON input (a Sourcify-defined format — Fe has no official compiler JSON interface).
There are no “single file” or “multi-part” verification endpoints because those are essentially wrappers around the Solidity compiler’s JSON interface. The verification frontend can provide files and settings options to resemble these.
You can optionally pass the creationTransactionHash to make Sourcify reliably fetching the creation bytecode. Otherwise, it will try to fetch it itself which is dependent on external services.
Note: The outputSelection field in the stdJsonInput.settings will be overridden during verification to ensure all necessary artifacts are generated.
curl --request POST \
--url https://sourcify.dev/server/v2/verify/{chainId}/{address} \
--header 'Content-Type: application/json' \
--data '
{
"stdJsonInput": {
"language": "Solidity",
"sources": {
"contracts/Storage.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Storage {\n uint256 number;\n\n function setNumber(uint256 newNumber) public {\n number = newNumber;\n }\n\n function getNumber() public view returns (uint256) {\n return number;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
}
}
},
"compilerVersion": "0.8.7+commit.e28d00a7",
"contractIdentifier": "contracts/Storage.sol:Storage",
"creationTransactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206"
}
'{
"verificationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"customCode": "unsupported_chain",
"message": "The chain with chainId 9429413 is not supported",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}{
"customCode": "already_verified",
"message": "Contract 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 on chain 31337 is already verified with runtimeMatch and creationMatch both being exact matches.",
"errorId": "23aaf52e-168a-4cfa-8463-65ddfb792efc"
}{
"customCode": "too_many_requests",
"message": "You are sending too many requests",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}{
"customCode": "internal_error",
"message": "Something went wrong",
"errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
}Path Parameters
The chainId number of the EVM chain
1 - 20^\d+$"11155111"
Contract's 20 byte address in hex string with the 0x prefix. Case insensitive.
42(\b0x[a-fA-F0-9]{40}\b)"0x2738d13E81e30bC615766A0410e7cF199FD59A83"
Body
Full standard JSON object to pass to the compiler.
Must include the language field inside the stdJsonInput object. Currently supports Solidity, Vyper, and Fe.
^v?\d+\.\d+\.\d+.*$"0.8.7+commit.e28d00a7"
The fully qualified file path and contract name to indicate which contract to verify, in the format path/to/file:ContractName.
"contracts/Storage.sol:Storage"
The hash of the transaction that created this contract. Optional.
(\b0x[a-f0-9]{64}\b)"0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206"
Response
Successfully submitted the verification. The server started to process the verification.
You can follow the verification status via the returned verificationId at GET /v2/verify/{verificationId}
Was this page helpful?