Smart Contract Verification API
Overview
The Sourcify API enables programmatic access to smart contract verification services, allowing developers to verify contract source code, check verification status, and retrieve verified contract files. This decentralized verification service is essential for developers and auditors who need to ensure smart contract transparency and verify that deployed bytecode matches the provided source code across multiple blockchain networks.
Key Features
Contract Verification: Submit smart contract source code and metadata for verification against deployed bytecode on various blockchain networks.
Multiple Verification Methods: Support for direct file upload, Etherscan-verified contract import, and solc-json compilation artifact verification.
Verification Status Checking: Query the verification status of contracts by address and chain ID, with support for both full and partial matches.
File Retrieval: Access verified contract source code, metadata, and compilation artifacts for any verified contract.
Multi-Chain Support: Compatible with Ethereum mainnet, testnets, and other EVM-compatible networks including Hedera.
Repository Access: Browse and download verified contract files with organized file tree structures.
📣 For interactive API exploration and testing, visit https://server-verify.hashscan.io/api-docs/
Base URL
https://server-verify.hashscan.io
Endpoints
Stateless Verification
POST
/verify
verify contracts by uploading source files and metadata
POST
/verify/etherscan
verify contracts already verified on etherscan
POST
/verify/solc-json
verify contracts using solc-json compilation artifacts
Repository Access
GET
/check-all-by-addresses
check verification status (full or partial match) for multiple contracts
GET
/check-by-addresses
check verification status (full match only) for multiple contracts
GET
/files/any/{chain}/{address}
retrieve all files for a contract (full and partial match)
GET
/files/{chain}/{address}
retrieve all files for a contract (full match only)
GET
/files/contracts/{chain}
get all verified contract addresses on a specific chain
GET
/files/tree/any/{chain}/{address}
get file tree structure (full and partial match)
GET
/files/tree/{chain}/{address}
get file tree structure (full match only)
GET
/repository/contracts/{match_type}/{chain}/{address}/{filePath}
download specific files from verified contracts
Session Management
GET
/session/data
retrieve current session verification data
POST
/session/clear
clear session data
POST
/session/input-files
add files to verification session
POST
/session/input-contract
import deployed contract from ipfs
POST
/session/verify-checked
verify contracts in current session
POST
/session/input-solc-json
add solc-json to session for verification
POST
/session/verify/etherscan
verify etherscan contracts in session
Administration
POST
/change-log-level
modify application logging level (requires authentication)
Sends provided files for verification
0x00000000219ab540356cBB839Cbe05303d7705Fa
1
{"metadata.json":"{...}","SimpleStorage.sol":"// file"}
POST /verify HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 179
{
"address": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
"chain": "1",
"files": {
"metadata.json": "{...}",
"SimpleStorage.sol": "// file"
},
"creatorTxHash": "text",
"chosenContract": "text"
}
{
"result": [
{
"address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac",
"chainId": "1",
"status": "perfect",
"libraryMap": {
"lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac",
"lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac"
}
}
]
}
0x07880D44b0f7b75464ad18fc2b980049c40A8bc3
1
*********************************
POST /verify/etherscan HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 115
{
"address": "0x07880D44b0f7b75464ad18fc2b980049c40A8bc3",
"chainId": "1",
"apiKey": "*********************************"
}
{
"result": [
{
"address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac",
"chainId": "1",
"status": "perfect",
"libraryMap": {
"lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac",
"lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac"
}
}
]
}
Contract address
0x07880D44b0f7b75464ad18fc2b980049c40A8bc3
Chain to check
1
Compiler version
0.8.4+commit.c7e474f2
Name of the contract
Storage
Creator transaction hash
0xb7efb33c736b1e8ea97e356467f99d99221343f077ce31a3e3ac1d2e0636df1d
POST /verify/solc-json HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 269
{
"address": "0x07880D44b0f7b75464ad18fc2b980049c40A8bc3",
"chain": "1",
"files": {
"value": {
"SolcJsonInput.json": "{...}"
}
},
"compilerVersion": "0.8.4+commit.c7e474f2",
"contractName": "Storage",
"creatorTxHash": "0xb7efb33c736b1e8ea97e356467f99d99221343f077ce31a3e3ac1d2e0636df1d"
}
{
"result": [
{
"address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac",
"chainId": "1",
"status": "perfect",
"libraryMap": {
"lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac",
"lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac"
}
}
]
}
Checks if contract with the desired chain and address is verified and in the repository. It will search for both perfect and partial matches.
Comma seperated string of addresses to check for.
Comma separated string of chain IDs.
GET /check-all-by-addresses?addresses=text&chainIds=text HTTP/1.1
Host:
Accept: */*
OK. Also returns 200
with status false
when not found
[
{
"address": "0x6F1D75a53a8805DcA5347aE5F3eDE035CAE3CBC1",
"chainIds": [
{
"chainId": "5",
"status": "perfect"
},
{
"chainId": "10",
"status": "partial"
},
{
"chainId": "11155111",
"status": "perfect"
}
]
},
{
"address": "0x751D7C0Cf91a9b7704541b44E5fF7BeC3D2caA6F",
"chainIds": [
{
"chainId": "5",
"status": "partial"
},
{
"chainId": "10",
"status": "perfect"
}
]
},
{
"address": "0x8D2548A5f641b00Cf0f5B693d4A72D8c0aE24d31",
"chainIds": [
{
"chainId": "5",
"status": "perfect"
}
]
},
{
"address": "0x1f9cA631AE0C4890F99b38634C969b7E4f8719F0",
"status": "false"
}
]
Checks if contract with the desired chain and address is verified and in the repository. It will search only the perfect matches.
The addresses of the contracts.
The IDs of the chains.
GET /check-by-addresses?addresses=text&chainIds=text HTTP/1.1
Host:
Accept: */*
OK
[
{
"address": "0xEb30853fc616Bbb8f1444451A3c202cbcd08Fb47",
"status": "perfect",
"chainIds": [
"43114",
"137"
]
}
]
Returns all files for the desired contract with the address and chain. Searches both full and partial matches.
GET /files/any/{chain}/{address} HTTP/1.1
Host:
Accept: */*
{
"status": "full",
"files": [
{
"name": "metadata.json",
"path": "/home/data/repository/contracts/full_match/3/0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9/metadata.json",
"content": "text"
}
]
}
Returns all files for the desired contract with the address and chain. Searches only for full matches.
GET /files/{chain}/{address} HTTP/1.1
Host:
Accept: */*
[
{
"name": "metadata.json",
"path": "/home/data/repository/contracts/full_match/3/0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9/metadata.json",
"content": "text"
}
]
Retrieve statically served files over the server.
GET /repository/contracts/{full_match | partial_match}/{chain}/{address}/{filePath} HTTP/1.1
Host:
Accept: */*
No content
Returns all verified contracts from the repository for the desired chain. Searches for full and partial matches.
GET /files/contracts/{chain} HTTP/1.1
Host:
Accept: */*
{
"full": [
"0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0",
"0xE9c31091868d68598Ac881738D159A63532d12f9"
],
"partial": [
"0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9",
"0xE9c31091868d68598Ac881738D159A63532d12f9"
]
}
Returns repository URLs for every file in the source tree for the desired chain and address. Searches for full and partial matches.
GET /files/tree/any/{chain}/{address} HTTP/1.1
Host:
Accept: */*
{
"status": "full",
"files": [
"https://contractrepostaging.komputing.org/contracts/full_match/5/0x32a5d2240a60dcF7Af8EfAE6d886ec8BeD5f71bA/metadata.json"
]
}
Returns repository URLs for every file in the source tree for the desired chain and address. Searches only for full matches.
["https://repo.sourcify.dev/contracts/full_match/5/0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0/metadata.json"]
GET /files/tree/{chain}/{address} HTTP/1.1
Host:
Accept: */*
[
"https://repo.sourcify.dev/contracts/full_match/5/0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0/metadata.json"
]
GET /session/data HTTP/1.1
Host:
Accept: */*
OK
{
"contracts": [
{
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"files": {
"found": [
"text"
],
"missing": [
"browser/1_Storage.sol"
]
},
"status": "error"
}
],
"unused": [
"text"
]
}
Remote file URL
Dry-run flag. When present and set to true, a successful verification result will not be stored in the repository.
false
POST /session/input-files HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 12
{
"files": {}
}
{
"contracts": [
{
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"files": {
"found": [
"text"
],
"missing": [
"text"
]
},
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"status": "perfect"
}
],
"unused": [
"text"
]
}
POST /session/input-contract HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"address": "text",
"chainId": "text"
}
{
"contracts": [
{
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"files": {
"found": [
"text"
],
"missing": [
"text"
]
},
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"status": "perfect"
}
],
"unused": [
"text"
]
}
Dry-run flag. When present and set to true, a successful verification result will not be stored in the repository.
false
POST /session/verify-checked HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 197
{
"contracts": [
{
"address": "0x656d0062eC89c940213E3F3170EA8b2add1c0143",
"chainId": "100",
"creatorTxHash": "text",
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe"
}
]
}
{
"contracts": [
{
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"address": "0x656d0062eC89c940213E3F3170EA8b2add1c0143",
"chainId": "100",
"files": {
"found": [
"browser/1_Storage.sol"
],
"missing": [
"text"
]
},
"status": "perfect",
"storageTimestamp": "2021-01-12T15:41:56.502Z"
}
],
"unused": [
"text"
]
}
Compiler version
POST /session/input-solc-json HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 69
{
"files": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"compilerVersion": "text"
}
{
"contracts": [
{
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"address": "0x656d0062eC89c940213E3F3170EA8b2add1c0143",
"chainId": "100",
"files": {
"found": [
"browser/1_Storage.sol"
],
"missing": [
"text"
]
},
"status": "perfect",
"storageTimestamp": "2021-01-12T15:41:56.502Z"
}
],
"unused": [
"text"
]
}
*********************************
POST /session/verify/etherscan HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 80
{
"address": "text",
"chainId": "text",
"apiKey": "*********************************"
}
{
"contracts": [
{
"verificationId": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe",
"compiledPath": "browser/1_Storage.sol",
"name": "Storage",
"compilerVersion": "0.6.6+commit.6c089d02",
"address": "0x656d0062eC89c940213E3F3170EA8b2add1c0143",
"chainId": "100",
"files": {
"found": [
"browser/1_Storage.sol"
],
"missing": [
"text"
]
},
"status": "perfect",
"storageTimestamp": "2021-01-12T15:41:56.502Z"
}
],
"unused": [
"text"
]
}
Allows changing the logging level dynamically at runtime for the application. Requires Basic Authentication.
The new logging level to set.
Logging level changed to: debug
POST /change-log-level HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17
{
"level": "debug"
}
Logging level changed to: debug
Last updated
Was this helpful?