Skip to main content

OpCode

Enum OpCode 

Source
pub enum OpCode {
Show 147 variants STOP = 0, ADD = 1, MUL = 2, SUB = 3, DIV = 4, SDIV = 5, MOD = 6, SMOD = 7, ADDMOD = 8, MULMOD = 9, EXP = 10, SIGNEXTEND = 11, LT = 16, GT = 17, SLT = 18, SGT = 19, EQ = 20, ISZERO = 21, AND = 22, OR = 23, XOR = 24, NOT = 25, BYTE = 26, SHL = 27, SHR = 28, SAR = 29, SHA3 = 32, ADDRESS = 48, BALANCE = 49, ORIGIN = 50, CALLER = 51, CALLVALUE = 52, CALLDATALOAD = 53, CALLDATASIZE = 54, CALLDATACOPY = 55, CODESIZE = 56, CODECOPY = 57, GASPRICE = 58, EXTCODESIZE = 59, EXTCODECOPY = 60, RETURNDATASIZE = 61, RETURNDATACOPY = 62, EXTCODEHASH = 63, BLOCKHASH = 64, COINBASE = 65, TIMESTAMP = 66, NUMBER = 67, PREVRANDAO = 68, GASLIMIT = 69, CHAINID = 70, SELFBALANCE = 71, BASEFEE = 72, BLOBBASEFEE = 74, POP = 80, MLOAD = 81, MSTORE = 82, MSTORE8 = 83, SLOAD = 84, SSTORE = 85, JUMP = 86, JUMPI = 87, PC = 88, MSIZE = 89, GAS = 90, JUMPDEST = 91, TLOAD = 92, TSTORE = 93, MCOPY = 94, PUSH0 = 95, PUSH1 = 96, PUSH2 = 97, PUSH3 = 98, PUSH4 = 99, PUSH5 = 100, PUSH6 = 101, PUSH7 = 102, PUSH8 = 103, PUSH9 = 104, PUSH10 = 105, PUSH11 = 106, PUSH12 = 107, PUSH13 = 108, PUSH14 = 109, PUSH15 = 110, PUSH16 = 111, PUSH17 = 112, PUSH18 = 113, PUSH19 = 114, PUSH20 = 115, PUSH21 = 116, PUSH22 = 117, PUSH23 = 118, PUSH24 = 119, PUSH25 = 120, PUSH26 = 121, PUSH27 = 122, PUSH28 = 123, PUSH29 = 124, PUSH30 = 125, PUSH31 = 126, PUSH32 = 127, DUP1 = 128, DUP2 = 129, DUP3 = 130, DUP4 = 131, DUP5 = 132, DUP6 = 133, DUP7 = 134, DUP8 = 135, DUP9 = 136, DUP10 = 137, DUP11 = 138, DUP12 = 139, DUP13 = 140, DUP14 = 141, DUP15 = 142, DUP16 = 143, SWAP1 = 144, SWAP2 = 145, SWAP3 = 146, SWAP4 = 147, SWAP5 = 148, SWAP6 = 149, SWAP7 = 150, SWAP8 = 151, SWAP9 = 152, SWAP10 = 153, SWAP11 = 154, SWAP12 = 155, SWAP13 = 156, SWAP14 = 157, SWAP15 = 158, SWAP16 = 159, LOG0 = 160, LOG1 = 161, LOG2 = 162, LOG3 = 163, LOG4 = 164, CREATE = 240, CALL = 241, CALLCODE = 242, RETURN = 243, DELEGATECALL = 244, CREATE2 = 245, REVERT = 253, STATICCALL = 250, SELFDESTRUCT = 255,
}

Variants§

§

STOP = 0

§

ADD = 1

§

MUL = 2

§

SUB = 3

§

DIV = 4

§

SDIV = 5

§

MOD = 6

§

SMOD = 7

§

ADDMOD = 8

§

MULMOD = 9

§

EXP = 10

§

SIGNEXTEND = 11

§

LT = 16

§

GT = 17

§

SLT = 18

§

SGT = 19

§

EQ = 20

§

ISZERO = 21

§

AND = 22

§

OR = 23

§

XOR = 24

§

NOT = 25

§

BYTE = 26

§

SHL = 27

§

SHR = 28

§

SAR = 29

§

SHA3 = 32

§

ADDRESS = 48

§

BALANCE = 49

§

ORIGIN = 50

§

CALLER = 51

§

CALLVALUE = 52

§

CALLDATALOAD = 53

§

CALLDATASIZE = 54

§

CALLDATACOPY = 55

§

CODESIZE = 56

§

CODECOPY = 57

§

GASPRICE = 58

§

EXTCODESIZE = 59

§

EXTCODECOPY = 60

§

RETURNDATASIZE = 61

§

RETURNDATACOPY = 62

§

EXTCODEHASH = 63

§

BLOCKHASH = 64

§

COINBASE = 65

§

TIMESTAMP = 66

§

NUMBER = 67

§

PREVRANDAO = 68

§

GASLIMIT = 69

§

CHAINID = 70

§

SELFBALANCE = 71

§

BASEFEE = 72

§

BLOBBASEFEE = 74

§

POP = 80

§

MLOAD = 81

§

MSTORE = 82

§

MSTORE8 = 83

§

SLOAD = 84

§

SSTORE = 85

§

JUMP = 86

§

JUMPI = 87

§

PC = 88

§

MSIZE = 89

§

GAS = 90

§

JUMPDEST = 91

§

TLOAD = 92

§

TSTORE = 93

§

MCOPY = 94

§

PUSH0 = 95

§

PUSH1 = 96

§

PUSH2 = 97

§

PUSH3 = 98

§

PUSH4 = 99

§

PUSH5 = 100

§

PUSH6 = 101

§

PUSH7 = 102

§

PUSH8 = 103

§

PUSH9 = 104

§

PUSH10 = 105

§

PUSH11 = 106

§

PUSH12 = 107

§

PUSH13 = 108

§

PUSH14 = 109

§

PUSH15 = 110

§

PUSH16 = 111

§

PUSH17 = 112

§

PUSH18 = 113

§

PUSH19 = 114

§

PUSH20 = 115

§

PUSH21 = 116

§

PUSH22 = 117

§

PUSH23 = 118

§

PUSH24 = 119

§

PUSH25 = 120

§

PUSH26 = 121

§

PUSH27 = 122

§

PUSH28 = 123

§

PUSH29 = 124

§

PUSH30 = 125

§

PUSH31 = 126

§

PUSH32 = 127

§

DUP1 = 128

§

DUP2 = 129

§

DUP3 = 130

§

DUP4 = 131

§

DUP5 = 132

§

DUP6 = 133

§

DUP7 = 134

§

DUP8 = 135

§

DUP9 = 136

§

DUP10 = 137

§

DUP11 = 138

§

DUP12 = 139

§

DUP13 = 140

§

DUP14 = 141

§

DUP15 = 142

§

DUP16 = 143

§

SWAP1 = 144

§

SWAP2 = 145

§

SWAP3 = 146

§

SWAP4 = 147

§

SWAP5 = 148

§

SWAP6 = 149

§

SWAP7 = 150

§

SWAP8 = 151

§

SWAP9 = 152

§

SWAP10 = 153

§

SWAP11 = 154

§

SWAP12 = 155

§

SWAP13 = 156

§

SWAP14 = 157

§

SWAP15 = 158

§

SWAP16 = 159

§

LOG0 = 160

§

LOG1 = 161

§

LOG2 = 162

§

LOG3 = 163

§

LOG4 = 164

§

CREATE = 240

§

CALL = 241

§

CALLCODE = 242

§

RETURN = 243

§

DELEGATECALL = 244

§

CREATE2 = 245

§

REVERT = 253

§

STATICCALL = 250

§

SELFDESTRUCT = 255

Implementations§

Source§

impl OpCode

Source

pub fn from_u8(n: u8) -> Option<OpCode>

Source

pub fn gas_price_tier(&self) -> GasPriceTier

Source

pub fn stack_require(&self) -> u64

Source

pub fn stack_returns(&self) -> u64

Source

pub fn state_changes(&self) -> bool

Trait Implementations§

Source§

impl Clone for OpCode

Source§

fn clone(&self) -> OpCode

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 OpCode

Source§

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

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

impl Display for OpCode

Source§

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

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

impl Ord for OpCode

Source§

fn cmp(&self, other: &OpCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for OpCode

Source§

fn eq(&self, other: &OpCode) -> 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 PartialOrd for OpCode

Source§

fn partial_cmp(&self, other: &OpCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for OpCode

Source§

impl StructuralPartialEq for OpCode

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V