23 printf(
"EVM-C: QUERY %d\n", key);
42 static void update(
struct evm_env* env,
47 printf(
"EVM-C: UPDATE %d\n", key);
51 struct evm_env* _opaqueEnv,
56 uint8_t
const* _inputData,
62 printf(
"EVM-C: CALL %d\n", _kind);
63 return EVM_CALL_FAILURE;
67 int main(
int argc,
char *argv[]) {
74 uint8_t
const code[] =
"Place some EVM bytecode here";
75 const size_t code_size =
sizeof(
code);
77 uint8_t
const input[] =
"Hello World!";
83 input,
sizeof(input), value);
85 printf(
"Execution result:\n");
87 printf(
" EVM execution failure: %d\n", result.
code);
uint8_t bytes[32]
The 32 bytes of the big-endian integer or hash.
Big-endian 256-bit integer.
struct evm_uint256be balance(struct evm_env *env, struct evm_uint160be address)
uint8_t const * output_data
The reference to output data.
struct evm_uint160be address
An Ethereum address.
int64_t gas_left
The amount of gas left after the execution.
int main(int argc, char *argv[])
Example how the API is supposed to be used.
evm_release_result_fn release
The pointer to the result release implementation.
Execution finished with success.
struct evm_uint256be uint256be
A big-endian 256-bit integer or hash.
int64_t int64
A host-endian 64-bit integer.
struct evm_factory examplevm_get_factory()
Example of a function creating uninitialized instance of an example VM.
Address of the contract for ADDRESS.
evm_create_fn create
Pointer to function creating and initializing the EVM instance.
evm_update_key
The update callback key.
Variant type to represent possible types of values used in EVM.
The EVM instance factory.
enum evm_result_code code
The execution result code.
size_t output_size
The size of the output data.
Balance of a given address for BALANCE.
evm_destroy_fn destroy
Pointer to function destroying the EVM instance.
Big-endian 160-bit hash suitable for keeping an Ethereum address.
int abi_version
EVM-C ABI version implemented by the EVM factory and instance.
evm_call_kind
The kind of call-like instruction.
evm_execute_fn execute
Pointer to function executing a code by the EVM instance.
The EVM code execution result.
Current block gas limit for GASLIMIT.
struct evm_uint160be address(struct evm_env *env)
evm_query_key
The query callback key.
uint8_t bytes[20]
The 20 bytes of the hash.