{ "$schema": "https://schemas.sourcemeta.com/openapi/v3.1/schema/2025-09-15.json", "openapi": "3.1.0", "info": { "version": "0.0.1", "title": "Contract Verification API", "description": "API for verifying contracts on various blockchain networks. Provides endpoints to verify contract code, contract ABI, and contract bytecode for multiple chains." }, "externalDocs": { "url": "https://contracts.tempo.xyz/docs", "description": "Contract Verification API Documentation" }, "servers": [ { "url": "https://contracts.tempo.xyz", "description": "Production" }, { "url": "https://contracts.porto.workers.dev", "description": "Service base workers.dev domain (CACHE DISABLED!)" }, { "url": "https://sourcify.dev/server", "description": "Sourcify hosted API" }, { "url": "{CUSTOM_URL}", "description": "Custom Sourcify-compatible API base URL", "variables": { "CUSTOM_URL": { "default": "https://sourcify.dev/server", "description": "The URL of the custom Sourcify-compatible API base URL" } } }, { "url": "https://o.tail388b2e.ts.net", "description": "Localhost Funneled" }, { "url": "http://localhost:{port}", "description": "local", "variables": { "port": { "default": "22222", "description": "localhost port number" } } } ], "tags": [ { "name": "Contract Lookup", "description": "API v2 - Tools and endpoints for looking up contract information" }, { "name": "Verify Contracts", "description": "API v2 - Submit a contract for verification" }, { "name": "Verification Jobs", "description": "API v2 - Check the status of a verification job" }, { "name": "(Deprecated) Stateless Verification", "description": "API v1 - Main verification endpoints - Deprecated. Please verify via API v2 instead." }, { "name": "(Deprecated) Repository", "description": "API v1 - Access to already verified contracts and files. - Deprecated. Please use the API v2 Contract Lookup instead." }, { "name": "(Deprecated) Session Verification", "description": "API v1 - Used by the Sourcify UI to verify contracts. Not intended for external usage. Will require CORS." }, { "name": "Other", "description": "General server endpoints" } ], "paths": { "/health": { "get": { "summary": "Health check endpoint", "description": "Returns server health status", "tags": ["Other"], "responses": { "200": { "description": "Server is healthy", "content": { "text/plain": { "schema": { "type": "string", "example": "Alive and kicking!" } } } } } } }, "/version": { "get": { "summary": "Get version information", "description": "Returns version information for the server and its dependencies, along with the git commit hash", "tags": ["Other"], "responses": { "200": { "description": "Version information", "content": { "application/json": { "schema": { "type": "object", "properties": { "sourcifyServerVersion": { "type": "string", "description": "Version of the Sourcify server", "example": "3.6.1" }, "libSourcifyVersion": { "type": "string", "description": "Version of @ethereum-sourcify/lib-sourcify", "example": "^3.0.2" }, "sourcifyCompilersVersion": { "type": "string", "description": "Version of @ethereum-sourcify/compilers", "example": "^1.0.12" }, "bytecodeUtilsVersion": { "type": "string", "description": "Version of @ethereum-sourcify/bytecode-utils", "example": "^1.3.15" }, "gitCommitHash": { "type": "string", "description": "Git commit hash the server was built from", "example": "755c0fcf1a2b3c4d5e6f7890abcdef1234567890" } } } } } } } } }, "/chains": { "get": { "summary": "Get supported blockchain chains", "description": "Returns a list of all blockchain networks supported by Sourcify", "tags": ["Other"], "responses": { "200": { "description": "List of supported chains", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Chain name", "example": "Tempo Testnet" }, "title": { "type": "string", "description": "Chain title (optional)", "example": "Tempo Testnet" }, "chainId": { "type": "integer", "description": "Chain ID", "example": 1 }, "rpc": { "type": "array", "items": { "type": "string" }, "description": "List of RPC endpoints", "example": ["https://rpc.mainnet.ethpandaops.io"] }, "traceSupportedRPCs": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of trace support", "example": "trace_transaction" }, "index": { "type": "integer", "description": "Index of the RPC in the rpc array", "example": 0 } } }, "description": "RPCs that support tracing" }, "supported": { "type": "boolean", "description": "Whether the chain is supported for verification", "example": true }, "etherscanAPI": { "type": "boolean", "description": "Whether Etherscan API is available for this chain", "example": true } }, "required": [ "name", "chainId", "rpc", "traceSupportedRPCs", "supported", "etherscanAPI" ] } } } } } } } }, "/verify-ui": { "get": { "summary": "Redirect to verification UI", "tags": ["Other"], "responses": { "302": { "description": "Redirect to verification UI" } } } }, "/repo-ui": { "get": { "summary": "Redirect to repository UI", "tags": ["Other"], "responses": { "302": { "description": "Redirect to repository UI" } } } }, "/private/verify-deprecated": { "post": { "deprecated": false, "description": "Sends provided files for verification\n", "tags": ["Private"], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["address", "chain", "files"], "properties": { "address": { "type": "string", "format": "address", "example": "0x00000000219ab540356cBB839Cbe05303d7705Fa" }, "chain": { "type": "string", "example": "1" }, "files": { "type": "object", "example": { "metadata.json": "{...}", "SimpleStorage.sol": "// file" } }, "creatorTxHash": { "type": "string" }, "chosenContract": { "type": "string" }, "match": { "type": "string" } } } } } }, "responses": { "200": { "description": "The contract has been successfully checked or sourcified", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainId": { "type": "string" }, "status": { "type": "string" }, "message": { "type": "string" }, "libraryMap": { "type": "object" } } } } } }, "examples": { "Perfect Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "perfect", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Partial Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "partial", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Not Deployed": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "null", "message": "Chain #1 does not have a contract deployed at 0x...." } ] } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Metadata not found": { "value": { "error": "Metadata file not found. Did you include \"metadata.json\"?" } }, "Bad Formatted Json": { "value": { "error": "Unexpected token ' in JSON at position 107" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "File Not Found": { "value": { "error": "Couldn't extract files from the request. Please make sure you have added files" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Resource Missing": { "value": { "error": "Resource missing; unsuccessful fetching: contracts/SingleFile.sol" } }, "Deployed and recompiled mismatch": { "value": { "error": "The deployed and recompiled bytecode don't match." } } } } } } } } }, "/private/replace-contract": { "post": { "deprecated": false, "description": "Replaces an existing contract in the database, addressing issues with misaligned or incorrect contract data.\nThis endpoint provides a generic, maintainable solution and optimizes performance by optionally skipping \nrecompilation and on-chain RPC calls, using data already stored in the database.\n", "tags": ["Private"], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "chainId", "address", "forceCompilation", "forceRPCRequest" ], "properties": { "chainId": { "oneOf": [ { "type": "string" }, { "type": "number" } ], "description": "The chain ID of the contract", "example": "1" }, "address": { "type": "string", "format": "address", "description": "The contract address", "example": "0x00000000219ab540356cBB839Cbe05303d7705Fa" }, "transactionHash": { "type": "string", "description": "The creation transaction hash", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" }, "forceCompilation": { "type": "boolean", "description": "If true, recompiles the contract using the provided jsonInput, compilerVersion and compilationTarget", "example": false }, "forceRPCRequest": { "type": "boolean", "description": "If true, fetches the contract's information from the RPC", "example": false }, "jsonInput": { "type": "object", "description": "Required if forceCompilation is true. The JSON input to use for recompilation" }, "compilerVersion": { "type": "string", "description": "Required if forceCompilation is true. The compiler version to use for recompilation", "example": "0.8.19+commit.7dd6d404" }, "compilationTarget": { "type": "string", "description": "Required if forceCompilation is true. The compilation target to use for recompilation", "example": "project:/contracts/Storage.sol:Storage" }, "customReplaceMethod": { "type": "string", "description": "Specifies the custom database update strategy to use when replacing contract data. \nAvailable methods:\n- \"replace-creation-information\": Updates an existing verified contract's creation bytecode, \n deployment transaction details (hash, block number, transaction index, deployer), and \n creation match status while preserving the runtime verification data. This method is \n useful for correcting incomplete or missing creation data on contracts that were \n previously verified only against runtime bytecode.\n- \"replace-metadata\": Updates only the metadata of an existing verified contract.\n", "example": "replace-creation-information" } } } } } }, "responses": { "200": { "description": "The contract has been successfully replaced.", "content": { "application/json": { "schema": { "type": "object", "properties": { "replaced": { "type": "boolean" }, "address": { "type": "string" }, "chainId": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "transactionHash": { "type": "string" }, "newStatus": { "type": "object", "properties": { "creationMatch": { "type": "string" }, "runtimeMatch": { "type": "string" } } }, "rpcFailedFetchingCreationBytecode": { "type": "boolean", "description": "Indicates if the RPC call to fetch the creation bytecode failed" } } }, "examples": { "Success": { "value": { "replaced": true, "address": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "chainId": "1", "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "newStatus": { "creationMatch": "perfect", "runtimeMatch": "perfect" }, "rpcFailedFetchingCreationBytecode": false } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Missing Parameters": { "value": { "error": "jsonInput, compilerVersion and compilationTarget are required when forceCompilation is true" } }, "Verification Failed": { "value": { "error": "The contract is not verified or the verification is not perfect" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Database Error": { "value": { "error": "Database service not available" } }, "Internal Error": { "value": { "error": "Error during replacement process" } } } } } } } } }, "/v2/verify/{chainId}/{address}": { "post": { "tags": ["Verify Contracts"], "summary": "Verify Contract (Standard JSON)", "description": "Submit a contract for verification via the [Solidity standard JSON input](https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description) or [Vyper JSON input](https://docs.vyperlang.org/en/stable/compiling-a-contract.html#input-json-description).\n\nThere 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.\n\nYou 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.\n\n**Note**: The `outputSelection` field in the `stdJsonInput.settings` will be overridden during verification to ensure all necessary artifacts are generated.", "operationId": "verify", "parameters": [ { "$ref": "#/components/parameters/ChainId" }, { "$ref": "#/components/parameters/AddressPath" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "stdJsonInput": { "type": "object", "description": "Full [standard JSON object](https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description) to pass to the compiler. \n\nMust include the `language` field inside the stdJsonInput object. Currently supports Solidity and Vyper.\n" }, "compilerVersion": { "type": "string", "title": "CompilerVersion", "pattern": "^v?\\d+\\.\\d+\\.\\d+.*$", "example": "0.8.7+commit.e28d00a7" }, "contractIdentifier": { "type": "string", "description": "The fully qualified file path and contract name to indicate which contract to verify.", "example": "contracts/Storage.sol:Storage" }, "creationTransactionHash": { "allOf": [ { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" }, { "description": "The hash of the transaction that created this contract. Optional." } ] } }, "required": [ "stdJsonInput", "compilerVersion", "contractIdentifier" ] }, "examples": { "Solidity Contract": { "value": { "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" } }, "Vyper Contract": { "value": { "stdJsonInput": { "language": "Vyper", "sources": { "MyVyperContract.vy": { "content": "\nnumber: public(uint256)\n\n@external\ndef __init__():\n self.number = 0\n\n@external\ndef setNumber(newNumber: uint256):\n self.number = newNumber\n\n@view\n@external\ndef getNumber() -> uint256:\n return self.number\n" } }, "settings": { "optimize": "gas", "evmVersion": "cancun" } }, "compilerVersion": "0.3.10+commit.91361694", "contractIdentifier": "MyVyperContract.vy:MyVyperContract", "creationTransactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" } } } } } }, "responses": { "202": { "description": "Successfully submitted the verification. The server started to process the verification. \n\nYou can follow the verification status via the returned `verificationId` at `GET /v2/verify/{verificationId}`", "content": { "application/json": { "schema": { "type": "object", "title": "VerificationJob", "properties": { "verificationId": { "type": "string", "format": "uuid" } }, "required": ["verificationId"] } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "409": { "description": "The contract is already verified", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "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" } } } } } }, "429": { "description": "The contract is already being verified. Jobs older than 5 minutes are considered stale and automatically expired, allowing a retry.", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "duplicate_verification_request" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "Contract 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 on chain 31337 is already being verified." }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "duplicate_verification_request", "message": "Contract 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 on chain 31337 is already being verified.", "errorId": "23aaf52e-168a-4cfa-8463-65ddfb792efc" } ] }, "examples": { "Example 1": { "value": { "customCode": "too_many_requests", "message": "You are sending too many requests", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/verify/metadata/{chainId}/{address}": { "post": { "tags": ["Verify Contracts"], "summary": "Verify Contract (using Solidity metadata.json)", "description": "Endpoint to submit a verification with the Solidity [metadata.json](https://docs.soliditylang.org/en/latest/metadata.html)", "operationId": "verify-metadata", "parameters": [ { "name": "chainId", "in": "path", "description": "The chainId number of the EVM chain", "required": true, "schema": { "type": "string", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" } }, { "name": "address", "in": "path", "description": "Contract's 20 byte address in hex string with the 0x prefix. Case insensitive.", "required": true, "schema": { "type": "string", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "minLength": 42, "maxLength": 42, "example": "0xe4b10A2a727D0f4863CEBca743a8dAb84cf65b2d" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "sources": { "type": "object", "description": "A mapping from file path to its content.", "additionalProperties": { "type": "string" } }, "metadata": { "type": "object", "description": "The [metadata](https://docs.soliditylang.org/en/latest/metadata.html) as an object." }, "creationTransactionHash": { "allOf": [ { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" }, { "description": "The hash of the transaction that created this contract. Optional." } ] } }, "required": ["sources", "metadata"] }, "examples": { "Example 1": { "value": { "sources": { "contracts/Storage.sol": "// 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", "contracts/Owner.sol": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Owner {\n address public owner;\n\n constructor() {\n owner = msg.sender;\n }\n}\n" }, "metadata": {} } } } } } }, "responses": { "202": { "description": "Successfully submitted the verification. The server started to process the verification. \n\nYou can follow the verification status via the returned `verificationId` at `GET /v2/verify/{verificationId}`", "content": { "application/json": { "schema": { "type": "object", "title": "VerificationJob", "properties": { "verificationId": { "type": "string", "format": "uuid" } }, "required": ["verificationId"] } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "409": { "description": "The contract is already verified", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "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" } } } } } }, "429": { "description": "You are sending too many requests to the server", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "too_many_requests", "message": "You are sending too many requests", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/verify/etherscan/{chainId}/{address}": { "post": { "tags": ["Verify Contracts"], "summary": "Import from Etherscan", "description": "Import a contract verified on an Etherscan instance or a service with Etherscan-alike API", "operationId": "import-from-etherscan", "parameters": [ { "name": "chainId", "in": "path", "description": "The chainId number of the EVM chain", "required": true, "schema": { "type": "string", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" } }, { "name": "address", "in": "path", "description": "Contract's 20 byte address in hex string with the 0x prefix. Case insensitive.", "required": true, "schema": { "type": "string", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "minLength": 42, "maxLength": 42, "example": "0xe4b10A2a727D0f4863CEBca743a8dAb84cf65b2d" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string", "description": "API key to use when importing from the Etherscan instance or Etherscan-alike API." } } } } } }, "responses": { "202": { "description": "Successfully submitted the verification. The server started to process the verification. \n\nYou can follow the verification status via the returned `verificationId` at `GET /v2/verify/{verificationId}`", "content": { "application/json": { "schema": { "type": "object", "title": "VerificationJob", "properties": { "verificationId": { "type": "string", "format": "uuid" } }, "required": ["verificationId"] } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "429": { "description": "You've reached the API key limit for the Etherscan key.", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "etherscan_limit", "message": "Etherscan API key limit reached", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/verify/similarity/{chainId}/{address}": { "post": { "tags": ["Verify Contracts"], "summary": "Verify contract via similarity search", "description": "Starts a verification job that searches the Sourcify database for contracts whose\nruntime bytecode is similar to the contract deployed at the given address. The job will\nattempt to verify against each candidate until a match is found or the candidate list is exhausted.\n", "operationId": "verify-similarity", "parameters": [ { "$ref": "#/components/parameters/ChainId" }, { "$ref": "#/components/parameters/AddressPath" } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "creationTransactionHash": { "allOf": [ { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" }, { "description": "The hash of the transaction that created this contract. Optional." } ] } } } } } }, "responses": { "202": { "description": "Successfully submitted the verification. The server started to process the verification. \n\nYou can follow the verification status via the returned `verificationId` at `GET /v2/verify/{verificationId}`", "content": { "application/json": { "schema": { "type": "object", "title": "VerificationJob", "properties": { "verificationId": { "type": "string", "format": "uuid" } }, "required": ["verificationId"] } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "409": { "description": "The contract is already verified", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "already_verified": { "value": { "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" } } } } } }, "429": { "description": "The contract is already being verified. Jobs older than 5 minutes are considered stale and automatically expired, allowing a retry.", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "duplicate_verification_request": { "value": { "customCode": "duplicate_verification_request", "message": "Contract 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 on chain 31337 is already being verified.", "errorId": "23aaf52e-168a-4cfa-8463-65ddfb792efc" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/verify/{verificationId}": { "get": { "tags": ["Verification Jobs"], "summary": "Check verification job status", "description": "Endpoint to get the status of a verification job.\n\nJobs that have been pending for more than 5 minutes are considered stale and will be automatically expired with a `timeout` error code when polled.\n\nAlternatively you can directly check the verification status of a contract with with chainId+address at `GET /v2/contract/{chainId}/{address}`", "operationId": "verification-status", "parameters": [ { "name": "verificationId", "in": "path", "description": "Verification Job ID returned from the server for a verification request.", "required": true, "schema": { "type": "string", "format": "uuid", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "minLength": 36, "maxLength": 36, "example": "550e8400-e29b-41d4-a716-446655440000" } } ], "responses": { "200": { "description": "The verification job completed either with success or failure. This endpoint returns `200` even if the verification job fails. Check the `contract.match` field and `error` for verification statuses.\n\nIf the job is not completed yet (i.e. pending), the `isJobCompleted` will be false.", "content": { "application/json": { "schema": { "type": "object", "allOf": [ { "type": "object", "properties": { "isJobCompleted": { "type": "boolean" }, "verificationId": { "type": "string", "format": "uuid" }, "error": { "allOf": [ { "examples": [ { "customCode": "no_match", "message": "The onchain and recompiled bytecodes don't match.", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192", "recompiledCreationCode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "recompiledRuntimeCode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "onchainCreationCode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070034", "onchainRuntimeCode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070034", "creationTransactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" } ], "allOf": [ { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": [ "customCode", "message", "errorId" ], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, { "type": "object", "properties": { "recompiledCreationCode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "recompiledRuntimeCode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "onchainCreationCode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "onchainRuntimeCode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "creationTransactionHash": { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" }, "errorData": { "type": "object" } } } ] }, { "description": "Optional, when the verification fails for some reason." } ] }, "jobStartTime": { "type": "string", "format": "date-time" }, "jobFinishTime": { "type": "string" }, "compilationTime": { "type": "string", "description": "Time it took to compile the contract on the server in milliseconds.", "example": "1333" }, "externalVerifications": { "type": "object", "description": "Links to external verification status endpoints on Etherscan-alike services.", "properties": { "etherscan": { "type": "object", "description": "Status metadata for the verification job mirrored on an external explorer API.", "properties": { "verificationId": { "type": "string", "description": "Identifier returned by the external verifier when the job was created.", "example": "x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "error": { "type": "string", "description": "Error message returned by the external verifier. Present when the verification failed.", "example": "NOTOK: Max rate limit reached" }, "statusUrl": { "type": "string", "format": "uri", "description": "Direct URL to query the verification status from the explorer API.", "example": "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=checkverifystatus&guid=x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "explorerUrl": { "type": "string", "format": "uri", "description": "Direct URL to the block explorer page for the contract", "example": "https://etherscan.io/address/0x0D41E0B7bbdEBDBc684020dcb64ADe76C0338222#code" } } }, "blockscout": { "type": "object", "description": "Status metadata for the verification job mirrored on an external explorer API.", "properties": { "verificationId": { "type": "string", "description": "Identifier returned by the external verifier when the job was created.", "example": "x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "error": { "type": "string", "description": "Error message returned by the external verifier. Present when the verification failed.", "example": "NOTOK: Max rate limit reached" }, "statusUrl": { "type": "string", "format": "uri", "description": "Direct URL to query the verification status from the explorer API.", "example": "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=checkverifystatus&guid=x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "explorerUrl": { "type": "string", "format": "uri", "description": "Direct URL to the block explorer page for the contract", "example": "https://etherscan.io/address/0x0D41E0B7bbdEBDBc684020dcb64ADe76C0338222#code" } } }, "routescan": { "type": "object", "description": "Status metadata for the verification job mirrored on an external explorer API.", "properties": { "verificationId": { "type": "string", "description": "Identifier returned by the external verifier when the job was created.", "example": "x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "error": { "type": "string", "description": "Error message returned by the external verifier. Present when the verification failed.", "example": "NOTOK: Max rate limit reached" }, "statusUrl": { "type": "string", "format": "uri", "description": "Direct URL to query the verification status from the explorer API.", "example": "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=checkverifystatus&guid=x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi" }, "explorerUrl": { "type": "string", "format": "uri", "description": "Direct URL to the block explorer page for the contract", "example": "https://etherscan.io/address/0x0D41E0B7bbdEBDBc684020dcb64ADe76C0338222#code" } } } } } }, "required": ["isJobCompleted", "verificationId"] }, { "type": "object", "properties": { "contract": { "type": "object", "title": "VerifiedContractMinimal", "properties": { "match": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "creationMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "runtimeMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "chainId": { "type": "string", "title": "ChainId", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "verifiedAt": { "type": "string", "format": "date-time", "example": "2024-07-24T12:00:00Z" }, "matchId": { "type": "string", "example": "3266227" }, "name": { "type": "string", "description": "Contract name (Tempo extension)", "example": "MyContract" } }, "required": [ "match", "creationMatch", "runtimeMatch", "chainId", "address" ] } } } ] }, "examples": { "Success": { "value": { "isJobCompleted": true, "verificationId": "72d12273-0723-448e-a9f6-f7957128efa5", "jobStartTime": "2024-07-24T11:00:00Z", "jobFinishTime": "2024-07-24T12:00:00Z", "compilationTime": "1333", "contract": { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "3266227", "name": "MyContract" } } }, "Pending": { "value": { "isJobCompleted": false, "verificationId": "72d12273-0723-448e-a9f6-f7957128efa5", "jobStartTime": "2024-07-24T12:00:00Z", "contract": { "match": null, "creationMatch": null, "runtimeMatch": null, "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" } } }, "Error": { "value": { "isJobCompleted": true, "verificationId": "249c2f4b-af6c-46a7-a72e-d079da70ac0e", "jobStartTime": "2025-05-20T07:24:00Z", "jobFinishTime": "2025-05-20T07:24:08Z", "contract": { "match": null, "creationMatch": null, "runtimeMatch": null, "chainId": "31337", "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, "error": { "customCode": "compiler_error", "message": "Compile error. [{\"component\":\"general\",\"errorCode\":\"2314\",\"formattedMessage\":\"ParserError: Expected ';' but got '{'\\n --> project:/contracts/Storage.sol:9:17:\\n |\\n9 | contrat Storage {\\n | ^\\n\\n\",\"message\":\"Expected ';' but got '{'\",\"severity\":\"error\",\"sourceLocation\":{\"end\":158,\"file\":\"project:/contracts/Storage.sol\",\"start\":157},\"type\":\"ParserError\"}]", "errorId": "f319b7fc-0286-4c23-bf1f-75996419a2ce", "onchainRuntimeCode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c80632e64cec11460375780636057361d146051575b600080fd5b603d6069565b6040516048919060c2565b60405180910390f35b6067600480360381019060639190608f565b6072565b005b60008054905090565b8060008190555050565b60008135905060898160e5565b92915050565b60006020828403121560a057600080fd5b600060ac84828501607c565b91505092915050565b60bc8160db565b82525050565b600060208201905060d5600083018460b5565b92915050565b6000819050919050565b60ec8160db565b811460f657600080fd5b5056fea264697066735822122005183dd5df276b396683ae62d0c96c3a406d6f9dad1ad0923daf492c531124b164736f6c63430008040033", "creationTransactionHash": "0xdd419b049534d2ead35de292ce73f3a9d9ecad33cdc1da1cae1d9fa3a86c74e1", "errorData": { "compilerErrors": [ { "component": "general", "errorCode": "2314", "formattedMessage": "ParserError: Expected ';' but got '{'\n --> project:/contracts/Storage.sol:9:17:\n |\n9 | contrat Storage {\n | ^\n\n", "message": "Expected ';' but got '{'", "severity": "error", "sourceLocation": { "end": 158, "file": "project:/contracts/Storage.sol", "start": 157 }, "type": "ParserError" } ] } } } } } } } }, "404": { "description": "The job is not found with this ID", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "job_not_found", "message": "The verification job with id 461157eb-e4ea-4c5f-9aec-04c56924fd96 was not found", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/contract/{chainId}/{address}": { "get": { "tags": ["Contract Lookup"], "summary": "Get contract", "description": "By default returns minimal information about the contract: `match`, `creation_match`, `runtime_match`, `chainId`, `address`, and `verifiedAt`\n\nTo get other details one can either list the fields requested in the `fields` query param or ask all fields but omit several with `omit`. To get everything just pass `fields=all`.\n\nFor Sourcify-verified contracts, the response fields keep their usual Sourcify meanings. Tempo-native contracts such as native precompiles can also be returned from this endpoint. In that case, verification-specific fields such as `match`, `creationMatch`, `runtimeMatch`, `verifiedAt`, and `matchId` can be `null`, and Tempo-specific provenance and native source metadata is returned under `extensions.tempo`.", "operationId": "get-contract", "parameters": [ { "name": "fields", "in": "query", "description": "Comma seperated fields to include in the response. Can also take `all`. Supports dotted paths, including Tempo vendor-specific fields such as `extensions.tempo.nativeSource`.", "allowReserved": true, "schema": { "type": "string", "example": "abi,metadata,creationBytecode.onchainBytecode,deployment.blockNumber,compilation,extensions.tempo.nativeSource" } }, { "name": "omit", "in": "query", "description": "Comma seperated fields to NOT include in the response. All fields except matching ones will be returned. Can't be used simultanously with `fields`.", "allowReserved": true, "schema": { "type": "string", "example": "userdoc,devdoc,storageLayout,compilation.sources,extensions" } }, { "$ref": "#/components/parameters/ChainId" }, { "$ref": "#/components/parameters/AddressPath" } ], "responses": { "200": { "description": "Contract lookup response for a Sourcify-verified contract or a Tempo-native contract", "content": { "application/json": { "schema": { "type": "object", "allOf": [ { "type": "object", "title": "VerifiedContractMinimal", "properties": { "match": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for the overall contract match. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "creationMatch": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for creation bytecode matching. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "runtimeMatch": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for runtime bytecode matching. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "chainId": { "type": "string", "title": "ChainId", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "verifiedAt": { "type": ["string", "null"], "format": "date-time", "description": "Timestamp when the contract was verified by Sourcify-compatible bytecode matching. `null` for Tempo-native contracts that only expose curated source.", "example": "2024-07-24T12:00:00Z" }, "matchId": { "type": ["string", "null"], "description": "Identifier of the verified contract match. `null` for Tempo-native contracts that only expose curated source.", "example": "3266227" } }, "required": [ "match", "creationMatch", "runtimeMatch", "chainId", "address" ] }, { "type": "object", "properties": { "creationBytecode": { "type": "object", "title": "CreationBytecodeResponse", "properties": { "onchainBytecode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "recompiledBytecode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "sourceMap": { "type": "string" }, "linkReferences": { "type": "object", "title": "LinkReferences", "properties": { "id": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "title": "LinkReference", "properties": { "start": { "type": "integer" }, "length": { "type": "string" } }, "examples": [ { "start": 3078, "length": 20 } ] } } } } }, "examples": [ { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } } ] }, "cborAuxdata": { "allOf": [ { "type": "object", "title": "CborAuxdataObject", "additionalProperties": { "type": "object", "properties": { "value": { "type": "string", "example": "0xa26469706673582212201e80049ede18eadf4ab7f0dea2c32f2375c33b5aef0b1a16cc5223dbc681559364736f6c63430007060033" }, "offset": { "type": "integer", "example": 5471 } } }, "examples": [ { "1": { "value": "0xa2646970667358221220d6808f0352d5e503f1f878b19b1bf46c893bac1e20b3c51884efb58a87435b5564736f6c634300080a0033", "offset": 18685 }, "2": { "value": "0xa264697066735822122017bf4253b73b339897d7c117916781f30b434e6caa783b20eb15065469814dcf64736f6c634300080a0033", "offset": 18465 } } ] }, { "description": "CborAuxdata that is found on the recompiled bytecode." } ] }, "transformations": { "type": "array", "title": "CreationTransformations", "examples": [ [ { "id": "1", "type": "replace", "offset": 18040, "reason": "cborAuxdata" }, { "type": "insert", "offset": 6183, "reason": "constructorArguments" }, { "id": "sources/lib/MyLib.sol:MyLib", "type": "replace", "offset": 582, "reason": "library" } ] ], "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Does not exist on `constructorArguments`. Used to find the corresponding value of the Transformation in the TransformationValues dictionary" }, "type": { "type": "string", "enum": ["replace", "insert"], "description": "`insert` when the transformation value is appended to the bytecode e.g. constructor arguments" }, "offset": { "type": "integer", "example": 1322 }, "reason": { "type": "string", "enum": [ "cborAuxdata", "library", "constructorArguments" ], "description": "Keep in mind the `library` reason is singular here but plural in the TransformationValues dictionary: `libraries`" } }, "required": ["type", "offset", "reason"] } }, "transformationValues": { "type": "object", "title": "CreationTransformationValues", "properties": { "libraries": { "type": "object", "additionalProperties": { "type": "string", "title": "AddressLowercase", "description": "Contract Address in hex string", "pattern": "(\\b0x[a-f0-9]{40}\\b)", "example": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" } }, "constructorArguments": { "type": "string", "title": "HexString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x1a2b3c4d" }, "cborAuxdata": { "type": "object", "description": "Different format than the `cborAuxdata` field under the bytecode object. \n\nWill be here only if there was a transformation on the cborAuxdata. If cborAuxdatas matched, there won't be a transformation.", "additionalProperties": { "type": "string", "title": "HexString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x1a2b3c4d" } } }, "examples": [ { "libraries": { "sources/lib/MyLib.sol:MyLib": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" }, "constructorArguments": "0x00000000000000000000000085fe79b998509b77bf10a8bd4001d58475d29386", "cborAuxdata": { "0": "0xa26469706673582212201c37bb166aa1bc4777a7471cda1bbba7ef75600cd859180fa30d503673b99f0264736f6c63430008190033" } } ] } } }, "runtimeBytecode": { "type": "object", "title": "RuntimeBytecodeResponse", "properties": { "onchainBytecode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "recompiledBytecode": { "type": "string", "title": "BytecodeString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "sourceMap": { "type": "string" }, "linkReferences": { "type": "object", "title": "LinkReferences", "properties": { "id": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "title": "LinkReference", "properties": { "start": { "type": "integer" }, "length": { "type": "string" } }, "examples": [ { "start": 3078, "length": 20 } ] } } } } }, "examples": [ { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } } ] }, "cborAuxdata": { "allOf": [ { "type": "object", "title": "CborAuxdataObject", "additionalProperties": { "type": "object", "properties": { "value": { "type": "string", "example": "0xa26469706673582212201e80049ede18eadf4ab7f0dea2c32f2375c33b5aef0b1a16cc5223dbc681559364736f6c63430007060033" }, "offset": { "type": "integer", "example": 5471 } } }, "examples": [ { "1": { "value": "0xa2646970667358221220d6808f0352d5e503f1f878b19b1bf46c893bac1e20b3c51884efb58a87435b5564736f6c634300080a0033", "offset": 18685 }, "2": { "value": "0xa264697066735822122017bf4253b73b339897d7c117916781f30b434e6caa783b20eb15065469814dcf64736f6c634300080a0033", "offset": 18465 } } ] }, { "description": "CborAuxdata that is found on the recompiled bytecode." } ] }, "immutableReferences": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "title": "ImmutableReference", "properties": { "start": { "type": "integer" }, "length": { "type": "integer" } } } } }, "transformations": { "type": "array", "title": "RuntimeTransformations", "examples": [ [ { "id": "CriminalDogs.sol:SafeMath", "type": "replace", "offset": 1863, "reason": "library" }, { "id": "1", "type": "replace", "offset": 2747, "reason": "cborAuxdata" }, { "id": "1466", "type": "replace", "offset": 18703, "reason": "immutable" }, { "id": "1466", "type": "replace", "offset": 18939, "reason": "immutable" }, { "type": "replace", "offset": 1, "reason": "callProtection" } ] ], "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Does not exist on `callProtection`. Used to find the corresponding value of the Transformation in the TransformationValues dictionary" }, "type": { "const": "replace", "description": "Runtime bytecode transformations won't have `insert`, because runtime does not have constructor arguments to be appended." }, "offset": { "type": "integer", "example": 1322 }, "reason": { "type": "string", "enum": [ "cborAuxdata", "library", "immutable", "callProtection" ], "description": "Keep in mind the `library` and `immutable` reasons are singular here but plural in the TransformationValues dictionary: `libraries` and `immutables`" } }, "required": ["type", "offset", "reason"] } }, "transformationValues": { "type": "object", "title": "CreationTransformationValues", "properties": { "libraries": { "type": "object", "additionalProperties": { "type": "string", "title": "AddressLowercase", "description": "Contract Address in hex string", "pattern": "(\\b0x[a-f0-9]{40}\\b)", "example": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" } }, "immutables": { "type": "object", "additionalProperties": { "type": "string", "title": "HexString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x1a2b3c4d" } }, "cborAuxdata": { "type": "object", "description": "Different format than the `cborAuxdata` field under the bytecode object. \n\nWill be here only if there was a transformation on the cborAuxdata. If cborAuxdatas matched, there won't be a transformation.", "additionalProperties": { "type": "string", "title": "HexString", "pattern": "^0x([0-9|a-f][0-9|a-f])*$", "example": "0x1a2b3c4d" } }, "callProtection": { "type": "string", "title": "AddressLowercase", "description": "Contract Address in hex string", "pattern": "(\\b0x[a-f0-9]{40}\\b)", "example": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" } }, "examples": [ { "libraries": { "contracts/order/OrderUtils.sol:OrderUtilsLib": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" }, "immutables": { "1466": "0x000000000000000000000000000000007f56768de3133034fa730a909003a165" }, "cborAuxdata": { "1": "0xa26469706673582212201c37bb166aa1bc4777a7471cda1bbba7ef75600cd859180fa30d503673b99f0264736f6c63430008190033" }, "callProtection": "0x9deba23b95205127e906108f191a26f5d520896a" } ] } } }, "deployment": { "type": "object", "properties": { "transactionHash": { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" }, "blockNumber": { "type": "string", "example": "21721660" }, "transactionIndex": { "type": "string", "example": "3" }, "deployer": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" } } }, "sources": { "type": "object", "additionalProperties": { "type": "object", "properties": { "content": { "type": "string" } } } }, "compilation": { "type": "object", "properties": { "language": { "type": "string", "enum": ["Solidity", "Vyper"], "title": "Language", "default": "Solidity" }, "compiler": { "type": "string", "example": "solc" }, "compilerVersion": { "allOf": [ { "type": "string", "title": "CompilerVersion", "pattern": "^v?\\d+\\.\\d+\\.\\d+.*$", "example": "0.8.7+commit.e28d00a7" }, { "description": "The server accepts v prefixed but should only respond without the v prefix" } ] }, "compilerSettings": { "type": "object" }, "name": { "type": "string", "example": "MyContract" }, "fullyQualifiedName": { "type": "string", "example": "contracts/MyContract.sol:MyContract" } } }, "abi": { "type": "array", "items": { "type": "object" } }, "metadata": { "type": "object" }, "storageLayout": { "type": "object" }, "userdoc": { "type": "object" }, "devdoc": { "type": "object" }, "sourceIds": { "type": "object", "description": "Same as stdJsonOutput.sources", "additionalProperties": { "type": "object", "properties": { "id": { "type": "integer", "description": "The AST IDs of the sources" } } } }, "stdJsonInput": { "type": "object", "description": "The input fields conforming the compiler standard-JSON format.", "properties": { "language": { "type": "string", "enum": ["Solidity", "Vyper"], "title": "Language", "default": "Solidity" }, "sources": { "type": "object", "additionalProperties": { "type": "object", "properties": { "content": { "type": "string" }, "keccak256": { "type": "string", "title": "Keccak256", "pattern": "(\\b0x[a-f0-9]{64}\\b)", "example": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206" } } } }, "settings": { "type": "object" } } }, "stdJsonOutput": { "type": "object", "description": "The outputs conforming the compiler standard JSON format", "properties": { "sources": { "type": "object", "additionalProperties": { "type": "object", "properties": { "id": { "type": "integer", "description": "The AST IDs of the sources" } } } }, "contracts": { "type": "object", "description": "Contracts output in the standard JSON format.\n\nThis will only contain the entry for the compilaton target contract, even if the `outputSelection` was `*`.", "additionalProperties": { "type": "object", "additionalProperties": { "type": "object", "properties": { "abi": { "type": "array", "items": { "type": "object" } }, "userdoc": { "type": "object" }, "devdoc": { "type": "object" }, "storageLayout": { "type": "object" }, "metadata": { "type": "string", "description": "Serialized JSON string" }, "evm": { "type": "object", "properties": { "bytecode": { "type": "object", "description": "In Sourcify we refer to this field more explicitly as \"creation bytecode\"", "properties": { "sourceMap": { "type": "string" }, "linkReferences": { "type": "object", "title": "LinkReferences", "properties": { "id": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "title": "LinkReference", "properties": { "start": { "type": "integer" }, "length": { "type": "string" } }, "examples": [ { "start": 3078, "length": 20 } ] } } } } }, "examples": [ { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } } ] }, "object": { "allOf": [ { "type": "string", "title": "HexStringWithout0x", "pattern": "^([0-9|a-f][0-9|a-f])*$", "example": "1a2b3c4d" }, { "description": "Without the 0x prefix, as in the compiler output format" } ] } } }, "deployedBytecode": { "type": "object", "description": "In Sourcify we refer to this field more explicitly as \"runtime bytecode\"", "properties": { "sourceMap": { "type": "string" }, "linkReferences": { "type": "object", "title": "LinkReferences", "properties": { "id": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "title": "LinkReference", "properties": { "start": { "type": "integer" }, "length": { "type": "string" } }, "examples": [ { "start": 3078, "length": 20 } ] } } } } }, "examples": [ { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } } ] }, "object": { "allOf": [ { "type": "string", "title": "HexStringWithout0x", "pattern": "^([0-9|a-f][0-9|a-f])*$", "example": "1a2b3c4d" }, { "description": "Without the 0x prefix, as in the compiler output format" } ] }, "immutableReferences": { "type": "object", "additionalProperties": { "type": "object" } } } } } } } } } } } }, "signatures": { "type": "object", "description": "The signatures of the contract grouped by type (function, event, error).", "properties": { "function": { "type": "array", "description": "Function signatures", "items": { "type": "object", "title": "SignatureRepresentations", "description": "The text form and hash representations of a signature", "properties": { "signature": { "type": "string", "description": "The human-readable signature", "example": "transfer(address,uint256)" }, "signatureHash32": { "type": "string", "pattern": "^0x[a-f0-9]{64}$", "description": "The full 32-byte keccak256 hash of the signature", "example": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b" }, "signatureHash4": { "type": "string", "pattern": "^0x[a-f0-9]{8}$", "description": "The 4-byte selector (first 4 bytes of the 32-byte hash)", "example": "0xa9059cbb" } }, "required": [ "signature", "signatureHash32", "signatureHash4" ] } }, "event": { "type": "array", "description": "Event signatures", "items": { "type": "object", "title": "SignatureRepresentations", "description": "The text form and hash representations of a signature", "properties": { "signature": { "type": "string", "description": "The human-readable signature", "example": "transfer(address,uint256)" }, "signatureHash32": { "type": "string", "pattern": "^0x[a-f0-9]{64}$", "description": "The full 32-byte keccak256 hash of the signature", "example": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b" }, "signatureHash4": { "type": "string", "pattern": "^0x[a-f0-9]{8}$", "description": "The 4-byte selector (first 4 bytes of the 32-byte hash)", "example": "0xa9059cbb" } }, "required": [ "signature", "signatureHash32", "signatureHash4" ] } }, "error": { "type": "array", "description": "Error signatures", "items": { "type": "object", "title": "SignatureRepresentations", "description": "The text form and hash representations of a signature", "properties": { "signature": { "type": "string", "description": "The human-readable signature", "example": "transfer(address,uint256)" }, "signatureHash32": { "type": "string", "pattern": "^0x[a-f0-9]{64}$", "description": "The full 32-byte keccak256 hash of the signature", "example": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b" }, "signatureHash4": { "type": "string", "pattern": "^0x[a-f0-9]{8}$", "description": "The 4-byte selector (first 4 bytes of the 32-byte hash)", "example": "0xa9059cbb" } }, "required": [ "signature", "signatureHash32", "signatureHash4" ] } } } }, "proxyResolution": { "type": "object", "title": "ProxyResolution", "properties": { "isProxy": { "type": "boolean" }, "proxyType": { "type": "string", "enum": [ "EIP1167Proxy", "FixedProxy", "EIP1967Proxy", "GnosisSafeProxy", "DiamondProxy", "PROXIABLEProxy", "ZeppelinOSProxy", "SequenceWalletProxy", null ], "title": "ProxyType" }, "implementations": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Only present if the implementation contract was verified by Sourcify" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" } } } }, "proxyResolutionError": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] } }, "extensions": { "$ref": "#/components/schemas/ExtensionMap" } } } } ] }, "examples": { "Full response": { "value": { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "3266227", "creationBytecode": { "onchainBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "recompiledBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "sourceMap": "73951:11562:0:-:0;;;;;;;;;;;;-1:-1:-1;63357:7:0;:15;;-1:-1:-1;;63357:15:0;;;73951:11562;;;;;;", "linkReferences": { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } }, "cborAuxdata": { "1": { "value": "0xa2646970667358221220d6808f0352d5e503f1f878b19b1bf46c893bac1e20b3c51884efb58a87435b5564736f6c634300080a0033", "offset": 18685 }, "2": { "value": "0xa264697066735822122017bf4253b73b339897d7c117916781f30b434e6caa783b20eb15065469814dcf64736f6c634300080a0033", "offset": 18465 } }, "transformations": [ { "id": "1", "type": "replace", "offset": 18040, "reason": "cborAuxdata" }, { "type": "insert", "offset": 6183, "reason": "constructorArguments" }, { "id": "sources/lib/MyLib.sol:MyLib", "type": "replace", "offset": 582, "reason": "library" } ], "transformationValues": { "libraries": { "sources/lib/MyLib.sol:MyLib": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" }, "constructorArguments": "0x00000000000000000000000085fe79b998509b77bf10a8bd4001d58475d29386", "cborAuxdata": { "0": "0xa26469706673582212201c37bb166aa1bc4777a7471cda1bbba7ef75600cd859180fa30d503673b99f0264736f6c63430008190033" } } }, "runtimeBytecode": { "onchainBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "recompiledBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033", "sourceMap": "73951:11562:0:-:0;;;;;;;;;;;;-1:-1:-1;63357:7:0;:15;;-1:-1:-1;;63357:15:0;;;73951:11562;;;;;;", "linkReferences": { "contracts/AmplificationUtils.sol": { "AmplificationUtils": [ { "start": 3078, "length": 20 } ] }, "contracts/SwapUtils.sol": { "SwapUtils": [ { "start": 2931, "length": 20 } ] } }, "cborAuxdata": { "1": { "value": "0xa2646970667358221220d6808f0352d5e503f1f878b19b1bf46c893bac1e20b3c51884efb58a87435b5564736f6c634300080a0033", "offset": 18685 }, "2": { "value": "0xa264697066735822122017bf4253b73b339897d7c117916781f30b434e6caa783b20eb15065469814dcf64736f6c634300080a0033", "offset": 18465 } }, "immutableReferences": { "1050": [ { "start": 312, "length": 32 }, { "start": 2631, "length": 32 } ] }, "transformations": [ { "id": "CriminalDogs.sol:SafeMath", "type": "replace", "offset": 1863, "reason": "library" }, { "id": "1", "type": "replace", "offset": 2747, "reason": "cborAuxdata" }, { "id": "1466", "type": "replace", "offset": 18703, "reason": "immutable" }, { "id": "1466", "type": "replace", "offset": 18939, "reason": "immutable" }, { "type": "replace", "offset": 1, "reason": "callProtection" } ], "transformationValues": { "libraries": { "contracts/order/OrderUtils.sol:OrderUtilsLib": "0x40b70a4904fad0ff86f8c901b231eac759a0ebb0" }, "immutables": { "1466": "0x000000000000000000000000000000007f56768de3133034fa730a909003a165" }, "cborAuxdata": { "1": "0xa26469706673582212201c37bb166aa1bc4777a7471cda1bbba7ef75600cd859180fa30d503673b99f0264736f6c63430008190033" }, "callProtection": "0x9deba23b95205127e906108f191a26f5d520896a" } }, "deployment": { "transactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206", "blockNumber": "21721660", "transactionIndex": "0", "deployer": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "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" }, "contracts/Owner.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Owner {\n address public owner;\n\n constructor() {\n owner = msg.sender;\n }\n}\n" } }, "compilation": { "language": "Solidity", "compiler": "solc", "compilerVersion": "v0.8.12+commit.f00d7308", "compilerSettings": {}, "name": "MyContract", "fullyQualifiedName": "contracts/MyContract.sol:MyContract" }, "abi": [{}], "userdoc": {}, "devdoc": {}, "storageLayout": {}, "metadata": {}, "sourceIds": { "contracts/UniswapV3Pool.sol": { "id": 2 }, "contracts/NoDelegateCall.sol": { "id": 0 } }, "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" }, "contracts/Owner.sol": { "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Owner {\n address public owner;\n\n constructor() {\n owner = msg.sender;\n }\n}\n" } }, "settings": {} }, "stdJsonOutput": { "sources": {}, "contracts": {} }, "signatures": { "function": [ { "signature": "name()", "signatureHash32": "0x06fdde0383f15d582d1a74511486c9ddf862a882fb7904b3d9fe9b8b8e58a796", "signatureHash4": "0x06fdde03" }, { "signature": "deprecate(address)", "signatureHash32": "0x0753c30c37785fe67c057e37b49f6f8d5a438a94f4d86e2f327454f9c52bf927", "signatureHash4": "0x0753c30c" } ], "event": [ { "signature": "AddedBlackList(address)", "signatureHash32": "0x42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc", "signatureHash4": "0x42e16015" } ], "error": [ { "signature": "ERC20InsufficientAllowance()", "signatureHash32": "0x890e98490493b2eeaa713ba179e7b5e82994498e2a4fd1cb19df5f91a38c1532", "signatureHash4": "0x890e9849" } ] }, "proxyResolution": { "isProxy": false, "proxyType": null, "implementations": [] } } }, "Minimal Response": { "value": { "match": "exact_match", "creationMatch": "exact_match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "3266227", "name": "MyContract" } }, "`fields=creationBytecode.onchainBytecode,abi,deployment`": { "value": { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "creationBytecode": { "onchainBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033" }, "deployment": { "transactionHash": "0xb6ee9d528b336942dd70d3b41e2811be10a473776352009fd73f85604f5ed206", "blockNumber": "21721660", "transactionIndex": "0", "deployer": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "abi": [{}] } }, "`omit=creationBytecode,runtimeBytecode,compilation,deployment.transactionHash,deployment.deployer`": { "value": { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "deployment": { "blockNumber": "21721660", "transactionIndex": "0" }, "abi": [{}], "userdoc": {}, "devdoc": {}, "storageLayout": {}, "metadata": {}, "sourceIds": { "contracts/UniswapV3Pool.sol": { "id": 2 }, "contracts/NoDelegateCall.sol": { "id": 0 } } } }, "Tempo native precompile (`fields=abi,sources,extensions.tempo.nativeSource`)": { "value": { "match": null, "creationMatch": null, "runtimeMatch": null, "chainId": "4217", "address": "0xCcCCCCcC00000000000000000000000000000001", "verifiedAt": null, "matchId": null, "name": "Validator Config V2", "abi": [{}], "sources": { "crates/precompiles/src/validator_config_v2/mod.rs": { "content": "pub struct ValidatorConfigV2 { /* ... */ }" }, "crates/precompiles/src/validator_config_v2/dispatch.rs": { "content": "impl Precompile for ValidatorConfigV2 { /* ... */ }" } }, "extensions": { "tempo": { "nativeSource": { "kind": "precompile", "language": "Rust", "bytecodeVerified": false, "repository": "tempoxyz/tempo", "commit": "4f3a2b1c9d8e7f6051429384756abcdef1234567", "commitUrl": "https://github.com/tempoxyz/tempo/tree/4f3a2b1c9d8e7f6051429384756abcdef1234567", "paths": [ "crates/precompiles/src/validator_config_v2/mod.rs", "crates/precompiles/src/validator_config_v2/dispatch.rs" ], "entrypoints": [ "crates/precompiles/src/validator_config_v2/mod.rs", "crates/precompiles/src/validator_config_v2/dispatch.rs" ], "activation": { "protocolVersion": "T2", "fromBlock": "12345678", "toBlock": null } } } } } }, "Proxy resolution (`fields=proxyResolution`)": { "value": { "match": "exact_match", "creationMatch": "exact_match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "proxyResolution": { "isProxy": true, "proxyType": "EIP1967Proxy", "implementations": [ { "address": "0x751D7C0Cf91a9b7704541b44E5fF7BeC3D2caA6F", "name": "Logic contract" } ] } } }, "Proxy resolution with non-proxy contract": { "value": { "match": "exact_match", "creationMatch": "exact_match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "proxyResolution": { "isProxy": false, "proxyType": null, "implementations": [] } } }, "Proxy resolution error": { "value": { "match": "exact_match", "creationMatch": "exact_match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "proxyResolution": { "proxyResolutionError": { "customCode": "proxy_resolution_error", "message": "RPC failed", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "404": { "description": "The contract is not verified on Sourcify", "content": { "application/json": { "schema": { "type": "object", "title": "VerifiedContractMinimal", "properties": { "match": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "creationMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "runtimeMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "chainId": { "type": "string", "title": "ChainId", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "verifiedAt": { "type": "string", "format": "date-time", "example": "2024-07-24T12:00:00Z" }, "matchId": { "type": "string", "example": "3266227" } }, "required": [ "match", "creationMatch", "runtimeMatch", "chainId", "address" ] }, "examples": { "Example 1": { "value": { "match": null, "creationMatch": null, "runtimeMatch": null, "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" } } } } } }, "429": { "description": "You are sending too many requests to the server", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "too_many_requests", "message": "You are sending too many requests", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } }, "security": [] } }, "/v2/contract/all-chains/{address}": { "get": { "tags": ["Contract Lookup"], "summary": "Get verified contract at an address on all chains", "description": "Returns all verified deployments at an address on all Sourcify chains (including deprecated ones).\n\nSuccess returns an array of VerifiedContractMinimal objects under `results` field.\n\nIf not verified on any chain, the `results` array will be empty.", "operationId": "get-contract-all-chains", "parameters": [ { "$ref": "#/components/parameters/AddressPath" } ], "responses": { "200": { "description": "Returns all verified deployments at an address on all Sourcify chains", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "title": "VerifiedContractMinimal", "properties": { "match": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for the overall contract match. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "creationMatch": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for creation bytecode matching. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "runtimeMatch": { "type": ["string", "null"], "enum": ["match", "exact_match", null], "description": "Verification status for runtime bytecode matching. `null` when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.", "title": "VerificationStatusNullable" }, "chainId": { "type": "string", "title": "ChainId", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "verifiedAt": { "type": ["string", "null"], "format": "date-time", "description": "Timestamp when the contract was verified by Sourcify-compatible bytecode matching. `null` for Tempo-native contracts that only expose curated source.", "example": "2024-07-24T12:00:00Z" }, "matchId": { "type": ["string", "null"], "description": "Identifier of the verified contract match. `null` for Tempo-native contracts that only expose curated source.", "example": "3266227" } }, "required": [ "match", "creationMatch", "runtimeMatch", "chainId", "address" ] } } } }, "examples": { "Example 1": { "value": { "results": [ { "match": "exact_match", "creationMatch": "match", "runtimeMatch": "exact_match", "chainId": "1", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "421" }, { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2025-02-10T14:45:00Z", "matchId": "5531" } ] } } } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "404": { "description": "No verified contract found on any chain for the provided address", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": {} } } }, "examples": { "Example 1": { "value": { "results": [] } } } } } }, "429": { "description": "You are sending too many requests to the server", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "too_many_requests", "message": "You are sending too many requests", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/v2/contracts/{chainId}": { "get": { "tags": ["Contract Lookup"], "summary": "List of verified contracts per chain", "description": "Retrieve the verified contracts on a chain", "operationId": "get-v2-contracts-chainId", "parameters": [ { "name": "sort", "in": "query", "description": "Sorts the contracts by most recent first (`desc`, default), or by oldest first (`asc`)", "schema": { "type": "string", "enum": ["asc", "desc"], "default": "desc", "example": "asc" } }, { "name": "limit", "in": "query", "description": "Number of contracts that should be returned per page. Maximum 200", "schema": { "type": "number", "minimum": 1, "maximum": 200, "default": 200 } }, { "name": "afterMatchId", "in": "query", "description": "The last `matchId` returned to get contracts older or newer than it (depending on `sort`)", "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ChainId" } ], "responses": { "200": { "description": "Returns an array of VerifiedContractMinimal objects under `results` field.\n\nIf not verified on any chain, the `results` array will be empty.", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "title": "VerifiedContractMinimal", "properties": { "match": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "creationMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "runtimeMatch": { "type": "string", "enum": ["match", "exact_match", null], "title": "VerificationStatusNullable" }, "chainId": { "type": "string", "title": "ChainId", "pattern": "^\\d+$", "minLength": 1, "maxLength": 20, "example": "42431" }, "address": { "type": "string", "title": "Address", "description": "Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)", "pattern": "(\\b0x[a-fA-F0-9]{40}\\b)", "example": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c" }, "verifiedAt": { "type": ["string", "null"], "format": "date-time", "description": "Timestamp when the contract was verified by Sourcify-compatible bytecode matching. `null` for Tempo-native contracts that only expose curated source.", "example": "2024-07-24T12:00:00Z" }, "matchId": { "type": ["string", "null"], "description": "Identifier of the verified contract match. `null` for Tempo-native contracts that only expose curated source.", "example": "3266227" } }, "required": [ "match", "creationMatch", "runtimeMatch", "chainId", "address" ] } } } }, "examples": { "Example 1": { "value": { "results": [ { "match": "exact_match", "creationMatch": "match", "runtimeMatch": "exact_match", "chainId": "42431", "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "421" }, { "match": "match", "creationMatch": "match", "runtimeMatch": "match", "chainId": "42431", "address": "0xe4b10A2a727D0f4863CEBca743a8dAb84cf65b2d", "verifiedAt": "2024-07-24T12:00:00Z", "matchId": "5531" } ] } } } } } }, "400": { "description": "Bad request from the client", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "429": { "description": "You are sending too many requests to the server", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "too_many_requests", "message": "You are sending too many requests", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "GenericErrorResponse", "properties": { "customCode": { "type": "string", "description": "A string token to indicate the reason of the error", "example": "unsupported_chain" }, "message": { "type": "string", "description": "The reasoning of the error", "example": "The chain with chainId 3153212 is not supported for verification" }, "errorId": { "type": "string", "format": "uuid" } }, "required": ["customCode", "message", "errorId"], "examples": [ { "customCode": "unsupported_chain", "message": "The chain with chainId 9429413 is not supported", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } ] }, "examples": { "Example 1": { "value": { "customCode": "internal_error", "message": "Something went wrong", "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192" } } } } } } } } }, "/verify": { "post": { "deprecated": true, "description": "Sends provided files for verification. \n\nThe `chosenContract` is the optional index of the contract to be verified and only needed when there are multiple contracts, i.e. multiple metadata.json in the provided body. For example a full hardhat-output contains metadatas of all contracts compiled.\n", "tags": ["(Deprecated) Stateless Verification"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["address", "chain", "files"], "properties": { "address": { "type": "string", "format": "address", "example": "0x00000000219ab540356cBB839Cbe05303d7705Fa" }, "chain": { "type": "string", "format": "supported-chainId", "example": "1" }, "files": { "type": "object", "example": { "metadata.json": "{...}", "SimpleStorage.sol": "pragma solidity ^0.8.0; contract SimpleStorage { function get() public view returns (uint) { return 1; } }" } }, "creatorTxHash": { "type": "string", "example": "0xbc2f0848023b6a4b89dd049dadc551428a8e95153bc70d9eee6c14ec843f0a98" }, "chosenContract": { "type": "string", "description": "Optional index for the contract if multiple contracts (i.e. metadata.json files) are present.", "example": "0" } } } }, "multipart/form-data": { "schema": { "type": "object", "required": ["address", "chain"], "properties": { "address": { "type": "string", "format": "address" }, "chain": { "type": "string", "format": "supported-chainId" }, "files": { "description": "This field is required", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "string", "format": "binary" }, { "type": "array", "items": { "type": "string", "format": "binary" } } ] }, "creatorTxHash": { "type": "string" }, "chosenContract": { "type": "string", "description": "Optional index for the contract if multiple contracts (i.e. metadata.json files) are present." } } } } } }, "responses": { "200": { "description": "The contract has been successfully checked or sourcified", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainId": { "type": "string" }, "status": { "type": "string" }, "message": { "type": "string" }, "libraryMap": { "type": "object" } } } } } }, "examples": { "Perfect Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "perfect", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Partial Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "partial", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Not Deployed": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "null", "message": "Chain #1 does not have a contract deployed at 0x...." } ] } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Metadata not found": { "value": { "error": "Metadata file not found. Did you include \"metadata.json\"?" } }, "Bad Formatted Json": { "value": { "error": "Unexpected token ' in JSON at position 107" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "File Not Found": { "value": { "error": "Couldn't extract files from the request. Please make sure you have added files" } } } } } }, "409": { "description": "Conflict - The contract is already partially verified and the verification yieled a partial match. The files won't be saved.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Already Partially Verified": { "value": { "error": "The contract 0x00000000219ab540356cBB839Cbe05303d7705Fa on chainId 42431 is already partially verified. The provided new source code also yielded a partial match and will not be stored unless it's a full match" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Resource Missing": { "value": { "error": "Resource missing; unsuccessful fetching: contracts/SingleFile.sol" } }, "Deployed and recompiled mismatch": { "value": { "error": "The deployed and recompiled bytecode don't match." } } } } } } } } }, "/verify/vyper": { "post": { "deprecated": true, "description": "Sends provided Vyper contract files for verification.\n", "tags": ["(Deprecated) Stateless Verification"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "address", "chain", "files", "contractPath", "contractName", "compilerVersion" ], "properties": { "address": { "type": "string", "format": "address", "example": "0x00000000219ab540356cBB839Cbe05303d7705Fa" }, "chain": { "type": "string", "format": "supported-chainId", "example": "1" }, "files": { "type": "object", "example": { "test.vy": "# @version >=0.3.2\n\n@external\n@view\ndef helloWorld() -> String[24]:\n return \"Hello World!\"" } }, "contractPath": { "type": "string", "example": "test.vy" }, "contractName": { "type": "string", "example": "test" }, "compilerVersion": { "type": "string", "example": "0.8.4+commit.c7e474f2" }, "compilerSettings": { "type": "object", "example": { "evmVersion": "istanbul", "outputSelection": { "*": ["evm.bytecode"] } } }, "creatorTxHash": { "type": "string", "example": "0xbc2f0848023b6a4b89dd049dadc551428a8e95153bc70d9eee6c14ec843f0a98" } } } } } }, "responses": { "200": { "description": "The contract has been successfully checked or sourcified", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainId": { "type": "string" }, "status": { "type": "string" }, "message": { "type": "string" } } } } } }, "examples": { "Perfect Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "perfect" } ] } }, "Partial Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "partial" } ] } }, "Not Deployed": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "null", "message": "Chain #1 does not have a contract deployed at 0x...." } ] } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Vyper Compiler Input Error": { "value": { "error": "Error initializing Vyper compiler input, please check files and settings" } }, "Bad Formatted Json": { "value": { "error": "Unexpected token ' in JSON at position 107" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "File Not Found": { "value": { "error": "Couldn't extract files from the request. Please make sure you have added files" } } } } } }, "409": { "description": "Conflict - The contract is already partially verified and the verification yieled a partial match. The files won't be saved.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Already Partially Verified": { "value": { "error": "The contract 0x00000000219ab540356cBB839Cbe05303d7705Fa on chainId 42431 is already partially verified. The provided new source code also yielded a partial match and will not be stored unless it's a full match" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Deployed and recompiled mismatch": { "value": { "error": "The deployed and recompiled bytecode don't match." } } } } } } } } }, "/verify/etherscan": { "post": { "deprecated": true, "summary": "Verify an Etherscan verified contract", "tags": ["(Deprecated) Stateless Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "address": { "type": "string", "format": "address", "example": "0x07880D44b0f7b75464ad18fc2b980049c40A8bc3" }, "chainId": { "type": "string", "format": "supported-chainId", "example": "1" }, "apiKey": { "type": "string", "example": "*********************************" } }, "required": ["address", "chainId"] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "chain": { "type": "string", "format": "supported-chainId" }, "apiKey": { "type": "string", "example": "*********************************" } }, "required": ["address", "chain"] } } } }, "responses": { "200": { "description": "The contract has been successfully checked or sourcified", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainId": { "type": "string" }, "status": { "type": "string" }, "message": { "type": "string" }, "libraryMap": { "type": "object" } } } } } }, "examples": { "Perfect Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "perfect", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Partial Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "partial", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Not Deployed": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "null", "message": "Chain #1 does not have a contract deployed at 0x...." } ] } } } } } }, "409": { "description": "Conflict - The contract is already partially verified and the verification yieled a partial match. The files won't be saved.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Already Partially Verified": { "value": { "error": "The contract 0x00000000219ab540356cBB839Cbe05303d7705Fa on chainId 42431 is already partially verified. The provided new source code also yielded a partial match and will not be stored unless it's a full match" } } } } } }, "429": { "description": "Too Many Requests sent through Sourcify's own API key", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Etherscan API rate": { "value": { "error": "Etherscan API rate limit reached, try later" } }, "Bad Formatted Json": { "value": { "error": "Unexpected token ' in JSON at position 107" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Resource Missing": { "value": { "error": "Resource missing; unsuccessful fetching: contracts/SingleFile.sol" } }, "Deployed and recompiled mismatch": { "value": { "error": "The deployed and recompiled bytecode don't match." } } } } } } } } }, "/verify/solc-json": { "post": { "deprecated": true, "summary": "Verify solc-json", "tags": ["(Deprecated) Stateless Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "address": { "type": "string", "format": "address", "description": "Contract address", "example": "0x07880D44b0f7b75464ad18fc2b980049c40A8bc3" }, "chain": { "type": "string", "format": "supported-chainId", "description": "Chain to check", "example": "1" }, "files": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Files to upload {\"path/filename\": \"content\"}", "example": { "SolcJsonInput.json": "{...}" } }, "compilerVersion": { "type": "string", "description": "Compiler version", "example": "0.8.4+commit.c7e474f2" }, "contractName": { "type": "string", "description": "Name of the contract", "example": "Storage" }, "creatorTxHash": { "type": "string", "description": "Creator transaction hash", "example": "0xb7efb33c736b1e8ea97e356467f99d99221343f077ce31a3e3ac1d2e0636df1d" } }, "required": [ "address", "chain", "compilerVersion", "contractName", "files" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "address": { "type": "string", "format": "address", "description": "Contract address" }, "chain": { "type": "string", "format": "supported-chainId", "description": "Chain to check" }, "files": { "oneOf": [ { "type": "string", "format": "binary" }, { "type": "array", "items": { "type": "string", "format": "binary" } } ], "description": "File content for upload" }, "compilerVersion": { "type": "string", "description": "Compiler version" }, "contractName": { "type": "string", "description": "Name of the contract" }, "creatorTxHash": { "type": "string", "description": "Creator transaction hash" } }, "required": [ "address", "chain", "compilerVersion", "contractName" ] } } } }, "responses": { "200": { "description": "The contract has been successfully checked or sourcified", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainId": { "type": "string" }, "status": { "type": "string" }, "message": { "type": "string" }, "libraryMap": { "type": "object" } } } } } }, "examples": { "Perfect Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "perfect", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Partial Match": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "partial", "libraryMap": { "lib1": "0x3f681646d4a755815f9cb19e1acc8565a0c2ac", "lib2": "0x4f681646d4a755815f9cb19e1acc8565a0c2ac" } } ] } }, "Not Deployed": { "value": { "result": [ { "address": "0x123f681646d4a755815f9cb19e1acc8565a0c2ac", "chainId": "1", "status": "null", "message": "Chain #1 does not have a contract deployed at 0x...." } ] } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "One SolidityJSON at a time": { "value": { "error": "Only one Solidity JSON Input file at a time is allowed" } }, "Bad Formatted Json": { "value": { "error": "Unexpected token ' in JSON at position 107" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "File Not Found": { "value": { "error": "Couldn't extract files from the request. Please make sure you have added files" } } } } } }, "409": { "description": "Conflict - The contract is already partially verified and the verification yieled a partial match. The files won't be saved.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Already Partially Verified": { "value": { "error": "The contract 0x00000000219ab540356cBB839Cbe05303d7705Fa on chainId 42431 is already partially verified. The provided new source code also yielded a partial match and will not be stored unless it's a full match" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } }, "examples": { "Resource Missing": { "value": { "error": "Resource missing; unsuccessful fetching: contracts/SingleFile.sol" } }, "Deployed and recompiled mismatch": { "value": { "error": "The deployed and recompiled bytecode don't match." } } } } } } } } }, "/repository/contracts/{matchType}/{chain}/{address}/{filePath}": { "get": { "deprecated": true, "summary": "Get a specific file from the repository with the file path (static serving)", "description": "Retrieve statically served files over the server.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "matchType", "in": "path", "required": true, "schema": { "type": "string", "format": "match-type" }, "description": "Either `full_match` or `partial_match`" }, { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } }, { "name": "filePath", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The file is found at the path", "content": { "text/plain": {} } }, "404": { "description": "The file is not found at the path", "content": { "text/plain": {} } } } } }, "/check-all-by-addresses": { "get": { "deprecated": true, "summary": "Check if contracts are verified (full or partial match) by addresses and chain IDs", "description": "Checks if contract with the desired chain and address is verified and in the repository. It will search for both perfect and partial matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "addresses", "in": "query", "description": "Comma seperated string of addresses to check for.", "required": true, "schema": { "type": "string", "format": "comma-separated-addresses" } }, { "name": "chainIds", "in": "query", "description": "Comma separated string of chain IDs.", "required": true, "schema": { "type": "string", "format": "comma-separated-sourcify-chainIds" }, "allowReserved": true }, { "name": "resolveProxies", "in": "query", "required": false, "schema": { "type": "string", "enum": ["true", "false"] }, "description": "Check if the contracts are proxies and what their implementations are." } ], "responses": { "200": { "description": "OK. Also returns `200` with status `false` when not found", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "chainIds": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "string" }, "status": { "type": "string" }, "isProxy": { "type": "boolean" }, "proxyType": { "type": "string" }, "implementations": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string" }, "name": { "type": "string" } } } }, "proxyResolutionError": { "type": "string" } } } } } } }, "examples": { "multiple results": { "value": [ { "address": "0x6F1D75a53a8805DcA5347aE5F3eDE035CAE3CBC1", "chainIds": [ { "chainId": "5", "status": "perfect", "isProxy": false, "proxyType": null, "implementations": [] }, { "chainId": "10", "status": "partial", "isProxy": false, "proxyType": null, "implementations": [] }, { "chainId": "42431", "status": "perfect", "isProxy": false, "proxyType": null, "implementations": [] } ] }, { "address": "0x751D7C0Cf91a9b7704541b44E5fF7BeC3D2caA6F", "chainIds": [ { "chainId": "5", "status": "partial", "isProxy": true, "proxyType": "EIP1967Proxy", "implementations": [ { "address": "0x787ec93dd71a90563979417879f5a3298389227f", "name": "LogicContract" } ] }, { "chainId": "10", "status": "perfect", "isProxy": true, "proxyType": "EIP1967Proxy", "implementations": [ { "address": "0x787ec93dd71a90563979417879f5a3298389227f", "name": "LogicContract" } ] } ] }, { "address": "0x8D2548A5f641b00Cf0f5B693d4A72D8c0aE24d31", "chainIds": [ { "chainId": "5", "status": "perfect", "isProxy": false, "proxyType": null, "implementations": [] } ] }, { "address": "0x1f9cA631AE0C4890F99b38634C969b7E4f8719F0", "status": "false" } ] }, "single result": { "value": [ { "address": "0xEb30853fc616Bbb8f1444451A3c202cbcd08Fb47", "chainIds": [ { "chainId": "43114", "status": "perfect" } ] } ] }, "not found": { "value": [ { "address": "0x1f9cA631AE0C4890F99b38634C969b7E4f8719F0", "status": "false" }, { "address": "0x8D2548A5f641b00Cf0f5B693d4A72D8c0aE24d31", "status": "false" } ] }, "proxy resolution error": { "value": [ { "address": "0xEb30853fc616Bbb8f1444451A3c202cbcd08Fb47", "chainIds": [ { "chainId": "43114", "status": "perfect", "proxyResolutionError": "Proxy resolution failed" } ] } ] } } } } } } } }, "/check-by-addresses": { "get": { "deprecated": true, "summary": "Check if contracts are verified (full match) by addresses and chain IDs", "description": "Checks if contract with the desired chain and address is verified and in the repository. It will search only the perfect matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "addresses", "in": "query", "description": "The addresses of the contracts.", "required": true, "schema": { "type": "string", "format": "comma-separated-addresses" } }, { "name": "chainIds", "in": "query", "description": "The IDs of the chains.", "required": true, "schema": { "type": "string", "format": "comma-separated-sourcify-chainIds" }, "allowReserved": true } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string", "example": "0xEb30853fc616Bbb8f1444451A3c202cbcd08Fb47" }, "status": { "type": "string", "example": "perfect" }, "chainIds": { "type": "array", "items": { "type": "string" }, "example": ["43114", "137"] } } } } } } } } } }, "/files/any/{chain}/{address}": { "get": { "deprecated": true, "summary": "Get all files of a contract (full and partial match)", "description": "Returns all files for the desired contract with the address and chain. Searches both full and partial matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "description": "Contract is available", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "full" }, "files": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "example": "metadata.json" }, "path": { "type": "string", "example": "/home/data/repository/contracts/full_match/3/0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9/metadata.json" }, "content": { "type": "string" } } } } } } } } }, "404": { "description": "Contract is not available", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Files have not been found!" } } } } } } } } }, "/files/{chain}/{address}": { "get": { "deprecated": true, "summary": "Get all files of a contract (full match)", "description": "Returns all files for the desired contract with the address and chain. Searches only for full matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "description": "Contract is available in the repository", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "example": "metadata.json" }, "path": { "type": "string", "example": "/home/data/repository/contracts/full_match/3/0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9/metadata.json" }, "content": { "type": "string" } } } } } } }, "404": { "description": "Contract is not available in the repository", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Files have not been found!" } } } } } } } } }, "/files/contracts/{chain}": { "get": { "deprecated": true, "summary": "(Deprecated) Get the first 200 contract addresses verified on a chain (full or partial match)", "description": "Returns the first 200 verified contracts from the repository for the desired chain. Searches for full and partial matches. This endpoint is deprecated and only retuns 200 addresses. Use `/files/contracts/any/` and `/files/contracts/full/` instead", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } } ], "responses": { "200": { "description": "Chain is available as a full match or partial match in the repository", "content": { "application/json": { "schema": { "type": "object", "properties": { "full": { "type": "array", "items": { "type": "string" }, "example": [ "0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0", "0xE9c31091868d68598Ac881738D159A63532d12f9" ] }, "partial": { "type": "array", "items": { "type": "string" }, "example": [ "0x0000A906D248Cc99FB8CB296C8Ad8C6Df05431c9", "0xE9c31091868d68598Ac881738D159A63532d12f9" ] } } } } } }, "400": { "description": "Cannot use this API if there are more than 200 contracts", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Cannot fetch more than 200 contracts (1521 full matches, 3453 partial matches), please use /contracts/{full|any}/4 with pagination" } } } } } }, "404": { "description": "Chain is not available as both full match or partial match in the repository", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Contracts have not been found!" } } } } } } } } }, "/files/contracts/any/{chain}": { "get": { "deprecated": true, "summary": "Get the contract addresses verified on a chain (full or partial match)", "description": "Returns the verified contracts from the repository for the desired chain. Searches for full and partial matches. API is paginated. Limit must be a number between 1 and 200.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "number" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "number", "minimum": 1, "maximum": 200 } }, { "name": "order", "in": "query", "required": false, "schema": { "type": "string", "enum": ["asc", "desc"] }, "description": "Order of the results. Default is \"asc\" (earliest verified contract first)" } ], "responses": { "200": { "description": "Chain is available as a full match or partial match in the repository", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "string" }, "example": [ "0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0", "0xE9c31091868d68598Ac881738D159A63532d12f9" ] }, "pagination": { "type": "object", "properties": { "currentPage": { "type": "number" }, "totalPages": { "type": "number" }, "resultsPerPage": { "type": "number" }, "resultsCurrentPage": { "type": "number" }, "totalResults": { "type": "number" }, "hasNextPage": { "type": "boolean" }, "hasPreviousPage": { "type": "boolean" } } } } } } } } } } }, "/files/contracts/full/{chain}": { "get": { "deprecated": true, "summary": "Get the contract addresses perfectly verified on a chain", "description": "Returns the perfectly verified contracts from the repository for the desired chain. API is paginated. Limit must be a number between 1 and 200.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "number" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "number", "minimum": 1, "maximum": 200 } }, { "name": "order", "in": "query", "required": false, "schema": { "type": "string", "enum": ["asc", "desc"] }, "description": "Order of the results. Default is \"asc\" (earliest verified contract first)" } ], "responses": { "200": { "description": "Chain is available as a full match in the repository", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "string" }, "example": [ "0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0", "0xE9c31091868d68598Ac881738D159A63532d12f9" ] }, "pagination": { "type": "object", "properties": { "currentPage": { "type": "number" }, "totalPages": { "type": "number" }, "resultsPerPage": { "type": "number" }, "resultsCurrentPage": { "type": "number" }, "totalResults": { "type": "number" }, "hasNextPage": { "type": "boolean" }, "hasPreviousPage": { "type": "boolean" } } } } } } } } } } }, "/files/tree/any/{chain}/{address}": { "get": { "deprecated": true, "summary": "Get file tree (full and partial match)", "description": "Returns repository URLs for every file in the source tree for the desired chain and address. Searches for full and partial matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "description": "Contract is available", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "full" }, "files": { "type": "array", "items": { "type": "string" }, "example": [ "https://contractrepostaging.komputing.org/contracts/full_match/5/0x32a5d2240a60dcF7Af8EfAE6d886ec8BeD5f71bA/metadata.json" ] } } } } } }, "404": { "description": "Contract is not available", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Files have not been found!" } } } } } } } } }, "/files/tree/{chain}/{address}": { "get": { "deprecated": true, "summary": "Get file tree (full match)", "description": "Returns repository URLs for every file in the source tree for the desired chain and address. Searches only for full matches.", "tags": ["(Deprecated) Repository"], "parameters": [ { "name": "chain", "in": "path", "required": true, "schema": { "type": "string", "format": "sourcify-chainId" } }, { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "format": "address" } } ], "responses": { "200": { "description": "Contract is available", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" }, "example": [ "https://repo.sourcify.dev/contracts/full_match/5/0x1fE5d745beABA808AAdF52057Dd7AAA47b42cFD0/metadata.json" ] } } } }, "404": { "description": "Contract is not available", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Files have not been found!" } } } } } } } } }, "/session/data": { "get": { "deprecated": true, "summary": "Get session data", "tags": ["(Deprecated) Session Verification"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string" } }, "missing": { "type": "array", "items": { "type": "string", "example": "browser/1_Storage.sol" } } } }, "status": { "type": "string", "example": "error" } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } } } } }, "/session/clear": { "post": { "deprecated": true, "summary": "Clear session data", "tags": ["(Deprecated) Session Verification"], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "string", "example": "Session successfully cleared" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Error in clearing session" } } } } } } } } }, "/session/input-files": { "post": { "deprecated": true, "summary": "Add input files", "tags": ["(Deprecated) Session Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "files": { "type": "object" } } } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "files": { "description": "This field is required", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "string", "format": "binary" }, { "type": "array", "items": { "type": "string", "format": "binary" } } ] } } } } } }, "parameters": [ { "name": "url", "in": "query", "schema": { "type": "string", "format": "uri" }, "description": "Remote file URL", "required": false }, { "name": "dryrun", "in": "query", "schema": { "type": "boolean", "default": false }, "description": "Dry-run flag. When present and set to true, a successful verification result will not be stored in the repository.", "required": false } ], "responses": { "200": { "description": "Response is sent when the upload is successful under different conditions.", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string" } }, "missing": { "type": "array", "items": { "type": "string" } } } }, "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "status": { "type": "string", "enum": ["perfect", "partial", "error"] } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } }, "413": { "description": "Payload Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Too much session memory used. Delete some files or clear the session." } } } } } } } } }, "/session/input-contract": { "post": { "deprecated": true, "summary": "Import deployed contract trying to fetch metadata and files form IPFS", "tags": ["(Deprecated) Session Verification"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["address", "chainId"], "properties": { "address": { "type": "string", "format": "address" }, "chainId": { "type": "string", "format": "supported-chainId" } } } }, "multipart/form-data": { "schema": { "type": "object", "required": ["address", "chainId"], "properties": { "address": { "type": "string", "format": "address" }, "chainId": { "type": "string", "format": "supported-chainId" } } } } } }, "responses": { "200": { "description": "Response is sent when the upload is successful under different conditions.", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string" } }, "missing": { "type": "array", "items": { "type": "string" } } } }, "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "status": { "type": "string", "enum": ["perfect", "partial", "error"] } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } }, "413": { "description": "Payload Too Large", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Too much session memory used. Delete some files or clear the session." } } } } } } } } }, "/session/verify-checked": { "post": { "deprecated": true, "summary": "Verify checked contract in session", "tags": ["(Deprecated) Session Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "address": { "type": "string", "example": "0x656d0062eC89c940213E3F3170EA8b2add1c0143", "format": "address" }, "chainId": { "type": "string", "example": "100", "format": "supported-chainId" }, "creatorTxHash": { "type": "string", "nullable": true }, "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" } } } } } } } } }, "parameters": [ { "name": "dryrun", "in": "query", "schema": { "type": "boolean", "default": false }, "description": "Dry-run flag. When present and set to true, a successful verification result will not be stored in the repository.", "required": false } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "address": { "type": "string", "example": "0x656d0062eC89c940213E3F3170EA8b2add1c0143" }, "chainId": { "type": "string", "example": "100" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string", "example": "browser/1_Storage.sol" } }, "missing": { "type": "array", "items": { "type": "string" } } } }, "status": { "type": "string", "example": "perfect" }, "storageTimestamp": { "type": "string", "format": "date-time", "example": "2021-01-12T15:41:56.502Z" } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "There are currently no pending contracts." } } } } } } } } }, "/session/input-solc-json": { "post": { "deprecated": true, "summary": "Verify solc-json", "tags": ["(Deprecated) Session Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "files": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Files to upload {\"path/filename\": \"content\"}" }, "compilerVersion": { "type": "string", "description": "Compiler version" } }, "required": ["compilerVersion", "files"] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "files": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "string", "format": "binary" }, { "type": "array", "items": { "type": "string", "format": "binary" } } ] }, "compilerVersion": { "type": "string", "description": "Compiler version" } }, "required": ["compilerVersion"] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "address": { "type": "string", "example": "0x656d0062eC89c940213E3F3170EA8b2add1c0143" }, "chainId": { "type": "string", "example": "100" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string", "example": "browser/1_Storage.sol" } }, "missing": { "type": "array", "items": { "type": "string" } } } }, "status": { "type": "string", "example": "perfect" }, "storageTimestamp": { "type": "string", "format": "date-time", "example": "2021-01-12T15:41:56.502Z" } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "There are currently no pending contracts." } } } } } } } } }, "/session/verify/etherscan": { "post": { "deprecated": true, "summary": "Verify from Etherscan", "tags": ["(Deprecated) Session Verification"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "address": { "type": "string", "format": "address" }, "chainId": { "type": "string", "format": "supported-chainId" }, "apiKey": { "type": "string", "example": "*********************************" } }, "required": ["address", "chainId"] } }, "multipart/form-data": { "schema": { "type": "object", "required": ["address", "chain"], "properties": { "address": { "type": "string", "format": "address" }, "chain": { "type": "string", "format": "supported-chainId" }, "apiKey": { "type": "string", "example": "*********************************" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "contracts": { "type": "array", "items": { "type": "object", "properties": { "verificationId": { "type": "string", "example": "0x3f67e9f57515bb1e7195c7c5af1eff630091567c0bb65ba3dece57a56da766fe" }, "compiledPath": { "type": "string", "example": "browser/1_Storage.sol" }, "name": { "type": "string", "example": "Storage" }, "compilerVersion": { "type": "string", "example": "0.6.6+commit.6c089d02" }, "address": { "type": "string", "example": "0x656d0062eC89c940213E3F3170EA8b2add1c0143" }, "chainId": { "type": "string", "example": "100" }, "files": { "type": "object", "properties": { "found": { "type": "array", "items": { "type": "string", "example": "browser/1_Storage.sol" } }, "missing": { "type": "array", "items": { "type": "string" } } } }, "status": { "type": "string", "example": "perfect" }, "storageTimestamp": { "type": "string", "format": "date-time", "example": "2021-01-12T15:41:56.502Z" } } } }, "unused": { "type": "array", "items": { "type": "string" } } } } } } }, "429": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "oneOf": [ { "example": "Etherscan API rate limit reached, try later" }, { "example": "This contract is not verified on Etherscan" } ] } } } } } } } } }, "/private/change-log-level": { "post": { "summary": "Change the logging level of the application", "description": "Allows changing the logging level dynamically at runtime for the application. Requires Basic Authentication.", "tags": ["Private"], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["level"], "properties": { "level": { "type": "string", "description": "The new logging level to set.", "enum": ["error", "warn", "info", "debug", "silly"] } } }, "examples": { "change to debug": { "value": { "level": "debug" } }, "change to info": { "value": { "level": "info" } } } } } }, "responses": { "200": { "description": "The logging level was successfully changed.", "content": { "text/plain": { "schema": { "type": "string", "example": "Logging level changed to: debug" } } } }, "400": { "description": "Bad request (e.g., invalid logging level provided)." }, "401": { "description": "Unauthorized (missing or invalid Basic Authentication credentials)." } } } } }, "components": { "parameters": { "ChainId": { "name": "chainId", "in": "path", "required": true, "schema": { "type": "integer", "enum": [31318, 42431, 4217] } }, "AddressPath": { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" } }, "HashPath": { "name": "hash", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^0x[a-fA-F0-9]{64}$" } } }, "schemas": { "ExtensionMap": { "type": "object", "maxProperties": 10, "additionalProperties": true, "description": "Object containing arbitrary or vendor-specific contract metadata.", "properties": { "tempo": { "$ref": "#/components/schemas/TempoContractExtensions" } }, "example": { "tempo": { "nativeSource": { "kind": "precompile", "language": "Rust", "bytecodeVerified": false, "repository": "tempoxyz/tempo", "commit": "4f3a2b1c9d8e7f6051429384756abcdef1234567", "paths": [ "crates/precompiles/src/validator_config_v2/mod.rs", "crates/precompiles/src/validator_config_v2/dispatch.rs" ] } } } }, "TempoContractExtensions": { "type": "object", "additionalProperties": true, "properties": { "nativeSource": { "$ref": "#/components/schemas/TempoNativeSource" } } }, "TempoNativeSource": { "type": "object", "required": [ "kind", "language", "bytecodeVerified", "repository", "commit", "paths" ], "properties": { "kind": { "type": "string", "description": "Tempo-native runtime kind.", "enum": ["precompile", "native_contract", "system_contract"], "example": "precompile" }, "language": { "type": "string", "description": "Implementation language of the native contract source.", "example": "Rust" }, "bytecodeVerified": { "type": "boolean", "description": "Whether the native contract source was verified via Sourcify bytecode matching.", "example": false }, "repository": { "type": "string", "description": "Canonical repository containing the native implementation.", "example": "tempoxyz/tempo" }, "commit": { "type": "string", "description": "Pinned commit SHA for the displayed source snapshot.", "pattern": "^[a-f0-9]{7,40}$", "example": "4f3a2b1c9d8e7f6051429384756abcdef1234567" }, "commitUrl": { "type": ["string", "null"], "format": "uri", "description": "Canonical permalink to the pinned source snapshot.", "example": "https://github.com/tempoxyz/tempo/tree/4f3a2b1c9d8e7f6051429384756abcdef1234567" }, "paths": { "type": "array", "description": "All source file paths included in the native source snapshot.", "items": { "type": "string" }, "minItems": 1, "example": [ "crates/precompiles/src/validator_config_v2/mod.rs", "crates/precompiles/src/validator_config_v2/dispatch.rs" ] }, "entrypoints": { "type": "array", "description": "Preferred entrypoint files for rendering and deep-linking in UIs.", "items": { "type": "string" }, "example": [ "crates/precompiles/src/validator_config_v2/mod.rs", "crates/precompiles/src/validator_config_v2/dispatch.rs" ] }, "activation": { "type": "object", "description": "Protocol or block-range metadata describing when this native source snapshot is active.", "properties": { "protocolVersion": { "type": ["string", "null"], "example": "T2" }, "fromBlock": { "type": ["string", "null"], "pattern": "^\\d+$", "example": "12345678" }, "toBlock": { "type": ["string", "null"], "pattern": "^\\d+$", "example": null } } } } } } } }