14#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 6)
21#define EVMC_DEPRECATED __attribute__((deprecated))
23#define EVMC_DEPRECATED
741 uint8_t* buffer_data,
778 size_t topics_count);
911 EVMC_SET_OPTION_SUCCESS = 0,
912 EVMC_SET_OPTION_INVALID_NAME = 1,
913 EVMC_SET_OPTION_INVALID_VALUE = 2
1084 uint8_t
const* code,
1201#ifdef EVMC_DOCUMENTATION
evmc_flags
The flags for evmc_message.
bool(* evmc_selfdestruct_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_address *beneficiary)
Selfdestruct callback function.
void(* evmc_destroy_fn)(struct evmc_vm *vm)
Destroys the VM instance.
struct evmc_bytes32 evmc_uint256be
The alias for evmc_bytes32 to represent a big-endian 256-bit integer.
evmc_set_option_result
Possible outcomes of evmc_set_option.
void(* evmc_release_result_fn)(const struct evmc_result *result)
Releases resources assigned to an execution result.
size_t(* evmc_get_code_size_fn)(struct evmc_host_context *context, const evmc_address *address)
Get code size callback function.
evmc_capabilities
Possible capabilities of a VM.
struct evmc_vm * evmc_create_example_vm(void)
Example of a function creating an instance of an example EVM implementation.
evmc_status_code
The execution status code.
bool(* evmc_account_exists_fn)(struct evmc_host_context *context, const evmc_address *address)
Check account existence callback function.
evmc_uint256be(* evmc_get_balance_fn)(struct evmc_host_context *context, const evmc_address *address)
Get balance callback function.
struct evmc_result(* evmc_call_fn)(struct evmc_host_context *context, const struct evmc_message *msg)
Pointer to the callback function supporting EVM calls.
enum evmc_set_option_result(* evmc_set_option_fn)(struct evmc_vm *vm, char const *name, char const *value)
Configures the VM instance.
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
evmc_bytes32(* evmc_get_code_hash_fn)(struct evmc_host_context *context, const evmc_address *address)
Get code hash callback function.
evmc_bytes32(* evmc_get_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Get storage callback function.
struct evmc_tx_context(* evmc_get_tx_context_fn)(struct evmc_host_context *context)
Get transaction context callback function.
size_t(* evmc_copy_code_fn)(struct evmc_host_context *context, const evmc_address *address, size_t code_offset, uint8_t *buffer_data, size_t buffer_size)
Copy code callback function.
enum evmc_access_status(* evmc_access_account_fn)(struct evmc_host_context *context, const evmc_address *address)
Access account callback function.
evmc_bytes32(* evmc_get_block_hash_fn)(struct evmc_host_context *context, int64_t number)
Get block hash callback function.
evmc_capabilities_flagset(* evmc_get_capabilities_fn)(struct evmc_vm *vm)
Return the supported capabilities of the VM instance.
evmc_access_status
Access status per EIP-2929: Gas cost increases for state access opcodes.
void(* evmc_emit_log_fn)(struct evmc_host_context *context, const evmc_address *address, const uint8_t *data, size_t data_size, const evmc_bytes32 topics[], size_t topics_count)
Log callback function.
evmc_call_kind
The kind of call-like instruction.
enum evmc_access_status(* evmc_access_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Access storage callback function.
evmc_storage_status
The effect of an attempt to modify a contract storage item.
void(* evmc_set_transient_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
Set transient storage callback function.
evmc_revision
EVM revision.
struct evmc_result(* evmc_execute_fn)(struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
Executes the given code using the input from the message.
enum evmc_storage_status(* evmc_set_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key, const evmc_bytes32 *value)
Set storage callback function.
evmc_bytes32(* evmc_get_transient_storage_fn)(struct evmc_host_context *context, const evmc_address *address, const evmc_bytes32 *key)
Get transient storage callback function.
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
@ EVMC_STATIC
Static call mode.
@ EVMC_CAPABILITY_EVM1
The VM is capable of executing EVM1 bytecode.
@ EVMC_CAPABILITY_PRECOMPILES
The VM is capable of executing the precompiled contracts defined for the range of code addresses.
@ EVMC_CAPABILITY_EWASM
The VM is capable of executing ewasm bytecode.
@ EVMC_INSUFFICIENT_BALANCE
The caller does not have enough funds for value transfer.
@ EVMC_ARGUMENT_OUT_OF_RANGE
An argument to a state accessing method has a value outside of the accepted range of values.
@ EVMC_INVALID_MEMORY_ACCESS
Tried to read outside memory bounds.
@ EVMC_REJECTED
The execution of the given code and/or message has been rejected by the EVM implementation.
@ EVMC_UNDEFINED_INSTRUCTION
An undefined instruction has been encountered.
@ EVMC_SUCCESS
Execution finished with success.
@ EVMC_OUT_OF_MEMORY
The VM failed to allocate the amount of memory needed for execution.
@ EVMC_STACK_UNDERFLOW
Execution of an opcode has required more items on the EVM stack.
@ EVMC_BAD_JUMP_DESTINATION
Execution has violated the jump destination restrictions.
@ EVMC_INVALID_INSTRUCTION
The designated INVALID instruction has been hit during execution.
@ EVMC_STATIC_MODE_VIOLATION
Tried to execute an operation which is restricted in static mode.
@ EVMC_WASM_TRAP
A WebAssembly trap has been hit during execution.
@ EVMC_PRECOMPILE_FAILURE
A call to a precompiled or system contract has ended with a failure.
@ EVMC_INTERNAL_ERROR
EVM implementation generic internal error.
@ EVMC_OUT_OF_GAS
The execution has run out of gas.
@ EVMC_CONTRACT_VALIDATION_FAILURE
Contract validation has failed (e.g.
@ EVMC_CALL_DEPTH_EXCEEDED
Call depth has exceeded the limit (if any)
@ EVMC_WASM_UNREACHABLE_INSTRUCTION
A WebAssembly unreachable instruction has been hit during execution.
@ EVMC_STACK_OVERFLOW
The execution has attempted to put more items on the EVM stack than the specified limit.
@ EVMC_FAILURE
Generic execution failure.
@ EVMC_REVERT
Execution terminated with REVERT opcode.
@ EVMC_ACCESS_COLD
The entry hasn't been accessed before – it's the first access.
@ EVMC_ACCESS_WARM
The entry is already in accessed_addresses or accessed_storage_keys.
@ EVMC_CREATE
Request CREATE.
@ EVMC_EOFCREATE
Request EOFCREATE.
@ EVMC_DELEGATECALL
Request DELEGATECALL.
@ EVMC_CREATE2
Request CREATE2.
@ EVMC_CALLCODE
Request CALLCODE.
@ EVMC_STORAGE_ADDED_DELETED
A storage item is deleted by changing the current dirty nonzero to the original zero value.
@ EVMC_STORAGE_MODIFIED_RESTORED
A storage item is modified by changing the current dirty nonzero to the original nonzero value other ...
@ EVMC_STORAGE_DELETED_RESTORED
A storage item is added by changing the current dirty zero to the original value.
@ EVMC_STORAGE_ADDED
A new storage item is added by changing the current clean zero to a nonzero value.
@ EVMC_STORAGE_MODIFIED_DELETED
A storage item is deleted by changing the current dirty nonzero to the zero value and the original va...
@ EVMC_STORAGE_ASSIGNED
The new/same value is assigned to the storage item without affecting the cost structure.
@ EVMC_STORAGE_DELETED
A storage item is deleted by changing the current clean nonzero to the zero value.
@ EVMC_STORAGE_DELETED_ADDED
A storage item is added by changing the current dirty zero to a nonzero value other than the original...
@ EVMC_STORAGE_MODIFIED
A storage item is modified by changing the current clean nonzero to other nonzero value.
@ EVMC_OSAKA
The Osaka revision.
@ EVMC_HOMESTEAD
The Homestead revision.
@ EVMC_LATEST_STABLE_REVISION
The latest known EVM revision with finalized specification.
@ EVMC_PRAGUE
The Prague revision.
@ EVMC_ISTANBUL
The Istanbul revision.
@ EVMC_FRONTIER
The Frontier revision.
@ EVMC_PETERSBURG
The Petersburg revision.
@ EVMC_CONSTANTINOPLE
The Constantinople revision.
@ EVMC_TANGERINE_WHISTLE
The Tangerine Whistle revision.
@ EVMC_MAX_REVISION
The maximum EVM revision supported.
@ EVMC_SPURIOUS_DRAGON
The Spurious Dragon revision.
@ EVMC_BYZANTIUM
The Byzantium revision.
@ EVMC_CANCUN
The Cancun revision.
@ EVMC_SHANGHAI
The Shanghai revision.
@ EVMC_LONDON
The London revision.
@ EVMC_PARIS
The Paris revision (aka The Merge).
@ EVMC_BERLIN
The Berlin revision.
Big-endian 160-bit hash suitable for keeping an Ethereum address.
uint8_t bytes[20]
The 20 bytes of the hash.
The fixed size array of 32 bytes.
uint8_t bytes[32]
The 32 bytes.
The opaque data type representing the Host execution context.
evmc_get_code_hash_fn get_code_hash
Get code hash callback function.
evmc_call_fn call
Call callback function.
evmc_selfdestruct_fn selfdestruct
Selfdestruct callback function.
evmc_get_storage_fn get_storage
Get storage callback function.
evmc_copy_code_fn copy_code
Copy code callback function.
evmc_get_code_size_fn get_code_size
Get code size callback function.
evmc_get_transient_storage_fn get_transient_storage
Get transient storage callback function.
evmc_set_transient_storage_fn set_transient_storage
Set transient storage callback function.
evmc_get_block_hash_fn get_block_hash
Get block hash callback function.
evmc_emit_log_fn emit_log
Emit log callback function.
evmc_account_exists_fn account_exists
Check account existence callback function.
evmc_access_account_fn access_account
Access account callback function.
evmc_get_balance_fn get_balance
Get balance callback function.
evmc_set_storage_fn set_storage
Set storage callback function.
evmc_get_tx_context_fn get_tx_context
Get transaction context callback function.
evmc_access_storage_fn access_storage
Access storage callback function.
The message describing an EVM call, including a zero-depth calls from a transaction origin.
const uint8_t * input_data
The message input data.
evmc_bytes32 create2_salt
The optional value used in new contract address construction.
const uint8_t * code
The code to be executed.
size_t input_size
The size of the message input data.
evmc_address recipient
The recipient of the message.
enum evmc_call_kind kind
The kind of the call.
int32_t depth
The present depth of the message call stack.
uint32_t flags
Additional flags modifying the call execution behavior.
evmc_address code_address
The address of the code to be executed.
size_t code_size
The length of the code to be executed.
evmc_uint256be value
The amount of Ether transferred with the message.
evmc_address sender
The sender of the message.
int64_t gas
The amount of gas available to the message execution.
The EVM code execution result.
const uint8_t * output_data
The reference to output data.
enum evmc_status_code status_code
The execution status code.
evmc_release_result_fn release
The method releasing all resources associated with the result object.
int64_t gas_refund
The refunded gas accumulated from this execution and its sub-calls.
size_t output_size
The size of the output data.
uint8_t padding[4]
Reserved data that MAY be used by a evmc_result object creator.
evmc_address create_address
The address of the possibly created contract.
int64_t gas_left
The amount of gas left after the execution.
The transaction and block data for execution.
size_t initcodes_count
The number of transaction initcodes (TXCREATE).
evmc_address tx_origin
The transaction origin account.
evmc_uint256be block_base_fee
The block base fee per gas (EIP-1559, EIP-3198).
int64_t block_number
The block number.
int64_t block_timestamp
The block timestamp.
const evmc_bytes32 * blob_hashes
The array of blob hashes (EIP-4844).
evmc_uint256be tx_gas_price
The transaction gas price.
const evmc_tx_initcode * initcodes
The array of transaction initcodes (TXCREATE).
size_t blob_hashes_count
The number of blob hashes (EIP-4844).
evmc_uint256be chain_id
The blockchain's ChainID.
evmc_uint256be block_prev_randao
The block previous RANDAO (EIP-4399).
evmc_address block_coinbase
The miner of the block.
evmc_uint256be blob_base_fee
The blob base fee (EIP-7516).
int64_t block_gas_limit
The block gas limit.
The hashed initcode used for TXCREATE instruction.
size_t code_size
The length of the code.
evmc_bytes32 hash
The initcode hash.
const uint8_t * code
The code.
evmc_set_option_fn set_option
Optional pointer to function modifying VM's options.
evmc_get_capabilities_fn get_capabilities
A method returning capabilities supported by the VM instance.
evmc_execute_fn execute
Pointer to function executing a code by the VM instance.
const char * name
The name of the EVMC VM implementation.
evmc_destroy_fn destroy
Pointer to function destroying the VM instance.
const int abi_version
EVMC ABI version implemented by the VM instance.
const char * version
The version of the EVMC VM implementation, e.g.