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 txHash is provided, the response identifies the corresponding blockNum.
  • If both blockNum and txHash are provided, both are accepted as provided.
Set 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
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Nested Schema : abi
Type: array
Show Source
Nested Schema : asOf
Type: object
Required when creating a new version. Provide at least one of blockNum or txHash.
Show Source
Nested Schema : layout
Type: object
Solidity compiler storage-layout JSON. Must include storage and types.
Nested Schema : items
Type: object
Examples

Back to Top

Response

Supported Media Types

202 Response

Returns the accepted contract metadata import request.
Body ()
Root Schema : SolcIngestResult
Type: object
Result of an asynchronous Solidity compiler metadata import request.
Show Source

400 Response

Validation failed.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.

500 Response

Unexpected service error.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.
Back to Top