24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wold-style-cast"
84 return EVMC_SET_OPTION_INVALID_NAME;
100 return vm->execute(vm, host, context, rev, msg,
code,
code_size);
134 memset(&result, 0,
sizeof(result));
234 return "invalid instruction";
236 return "undefined instruction";
238 return "stack overflow";
240 return "stack underflow";
242 return "bad jump destination";
244 return "invalid memory access";
246 return "call depth exceeded";
248 return "static mode violation";
250 return "precompile failure";
252 return "contract validation failure";
254 return "argument out of range";
256 return "wasm unreachable instruction";
260 return "insufficient balance";
262 return "internal error";
266 return "out of memory";
281 return "Tangerine Whistle";
283 return "Spurious Dragon";
287 return "Constantinople";
314#pragma GCC diagnostic pop
evmc_set_option_result
Possible outcomes of evmc_set_option.
evmc_capabilities
Possible capabilities of a VM.
evmc_status_code
The execution status code.
uint32_t evmc_capabilities_flagset
Alias for unsigned integer representing a set of bit flags of EVMC capabilities.
evmc_revision
EVM revision.
@ EVMC_ABI_VERSION
The EVMC ABI version number of the interface declared in this file.
@ 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_OSAKA
The Osaka revision.
@ EVMC_HOMESTEAD
The Homestead revision.
@ 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_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.
static void evmc_free_result_memory(const struct evmc_result *result)
The evmc_result release function using free() for releasing the memory.
static bool evmc_vm_has_capability(struct evmc_vm *vm, enum evmc_capabilities capability)
Checks if the VM has the given capability.
static void evmc_destroy(struct evmc_vm *vm)
Destroys the VM instance.
static void evmc_release_result(struct evmc_result *result)
Releases the resources allocated to the execution result.
static bool evmc_is_abi_compatible(struct evmc_vm *vm)
Returns true if the VM has a compatible ABI version.
static struct evmc_result evmc_execute(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 code in the VM instance.
static const char * evmc_vm_version(struct evmc_vm *vm)
Returns the version of the VM.
static struct evmc_result evmc_make_result(enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
Creates the result from the provided arguments.
static const char * evmc_revision_to_string(enum evmc_revision rev)
Returns the name of the evmc_revision.
static const char * evmc_vm_name(struct evmc_vm *vm)
Returns the name of the VM.
static const char * evmc_status_code_to_string(enum evmc_status_code status_code)
Returns text representation of the evmc_status_code.
static enum evmc_set_option_result evmc_set_option(struct evmc_vm *vm, char const *name, char const *value)
Sets the option for the VM, if the feature is supported by the VM.
static const union evmc_result_optional_storage * evmc_get_const_optional_storage(const struct evmc_result *result)
Provides read-only access to evmc_result "optional storage".
static union evmc_result_optional_storage * evmc_get_optional_storage(struct evmc_result *result)
Provides read-write access to evmc_result "optional storage".
The opaque data type representing the Host execution context.
The message describing an EVM call, including a zero-depth calls from a transaction origin.
const uint8_t * code
The code to be executed.
size_t code_size
The length of the code to be executed.
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.
evmc_address create_address
The address of the possibly created contract.
int64_t gas_left
The amount of gas left after the execution.
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.
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.
The union representing evmc_result "optional storage".
void * pointer
Optional pointer.
uint8_t bytes[24]
24 bytes of optional storage.