Enum eth_types::evm_types::opcode_ids::OpcodeId
source · pub enum OpcodeId {
Show 146 variants
STOP,
ADD,
MUL,
SUB,
DIV,
SDIV,
MOD,
SMOD,
ADDMOD,
MULMOD,
EXP,
SIGNEXTEND,
LT,
GT,
SLT,
SGT,
EQ,
ISZERO,
AND,
OR,
XOR,
NOT,
BYTE,
CALLDATALOAD,
CALLDATASIZE,
CALLDATACOPY,
CODESIZE,
CODECOPY,
SHL,
SHR,
SAR,
POP,
MLOAD,
MSTORE,
MSTORE8,
JUMP,
JUMPI,
PC,
MSIZE,
JUMPDEST,
PUSH0,
PUSH1,
PUSH2,
PUSH3,
PUSH4,
PUSH5,
PUSH6,
PUSH7,
PUSH8,
PUSH9,
PUSH10,
PUSH11,
PUSH12,
PUSH13,
PUSH14,
PUSH15,
PUSH16,
PUSH17,
PUSH18,
PUSH19,
PUSH20,
PUSH21,
PUSH22,
PUSH23,
PUSH24,
PUSH25,
PUSH26,
PUSH27,
PUSH28,
PUSH29,
PUSH30,
PUSH31,
PUSH32,
DUP1,
DUP2,
DUP3,
DUP4,
DUP5,
DUP6,
DUP7,
DUP8,
DUP9,
DUP10,
DUP11,
DUP12,
DUP13,
DUP14,
DUP15,
DUP16,
SWAP1,
SWAP2,
SWAP3,
SWAP4,
SWAP5,
SWAP6,
SWAP7,
SWAP8,
SWAP9,
SWAP10,
SWAP11,
SWAP12,
SWAP13,
SWAP14,
SWAP15,
SWAP16,
RETURN,
REVERT,
INVALID(u8),
SHA3,
ADDRESS,
BALANCE,
ORIGIN,
CALLER,
CALLVALUE,
GASPRICE,
EXTCODESIZE,
EXTCODECOPY,
EXTCODEHASH,
RETURNDATASIZE,
RETURNDATACOPY,
BLOCKHASH,
COINBASE,
TIMESTAMP,
NUMBER,
DIFFICULTY,
GASLIMIT,
CHAINID,
SELFBALANCE,
BASEFEE,
SLOAD,
SSTORE,
GAS,
TLOAD,
TSTORE,
LOG0,
LOG1,
LOG2,
LOG3,
LOG4,
CREATE,
CREATE2,
CALL,
CALLCODE,
DELEGATECALL,
STATICCALL,
SELFDESTRUCT,
}
Expand description
Opcode enum. One-to-one corresponding to an u8
value.
Variants§
STOP
STOP
ADD
ADD
MUL
MUL
SUB
SUB
DIV
DIV
SDIV
SDIV
MOD
MOD
SMOD
SMOD
ADDMOD
ADDMOD
MULMOD
MULMOD
EXP
EXP
SIGNEXTEND
SIGNEXTEND
LT
LT
GT
GT
SLT
SLT
SGT
SGT
EQ
EQ
ISZERO
ISZERO
AND
AND
OR
OR
XOR
XOR
NOT
NOT
BYTE
BYTE
CALLDATALOAD
CALLDATALOAD
CALLDATASIZE
CALLDATASIZE
CALLDATACOPY
CALLDATACOPY
CODESIZE
CODESIZE
CODECOPY
CODECOPY
SHL
SHL
SHR
SHR
SAR
SAR
POP
POP
MLOAD
MLOAD
MSTORE
MSTORE
MSTORE8
MSTORE8
JUMP
JUMP
JUMPI
JUMPI
PC
PC
MSIZE
MSIZE
JUMPDEST
JUMPDEST
PUSH0
PUSH0
PUSH1
PUSH1
PUSH2
PUSH2
PUSH3
PUSH3
PUSH4
PUSH4
PUSH5
PUSH5
PUSH6
PUSH6
PUSH7
PUSH7
PUSH8
PUSH8
PUSH9
PUSH9
PUSH10
PUSH10
PUSH11
PUSH11
PUSH12
PUSH12
PUSH13
PUSH13
PUSH14
PUSH14
PUSH15
PUSH15
PUSH16
PUSH16
PUSH17
PUSH17
PUSH18
PUSH18
PUSH19
PUSH19
PUSH20
PUSH20
PUSH21
PUSH21
PUSH22
PUSH22
PUSH23
PUSH23
PUSH24
PUSH24
PUSH25
PUSH25
PUSH26
PUSH26
PUSH27
PUSH27
PUSH28
PUSH28
PUSH29
PUSH29
PUSH30
PUSH30
PUSH31
PUSH31
PUSH32
PUSH32
DUP1
DUP1
DUP2
DUP2
DUP3
DUP3
DUP4
DUP4
DUP5
DUP5
DUP6
DUP6
DUP7
DUP7
DUP8
DUP8
DUP9
DUP9
DUP10
DUP10
DUP11
DUP11
DUP12
DUP12
DUP13
DUP13
DUP14
DUP14
DUP15
DUP15
DUP16
DUP16
SWAP1
SWAP1
SWAP2
SWAP2
SWAP3
SWAP3
SWAP4
SWAP4
SWAP5
SWAP5
SWAP6
SWAP6
SWAP7
SWAP7
SWAP8
SWAP8
SWAP9
SWAP9
SWAP10
SWAP10
SWAP11
SWAP11
SWAP12
SWAP12
SWAP13
SWAP13
SWAP14
SWAP14
SWAP15
SWAP15
SWAP16
SWAP16
RETURN
RETURN
REVERT
REVERT
INVALID(u8)
Invalid opcode
SHA3
SHA3
ADDRESS
ADDRESS
BALANCE
BALANCE
ORIGIN
ORIGIN
CALLER
CALLER
CALLVALUE
CALLVALUE
GASPRICE
GASPRICE
EXTCODESIZE
EXTCODESIZE
EXTCODECOPY
EXTCODECOPY
EXTCODEHASH
EXTCODEHASH
RETURNDATASIZE
RETURNDATASIZE
RETURNDATACOPY
RETURNDATACOPY
BLOCKHASH
BLOCKHASH
COINBASE
COINBASE
TIMESTAMP
TIMESTAMP
NUMBER
NUMBER
DIFFICULTY
DIFFICULTY
GASLIMIT
GASLIMIT
CHAINID
CHAINID
SELFBALANCE
SELFBALANCE
BASEFEE
BASEFEE
SLOAD
SLOAD
SSTORE
SSTORE
GAS
GAS
TLOAD
TLOAD
TSTORE
TSTORE
LOG0
LOG0
LOG1
LOG1
LOG2
LOG2
LOG3
LOG3
LOG4
LOG4
CREATE
CREATE
CREATE2
CREATE2
CALL
CALL
CALLCODE
CALLCODE
DELEGATECALL
DELEGATECALL
STATICCALL
STATICCALL
SELFDESTRUCT
SELFDESTRUCT
Implementations§
source§impl OpcodeId
impl OpcodeId
sourcepub fn is_push_with_data(&self) -> bool
pub fn is_push_with_data(&self) -> bool
Returns true
if the OpcodeId
is a PUSH1
.. PUSH32
(excluding PUSH0
).
sourcepub fn is_call_or_create(&self) -> bool
pub fn is_call_or_create(&self) -> bool
Returns true
if the OpcodeId
is a CALL
or CREATE
related .
source§impl OpcodeId
impl OpcodeId
sourcepub const fn constant_gas_cost(&self) -> u64
pub const fn constant_gas_cost(&self) -> u64
Returns the constant gas cost of OpcodeId
sourcepub fn invalid_stack_ptrs(&self) -> Vec<u32>
pub fn invalid_stack_ptrs(&self) -> Vec<u32>
Returns invalid stack pointers of OpcodeId
sourcepub const fn has_memory_access(&self) -> bool
pub const fn has_memory_access(&self) -> bool
Returns true
if the OpcodeId
has memory access
sourcepub fn data_len(&self) -> usize
pub fn data_len(&self) -> usize
Returns number of bytes used by immediate data. This is > 0 only for
PUSH1
.. PUSH32
opcodes.
sourcepub fn valid_opcodes() -> Vec<Self>
pub fn valid_opcodes() -> Vec<Self>
Returns the all valid opcodes.
sourcepub fn invalid_opcodes() -> Vec<Self>
pub fn invalid_opcodes() -> Vec<Self>
Returns the all invalid opcodes.
Trait Implementations§
source§impl<'de> Deserialize<'de> for OpcodeId
impl<'de> Deserialize<'de> for OpcodeId
source§fn deserialize<D>(deserializer: D) -> Result<OpcodeId, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<OpcodeId, D::Error>where
D: Deserializer<'de>,
source§impl IntoEnumIterator for OpcodeId
impl IntoEnumIterator for OpcodeId
type Iterator = OpcodeIdIter
fn iter() -> OpcodeIdIter ⓘ
source§impl PartialEq for OpcodeId
impl PartialEq for OpcodeId
impl Copy for OpcodeId
impl Eq for OpcodeId
impl StructuralPartialEq for OpcodeId
Auto Trait Implementations§
impl RefUnwindSafe for OpcodeId
impl Send for OpcodeId
impl Sync for OpcodeId
impl Unpin for OpcodeId
impl UnwindSafe for OpcodeId
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.