This file represents all the network state present in the EVM. It will incrementally build up to supporting the entire EVM-C API.
EVM Status Codes¶
The following codes all indicate that the VM ended execution with an exception, but give details about how.
EVMC_FAILUREis a catch-all for generic execution failure.
EVMC_INVALID_INSTRUCTIONindicates reaching the designated
EVMC_UNDEFINED_INSTRUCTIONindicates that an undefined opcode has been reached.
EVMC_OUT_OF_GASindicates that execution exhausted the gas supply.
JUMP*to a non-
EVMC_STACK_OVERFLOWindicates pushing more than 1024 elements onto the wordstack.
EVMC_STACK_UNDERFLOWindicates popping elements off an empty wordstack.
EVMC_CALL_DEPTH_EXCEEDEDindicates that we have executed too deeply a nested sequence of
EVMC_INVALID_MEMORY_ACCESSindicates that a bad memory access occured. This can happen when accessing local memory with
CALLDATACOPY, or when accessing return data with
EVMC_STATIC_MODE_VIOLATIONindicates that a
STATICCALLtried to change state. TODO: Avoid
_ERRORsuffix that suggests fatal error.
EVMC_PRECOMPILE_FAILUREindicates an errors in the precompiled contracts (eg. invalid points handed to elliptic curve functions).
syntax ExceptionalStatusCode ::= "EVMC_FAILURE" | "EVMC_INVALID_INSTRUCTION" | "EVMC_UNDEFINED_INSTRUCTION" | "EVMC_OUT_OF_GAS" | "EVMC_BAD_JUMP_DESTINATION" | "EVMC_STACK_OVERFLOW" | "EVMC_STACK_UNDERFLOW" | "EVMC_CALL_DEPTH_EXCEEDED" | "EVMC_INVALID_MEMORY_ACCESS" | "EVMC_STATIC_MODE_VIOLATION" | "EVMC_PRECOMPILE_FAILURE"
These additional status codes indicate that execution has ended in some non-exceptional way.
EVMC_SUCCESSindicates successful end of execution.
EVMC_REVERTindicates that the contract called
syntax EndStatusCode ::= ExceptionalStatusCode | "EVMC_SUCCESS" | "EVMC_REVERT"
The following codes indicate other non-execution errors with the VM.
EVMC_REJECTEDindicates malformed or wrong-version EVM bytecode.
EVMC_INTERNAL_ERRORindicates some other error that is unrecoverable but not due to the bytecode.
.StatusCodeis an extra code added for “unset or unknown”.
syntax StatusCode ::= EndStatusCode | "EVMC_REJECTED" | "EVMC_INTERNAL_ERROR" | ".StatusCode"
The following are status codes used to report network state failures to the EVM from the client. These are not present in the EVM-C API.
EVMC_ACCOUNT_ALREADY_EXISTSindicates that a newly created account already exists.
EVMC_BALANCE_UNDERFLOWindicates an attempt to create an account which already exists.
syntax ExceptionalStatusCode ::= "EVMC_ACCOUNT_ALREADY_EXISTS" | "EVMC_BALANCE_UNDERFLOW"