evmc_status_code

Enum evmc_status_code 

Source
#[repr(i32)]
pub enum evmc_status_code {
Show 21 variants EVMC_SUCCESS = 0, EVMC_FAILURE = 1, EVMC_REVERT = 2, EVMC_OUT_OF_GAS = 3, EVMC_INVALID_INSTRUCTION = 4, EVMC_UNDEFINED_INSTRUCTION = 5, EVMC_STACK_OVERFLOW = 6, EVMC_STACK_UNDERFLOW = 7, EVMC_BAD_JUMP_DESTINATION = 8, EVMC_INVALID_MEMORY_ACCESS = 9, EVMC_CALL_DEPTH_EXCEEDED = 10, EVMC_STATIC_MODE_VIOLATION = 11, EVMC_PRECOMPILE_FAILURE = 12, EVMC_CONTRACT_VALIDATION_FAILURE = 13, EVMC_ARGUMENT_OUT_OF_RANGE = 14, EVMC_WASM_UNREACHABLE_INSTRUCTION = 15, EVMC_WASM_TRAP = 16, EVMC_INSUFFICIENT_BALANCE = 17, EVMC_INTERNAL_ERROR = -1, EVMC_REJECTED = -2, EVMC_OUT_OF_MEMORY = -3,
}
Expand description

The execution status code.

Successful execution is represented by ::EVMC_SUCCESS having value 0.

Positive values represent failures defined by VM specifications with generic ::EVMC_FAILURE code of value 1.

Status codes with negative values represent VM internal errors not provided by EVM specifications. These errors MUST not be passed back to the caller. They MAY be handled by the Client in predefined manner (see e.g. ::EVMC_REJECTED), otherwise internal errors are not recoverable. The generic representant of errors is ::EVMC_INTERNAL_ERROR but an EVM implementation MAY return negative status codes that are not defined in the EVMC documentation.

@note In case new status codes are needed, please create an issue or pull request in the EVMC repository (https://github.com/ethereum/evmc).

Variants§

§

EVMC_SUCCESS = 0

Execution finished with success.

§

EVMC_FAILURE = 1

Generic execution failure.

§

EVMC_REVERT = 2

Execution terminated with REVERT opcode.

In this case the amount of gas left MAY be non-zero and additional output data MAY be provided in ::evmc_result.

§

EVMC_OUT_OF_GAS = 3

The execution has run out of gas.

§

EVMC_INVALID_INSTRUCTION = 4

The designated INVALID instruction has been hit during execution.

The EIP-141 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-141.md) defines the instruction 0xfe as INVALID instruction to indicate execution abortion coming from high-level languages. This status code is reported in case this INVALID instruction has been encountered.

§

EVMC_UNDEFINED_INSTRUCTION = 5

An undefined instruction has been encountered.

§

EVMC_STACK_OVERFLOW = 6

The execution has attempted to put more items on the EVM stack than the specified limit.

§

EVMC_STACK_UNDERFLOW = 7

Execution of an opcode has required more items on the EVM stack.

§

EVMC_BAD_JUMP_DESTINATION = 8

Execution has violated the jump destination restrictions.

§

EVMC_INVALID_MEMORY_ACCESS = 9

Tried to read outside memory bounds.

An example is RETURNDATACOPY reading past the available buffer.

§

EVMC_CALL_DEPTH_EXCEEDED = 10

Call depth has exceeded the limit (if any)

§

EVMC_STATIC_MODE_VIOLATION = 11

Tried to execute an operation which is restricted in static mode.

§

EVMC_PRECOMPILE_FAILURE = 12

A call to a precompiled or system contract has ended with a failure.

An example: elliptic curve functions handed invalid EC points.

§

EVMC_CONTRACT_VALIDATION_FAILURE = 13

Contract validation has failed (e.g. due to EVM 1.5 jump validity, Casper’s purity checker or ewasm contract rules).

§

EVMC_ARGUMENT_OUT_OF_RANGE = 14

An argument to a state accessing method has a value outside of the accepted range of values.

§

EVMC_WASM_UNREACHABLE_INSTRUCTION = 15

A WebAssembly unreachable instruction has been hit during execution.

§

EVMC_WASM_TRAP = 16

A WebAssembly trap has been hit during execution. This can be for many reasons, including division by zero, validation errors, etc.

§

EVMC_INSUFFICIENT_BALANCE = 17

The caller does not have enough funds for value transfer.

§

EVMC_INTERNAL_ERROR = -1

EVM implementation generic internal error.

§

EVMC_REJECTED = -2

The execution of the given code and/or message has been rejected by the EVM implementation.

This error SHOULD be used to signal that the EVM is not able to or willing to execute the given code type or message. If an EVM returns the ::EVMC_REJECTED status code, the Client MAY try to execute it in other EVM implementation. For example, the Client tries running a code in the EVM 1.5. If the code is not supported there, the execution falls back to the EVM 1.0.

§

EVMC_OUT_OF_MEMORY = -3

The VM failed to allocate the amount of memory needed for execution.

Trait Implementations§

Source§

impl Clone for evmc_status_code

Source§

fn clone(&self) -> evmc_status_code

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for evmc_status_code

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for evmc_status_code

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for evmc_status_code

Source§

fn eq(&self, other: &evmc_status_code) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for evmc_status_code

Source§

impl Eq for evmc_status_code

Source§

impl StructuralPartialEq for evmc_status_code

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.