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"
    }
  }
}

Changes

Changed in 3 of the 5 revisions of this API.1347

    • the response property allOf[subschema #1: VerifiedContractMinimal]/creationMatch became nullable for the status 200

      response-property-became-nullable

    • the response property allOf[subschema #1: VerifiedContractMinimal]/match became nullable for the status 200

      response-property-became-nullable

    • the response property allOf[subschema #1: VerifiedContractMinimal]/matchId became nullable for the status 200

      response-property-became-nullable

    • the response property allOf[subschema #1: VerifiedContractMinimal]/runtimeMatch became nullable for the status 200

      response-property-became-nullable

    • the response property allOf[subschema #1: VerifiedContractMinimal]/verifiedAt became nullable for the status 200

      response-property-became-nullable

  • eef63cd83966216See the full diff
    • the path request parameter chainId was restricted to a list of enum values

      request-parameter-became-enum

    • for the path request parameter chainId, the type/format was changed from string/ to integer/

      request-parameter-type-changed

    • changed the pattern of the path request parameter address from (\b0x[a-fA-F0-9]{40}\b) to ^0x[a-fA-F0-9]{40}$

      request-parameter-pattern-changed

    • added the new enum value 31318.00 to the path request parameter chainId

      request-parameter-enum-value-added

    • added the new enum value 4217.00 to the path request parameter chainId

      request-parameter-enum-value-added

    • added the new enum value 42431.00 to the path request parameter chainId

      request-parameter-enum-value-added

    • for the path request parameter address, the minLength was decreased from 42 to 0

      request-parameter-min-length-decreased

    • for the path request parameter chainId, the minLength was decreased from 1 to 0

      request-parameter-min-length-decreased

    • removed the pattern ^\d+$ from the path request parameter chainId

      request-parameter-pattern-removed

  • f02ddb386819631See the full diff
    • removed the enum value 31318.00 from the path request parameter chainId

      request-parameter-enum-value-removed

    • removed the enum value 4217.00 from the path request parameter chainId

      request-parameter-enum-value-removed

    • removed the enum value 42431.00 from the path request parameter chainId

      request-parameter-enum-value-removed

    • for the path request parameter address, the minLength was increased from 0 to 42

      request-parameter-min-length-increased

    • for the path request parameter chainId, the minLength was increased from 0 to 1

      request-parameter-min-length-increased

    • added the pattern ^\d+$ to the path request parameter chainId

      request-parameter-pattern-added

    • for the path request parameter address, the maxLength was set to 42

      request-parameter-max-length-set

    • for the path request parameter chainId, the maxLength was set to 20

      request-parameter-max-length-set

    • changed the pattern of the path request parameter address from ^0x[a-fA-F0-9]{40}$ to (\b0x[a-fA-F0-9]{40}\b)

      request-parameter-pattern-changed

    • for the path request parameter chainId, the type/format was generalized from integer/ to string/

      request-parameter-type-generalized

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog