v1

latestOpenAPI 3.1.02026-07-17373221.0 KB
Contract Lookup

Get contract

By default returns minimal information about the contract: match, creation_match, runtime_match, chainId, address, and verifiedAt

To 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.

For 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.

get/v2/contract/{chainId}/{address}

Path parameters

chainId31318 | 42431 | 4217 required
addressstring required

Query parameters

fieldsstring
Example:abi,metadata,creationBytecode.onchainBytecode,deployment.blockNumber,compilation,extensions.tempo.nativeSource

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.

omitstring
Example:userdoc,devdoc,storageLayout,compilation.sources,extensions

Comma seperated fields to NOT include in the response. All fields except matching ones will be returned. Can't be used simultanously with fields.

Response

Contract lookup response for a Sourcify-verified contract or a Tempo-native contract

match'match' | 'exact_match' | 'null' nullable required

Verification status for the overall contract match. null when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.

creationMatch'match' | 'exact_match' | 'null' nullable required

Verification status for creation bytecode matching. null when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.

runtimeMatch'match' | 'exact_match' | 'null' nullable required

Verification status for runtime bytecode matching. null when the contract is a Tempo-native contract that exposes source without Sourcify bytecode verification.

chainIdstring required
addressstring required

Contract Address in hex string. Can be checksummed or not (i.e. can contain capital letters)

verifiedAtstring date-time nullable

Timestamp when the contract was verified by Sourcify-compatible bytecode matching. null for Tempo-native contracts that only expose curated source.

matchIdstring nullable

Identifier of the verified contract match. null for Tempo-native contracts that only expose curated source.

sourcesobject
abiobject[]
metadataobject
storageLayoutobject
userdocobject
devdocobject
sourceIdsobject

Same as stdJsonOutput.sources

Example response

{
  "chainId": "42431",
  "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c",
  "verifiedAt": "2024-07-24T12:00:00Z",
  "matchId": "3266227",
  "creationBytecode": {
    "onchainBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033",
    "recompiledBytecode": "0x608060405234801561001057600080fd5b5060043610610036570565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea264697066735821220404e37f487a89a932dca5e77faaf6ca2de3b991f93d230604b1b8daaef64766264736f6c63430008070033",
    "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",
    "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": "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": "3",
    "deployer": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c"
  },
  "compilation": {
    "compiler": "solc",
    "compilerVersion": "0.8.7+commit.e28d00a7",
    "name": "MyContract",
    "fullyQualifiedName": "contracts/MyContract.sol:MyContract"
  },
  "signatures": {
    "function": [
      {
        "signature": "transfer(address,uint256)",
        "signatureHash32": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
        "signatureHash4": "0xa9059cbb"
      }
    ],
    "event": [
      {
        "signature": "transfer(address,uint256)",
        "signatureHash32": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
        "signatureHash4": "0xa9059cbb"
      }
    ],
    "error": [
      {
        "signature": "transfer(address,uint256)",
        "signatureHash32": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
        "signatureHash4": "0xa9059cbb"
      }
    ]
  },
  "proxyResolution": {
    "implementations": [
      {
        "address": "0xDFEBAd708F803af22e81044aD228Ff77C83C935c"
      }
    ],
    "proxyResolutionError": {
      "customCode": "unsupported_chain",
      "message": "The chain with chainId 9429413 is not supported",
      "errorId": "1ac6b91a-0605-4459-93dc-18f210a70192"
    }
  }
}