EVMC
|
The EVM code execution result. More...
#include <evmc.hpp>
Public Member Functions | |
Result (evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const uint8_t *_output_data, size_t _output_size) noexcept | |
Creates the result from the provided arguments. | |
Result (evmc_status_code _status_code=EVMC_INTERNAL_ERROR, int64_t _gas_left=0, int64_t _gas_refund=0) noexcept | |
Creates the result without output. | |
Result (evmc_status_code _status_code, int64_t _gas_left, int64_t _gas_refund, const evmc_address &_create_address) noexcept | |
Creates the result of contract creation. | |
Result (const evmc_result &res) noexcept | |
Converting constructor from raw evmc_result. | |
~Result () noexcept | |
Destructor responsible for automatically releasing attached resources. | |
Result (Result &&other) noexcept | |
Move constructor. | |
Result & | operator= (Result &&other) noexcept |
Move assignment operator. | |
evmc_result & | raw () noexcept |
Access the result object as a referenced to evmc_result. | |
const evmc_result & | raw () const noexcept |
Access the result object as a const referenced to evmc_result. | |
evmc_result | release_raw () noexcept |
Releases the ownership and returns the raw copy of evmc_result. | |
Public Attributes | |
evmc_address | create_address |
The address of the possibly created contract. | |
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. | |
enum evmc_status_code | status_code |
The execution status code. | |
The EVM code execution result.
This is a RAII wrapper for evmc_result and objects of this type automatically release attached resources.
|
inlineexplicitnoexcept |
Creates the result from the provided arguments.
The provided output is copied to memory allocated with malloc() and the evmc_result::release function is set to one invoking free().
_status_code | The status code. |
_gas_left | The amount of gas left. |
_gas_refund | The amount of refunded gas. |
_output_data | The pointer to the output. |
_output_size | The output size. |
Definition at line 348 of file evmc.hpp.
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
Creates the result of contract creation.
_status_code | The status code. |
_gas_left | The amount of gas left. |
_gas_refund | The amount of refunded gas. |
_create_address | The address of the possibly created account. |
Definition at line 373 of file evmc.hpp.
|
inlineexplicitnoexcept |
Converting constructor from raw evmc_result.
This object takes ownership of the resources of res
.
Definition at line 385 of file evmc.hpp.
|
inlinenoexcept |
Destructor responsible for automatically releasing attached resources.
Definition at line 388 of file evmc.hpp.
|
inlinenoexcept |
Move assignment operator.
The self-assignment MUST never happen.
other | The other result object. |
Definition at line 406 of file evmc.hpp.
|
inlinenoexcept |
Access the result object as a const referenced to evmc_result.
Definition at line 418 of file evmc.hpp.
|
inlinenoexcept |
Access the result object as a referenced to evmc_result.
Definition at line 415 of file evmc.hpp.
|
inlinenoexcept |
Releases the ownership and returns the raw copy of evmc_result.
This method drops the ownership of the result (result's resources are not going to be released when this object is destructed). It is the caller's responsibility having the returned copy of the result to release it. This object MUST NOT be used after this method is invoked.
Definition at line 428 of file evmc.hpp.
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.
enum evmc_status_code evmc_result::status_code |