Import Contract Storage Layout, ABI, and Bytecode
post
/v1/contracts/solc/import
By default, imports metadata as a new contract version.
For a new version,
asOf is required and must include at least one of blockNum or txHash. - If only
txHashis provided, the response identifies the correspondingblockNum. - If both
blockNumandtxHashare provided, both are accepted as provided.
update=true to update an existing version identified by exactly one of updateVersion or updateTxHash. The supplied creation bytecode is retained as provided; the response does not include runtime bytecode from the chain.
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
Show Source
object-
abi(required): array
abi
-
address(required): string
Deployed contract address.
-
asOf: object
asOf
Required when creating a new version. Provide at least one of
blockNumortxHash. -
bytecode(required): string
Creation bytecode in 0x-prefixed hexadecimal format.
-
layout(required): object
layout
Solidity compiler storage-layout JSON. Must include
storageandtypes. -
metadata:
Optional user-facing metadata stored with this contract version.
-
role: string
Optional contract classification (
regular,proxy,implementation, orlibrary). Defaults toregular. -
update: boolean
Default Value:
falseWhentrue, update an existing contract version. -
updateTxHash: [
"string",
"null"
]
Existing transaction hash that identifies the version to update. Required when
update=trueunlessupdateVersionis provided. -
updateVersion: [
"integer",
"null"
]
Existing version number to update. Required when
update=trueunlessupdateTxHashis provided.
Nested Schema : asOf
Type:
objectRequired when creating a new version. Provide at least one of
Show Source
blockNum or txHash.-
blockNum: string
74254541910102660000000000000
-
timestamp: [
"string",
"null"
]
-
txHash: [
"string",
"null"
]
81642776211137670000000000000000000000000
Nested Schema : layout
Type:
objectSolidity compiler storage-layout JSON. Must include
storage and types.Nested Schema : items
Type:
objectExamples
Back to Top
Response
Supported Media Types
- application/json
202 Response
Returns the accepted contract metadata import request.
Root Schema : SolcIngestResult
Type:
objectResult of an asynchronous Solidity compiler metadata import request.
Show Source
-
address: string
Contract address associated with the ingested metadata.
-
update: boolean
Indicates whether the operation updated an existing contract version record.
-
version: [
"integer",
"null"
]
Logical contract version number associated with the ingest result, when available.
-
versionRowId:
Identifier of the affected version record, when available.
400 Response
Validation failed.
Root Schema : ErrorResponse
Type:
objectError response returned by the service.
Show Source
-
decodedError:
Returned only when `decode.errors=true` and decodable revert bytes are present.
-
error: string
Short error summary suitable for display.
-
hint: [
"string",
"null"
]
Optional guidance for resolving the error.
-
message: [
"string",
"null"
]
Additional error details, when available.
-
policy:
Present for policy warnings or denials such as preflight failure.
-
preflight:
Present for preflight-gated transaction submission errors.
-
requestId: [
"string",
"null"
]
Client-provided correlation ID echoed in the response.
-
upstreamCode: [
"integer",
"null"
]
Besu node error code, when provided by the RPC endpoint.
-
upstreamData: [
"string",
"null"
]
Error data returned by the Besu node in 0x-prefixed hexadecimal or JSON format, when available.
-
upstreamError: [
"object",
"null"
]
upstreamError
Additional Properties Allowed:
trueComplete error object returned by the Besu node, including code, message, and data fields, when available.
Nested Schema : upstreamError
Type:
objectAdditional Properties Allowed:
trueComplete error object returned by the Besu node, including code, message, and data fields, when available.
500 Response
Unexpected service error.
Root Schema : ErrorResponse
Type:
objectError response returned by the service.
Show Source
-
decodedError:
Returned only when `decode.errors=true` and decodable revert bytes are present.
-
error: string
Short error summary suitable for display.
-
hint: [
"string",
"null"
]
Optional guidance for resolving the error.
-
message: [
"string",
"null"
]
Additional error details, when available.
-
policy:
Present for policy warnings or denials such as preflight failure.
-
preflight:
Present for preflight-gated transaction submission errors.
-
requestId: [
"string",
"null"
]
Client-provided correlation ID echoed in the response.
-
upstreamCode: [
"integer",
"null"
]
Besu node error code, when provided by the RPC endpoint.
-
upstreamData: [
"string",
"null"
]
Error data returned by the Besu node in 0x-prefixed hexadecimal or JSON format, when available.
-
upstreamError: [
"object",
"null"
]
upstreamError
Additional Properties Allowed:
trueComplete error object returned by the Besu node, including code, message, and data fields, when available.
Nested Schema : upstreamError
Type:
objectAdditional Properties Allowed:
trueComplete error object returned by the Besu node, including code, message, and data fields, when available.