EVMC
|
The EVM code execution result. More...
#include <evmc.h>
Public Attributes | |
enum evmc_status_code | status_code |
The execution status code. | |
int64_t | gas_left |
The amount of gas left after the execution. | |
int64_t | gas_refund |
The refunded gas accumulated from this execution and its sub-calls. | |
const uint8_t * | output_data |
The reference to output data. | |
size_t | output_size |
The size of the output data. | |
evmc_release_result_fn | release |
The method releasing all resources associated with the result object. | |
evmc_address | create_address |
The address of the possibly created contract. | |
uint8_t | padding [4] |
Reserved data that MAY be used by a evmc_result object creator. | |
evmc_address evmc_result::create_address |
The address of the possibly created contract.
The create address may be provided even though the contract creation has failed (evmc_result::status_code is not EVMC_SUCCESS). This is useful in situations when the address is observable, e.g. access to it remains warm. In all other cases the address MUST be null bytes.
int64_t evmc_result::gas_left |
The amount of gas left after the execution.
If evmc_result::status_code is neither EVMC_SUCCESS nor EVMC_REVERT the value MUST be 0.
int64_t evmc_result::gas_refund |
The refunded gas accumulated from this execution and its sub-calls.
The transaction gas refund limit is not applied. If evmc_result::status_code is other than EVMC_SUCCESS the value MUST be 0.
const uint8_t* evmc_result::output_data |
The reference to output data.
The output contains data coming from RETURN opcode (iff evmc_result::code field is EVMC_SUCCESS) or from REVERT opcode.
The memory containing the output data is owned by EVM and has to be freed with evmc_result::release().
This pointer MAY be NULL. If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced.
size_t evmc_result::output_size |
The size of the output data.
If evmc_result::output_data is NULL this MUST be 0.
uint8_t evmc_result::padding[4] |
Reserved data that MAY be used by a evmc_result object creator.
This reserved 4 bytes together with 20 bytes from create_address form 24 bytes of memory called "optional data" within evmc_result struct to be optionally used by the evmc_result object creator.
Also extends the size of the evmc_result to 64 bytes (full cache line).
evmc_release_result_fn evmc_result::release |
The method releasing all resources associated with the result object.
This method (function pointer) is optional (MAY be NULL) and MAY be set by the VM implementation. If set it MUST be called by the user once to release memory and other resources associated with the result object. Once the resources are released the result object MUST NOT be used again.
The suggested code pattern for releasing execution results:
enum evmc_status_code evmc_result::status_code |