Skip to main content

Artifacts (JSON)

The Verifier Alliance schema stores outputs of the compilations in the compiled_contracts table under the following JSON columns:

  • compilation_artifacts: Artifacts of the compilation of the contracts
  • creation_code_artifacts: Artifacts related to the creation code
  • runtime_code_artifacts: Artifacts related to the runtime code

The rules to the format and content of the artifacts JSONs are implemented in the contraints of the PostgreSQL Schema.

compilation_artifacts

The fields from the compilation output JSON.

This object MUST contain the following fields. If a field is not output or available it MUST be set to null.

  • abi
  • userdoc
  • devdoc
  • sources - The AST identifiers of sources
  • storageLayout - Only available after a certain Solidity version. If N/A set to null.
{
"abi": [...],
"userdoc": {...},
"devdoc": {...},
"sources": {
"contracts/proxy/ERC1967Proxy.sol": {
"id": 0
},
"contracts/proxy/ERC1967Trans.sol": {
"id": 1
}
},
"storageLayout": {...}
}

creation_code_artifacts

The fields under evm.bytecode of the compilation target contract in the compilation output JSON.

This object MUST contain the following fields, unless otherwise specified. If a required field is not available it MUST be set to null.

  • sourceMap - In the newer versions of Vyper this is a JSON. For earlier versions and Solidity it's a string
  • linkReferences
  • cborAuxdata (optional) - the positions and the value of the CBOR auxdatas in the bytecode. This is not output by the compiler but has to be calculated by the verifier manually. If the verifier cannot calculate, the field isn't set in the object. If there are no CBOR auxdata, the field is set to null.
{
"sourceMap": "64:1990:0:-:0;;;443:1;408:36;;64:1990;;;;;;;;;;;;;;;;",
"cborAuxdata": {
"1": {
"value": "0xa264697066735822122087fcd42abf4e96c83b36564d81df50fce05eca8d8a8ee3a87157b72b501c952d64736f6c63430008090033",
"offset": 3853
}
},
"linkReferences": {}
}

runtime_code_artifacts

The fields under evm.deployedBytecode of the compilation target contract in the compilation output JSON.

In addition to the creation_code_artifacts fields, this object MUST contain the following fields. If a field is not output or available it MUST be set to null.

  • all fields from creation_code_artifacts
  • immutableReferences
{
"sourceMap": "1580:16227:21:-:0;;;;;;;;...",
"cborAuxdata": {
"1": {
"value": "0xa26469706673582212209da9a9c431e04d0fe200fc9a3064e582d06894a511ee512e771f2ec24bb2f4f864736f6c63430008130033",
"offset": 15660
}
},
"linkReferences": {},
"immutableReferences": {
"2471": [
{
"start": 1830,
"length": 32
},
...
]
}
}