Enum evm_opcodes::shanghai::ShangHai

source ·
pub enum ShangHai {
Show 141 variants Data(u8), STOP, ADD, MUL, SUB, DIV, SDIV, MOD, SMOD, ADDMOD, MULMOD, EXP, SIGNEXTEND, LT, GT, SLT, SGT, EQ, ISZERO, AND, OR, XOR, NOT, BYTE, SHL, SHR, SAR, SHA3, ADDRESS, BALANCE, ORIGIN, CALLER, CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY, CODESIZE, CODECOPY, GASPRICE, EXTCODESIZE, EXTCODECOPY, RETURNDATASIZE, RETURNDATACOPY, BLOCKHASH, COINBASE, TIMESTAMP, NUMBER, DIFFICULTY, GASLIMIT, POP, MLOAD, MSTORE, MSTORE8, SLOAD, SSTORE, JUMP, JUMPI, PC, MSIZE, GAS, 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, LOG0, LOG1, LOG2, LOG3, LOG4, CREATE, CALL, CALLCODE, RETURN, DELEGATECALL, CREATE2, STATICCALL, REVERT, INVALID, SELFDESTRUCT,
}
Expand description

Ethereum virtual machine opcode.

Variants§

§

Data(u8)

No operation but provides a byte for serializing.

§

STOP

Halts execution.

§

ADD

Addition operation.

§

MUL

Multiplication operation.

§

SUB

Subtraction operation.

§

DIV

Integer division operation.

§

SDIV

Signed integer division operation (truncated).

§

MOD

Modulo remainder operation.

§

SMOD

Signed modulo remainder operation.

§

ADDMOD

Modulo addition operation.

§

MULMOD

Modulo multiplication operation.

§

EXP

Exponential operation.

§

SIGNEXTEND

Extend length of two’s complement signed integer.

§

LT

Less-than comparison.

§

GT

Greater-than comparison.

§

SLT

Signed less-than comparison.

§

SGT

Signed greater-than comparison.

§

EQ

Equality comparison.

§

ISZERO

Simple not operator.

§

AND

Bitwise AND operation.

§

OR

Bitwise OR operation.

§

XOR

Bitwise XOR operation.

§

NOT

Bitwise NOT operation.

§

BYTE

Retrieve single byte from word.

§

SHL

Left shift operation

§

SHR

Logical right shift operation

§

SAR

Arithmetic (signed) right shift operation

§

SHA3

Compute Keccak-256 hash.

§

ADDRESS

Get address of currently executing account.

§

BALANCE

Get balance of the given account.

§

ORIGIN

Get execution origination address.

§

CALLER

Get caller address.

§

CALLVALUE

Get deposited value by the instruction/transaction responsible for this execution.

§

CALLDATALOAD

Get input data of current environment.

§

CALLDATASIZE

Get size of input data in current environment.

§

CALLDATACOPY

Copy input data in current environment to memory.

§

CODESIZE

Get size of code running in current environment.

§

CODECOPY

Copy code running in current environment to memory.

§

GASPRICE

Get price of gas in current environment

§

EXTCODESIZE

Get size of an account’s code.

§

EXTCODECOPY

Copy an account’s code to memory.

§

RETURNDATASIZE

Get size of output data from the previous call from the current environment.

§

RETURNDATACOPY

Copy output data from the previous call to memory.

§

BLOCKHASH

Get the hash of one of the 256 most recent complete blocks.

§

COINBASE

Get the block’s beneficiary address.

§

TIMESTAMP

Get the block’s timestamp.

§

NUMBER

Get the block’s number.

§

DIFFICULTY

Get the block’s difficulty.

§

GASLIMIT

Get the block’s gas limit.

§

POP

Remove item from stack.

§

MLOAD

Load word from memory.

§

MSTORE

Save word to memory.

§

MSTORE8

Save byte to memory.

§

SLOAD

Load word from storage.

§

SSTORE

Save word to storage.

§

JUMP

Alter the program counter.

§

JUMPI

Conditionally alter the program counter.

§

PC

Get the value of the program counter prior to the increment corresponding to this instruction.

§

MSIZE

Get the size of active memory in bytes.

§

GAS

Get the amount of available gas, including the corresponding reduction the amount of available gas.

§

JUMPDEST

Mark a valid destination for jumps.

§

PUSH0

Place 0 byte item on stack.

§

PUSH1

Place 1 byte item on stack.

§

PUSH2

Place 2-byte item on stack.

§

PUSH3

Place 3-byte item on stack.

§

PUSH4

Place 4-byte item on stack.

§

PUSH5

Place 5-byte item on stack.

§

PUSH6

Place 6-byte item on stack.

§

PUSH7

Place 7-byte item on stack.

§

PUSH8

Place 8-byte item on stack.

§

PUSH9

Place 9-byte item on stack.

§

PUSH10

Place 10-byte item on stack.

§

PUSH11

Place 11-byte item on stack.

§

PUSH12

Place 12-byte item on stack.

§

PUSH13

Place 13-byte item on stack.

§

PUSH14

Place 14-byte item on stack.

§

PUSH15

Place 15-byte item on stack.

§

PUSH16

Place 16-byte item on stack.

§

PUSH17

Place 17-byte item on stack.

§

PUSH18

Place 18-byte item on stack.

§

PUSH19

Place 19-byte item on stack.

§

PUSH20

Place 20-byte item on stack.

§

PUSH21

Place 21-byte item on stack.

§

PUSH22

Place 22-byte item on stack.

§

PUSH23

Place 23-byte item on stack.

§

PUSH24

Place 24-byte item on stack.

§

PUSH25

Place 25-byte item on stack.

§

PUSH26

Place 26-byte item on stack.

§

PUSH27

Place 27-byte item on stack.

§

PUSH28

Place 28-byte item on stack.

§

PUSH29

Place 29-byte item on stack.

§

PUSH30

Place 30-byte item on stack.

§

PUSH31

Place 31-byte item on stack.

§

PUSH32

Place 32-byte (full word) item on stack.

§

DUP1

Duplicate 1st stack item.

§

DUP2

Duplicate 2nd stack item.

§

DUP3

Duplicate 3rd stack item.

§

DUP4

Duplicate 4th stack item.

§

DUP5

Duplicate 5th stack item.

§

DUP6

Duplicate 6th stack item.

§

DUP7

Duplicate 7th stack item.

§

DUP8

Duplicate 8th stack item.

§

DUP9

Duplicate 9th stack item.

§

DUP10

Duplicate 10th stack item.

§

DUP11

Duplicate 11th stack item.

§

DUP12

Duplicate 12th stack item.

§

DUP13

Duplicate 13th stack item.

§

DUP14

Duplicate 14th stack item.

§

DUP15

Duplicate 15th stack item.

§

DUP16

Duplicate 16th stack item.

§

SWAP1

Exchange 1st and 2nd stack items.

§

SWAP2

Exchange 1st and 3rd stack items.

§

SWAP3

Exchange 1st and 4th stack items.

§

SWAP4

Exchange 1st and 5th stack items.

§

SWAP5

Exchange 1st and 6th stack items.

§

SWAP6

Exchange 1st and 7th stack items.

§

SWAP7

Exchange 1st and 8th stack items.

§

SWAP8

Exchange 1st and 9th stack items.

§

SWAP9

Exchange 1st and 10th stack items.

§

SWAP10

Exchange 1st and 11th stack items.

§

SWAP11

Exchange 1st and 12th stack items.

§

SWAP12

Exchange 1st and 13th stack items.

§

SWAP13

Exchange 1st and 14th stack items.

§

SWAP14

Exchange 1st and 15th stack items.

§

SWAP15

Exchange 1st and 16th stack items.

§

SWAP16

Exchange 1st and 17th stack items.

§

LOG0

Append log record with no topics.

§

LOG1

Append log record with one topic.

§

LOG2

Append log record with two topics.

§

LOG3

Append log record with three topics.

§

LOG4

Append log record with four topics.

§

CREATE

Create a new account with associated

§

CALL

Message-call into an account.

§

CALLCODE

Message-call into this account with alternative account’s code.

§

RETURN

Halt execution returning output data.

§

DELEGATECALL

Message-call into this account with an alternative account’s code, but persisting into this account with an alternative account’s code, but persisting into this account’s storage and context.

§

CREATE2

Create a new account with associated code at a specified address.

§

STATICCALL

Static message-call into an account.

§

REVERT

Stop execution and revert state changes, without consuming all provided gas and providing a reason.

§

INVALID

Designated invalid instruction.

§

SELFDESTRUCT

Halt execution and register account for later deletion.

Trait Implementations§

source§

impl Clone for ShangHai

source§

fn clone(&self) -> ShangHai

Returns a copy 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 ShangHai

source§

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

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

impl From<ShangHai> for u8

source§

fn from(version: ShangHai) -> Self

Converts to this type from the input type.
source§

impl From<u8> for ShangHai

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl FromStr for ShangHai

source§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl OpCode for ShangHai

source§

fn group(&self) -> Group

The group of the OpCode.
source§

fn gas(&self) -> u16

The basic gas cost of the OpCode.
source§

fn since(&self) -> Upgrade

The OpCode is available since.
source§

fn stack_in(&self) -> u16

The stack input count.
source§

fn stack_out(&self) -> u16

The stack output count.
source§

impl Ord for ShangHai

source§

fn cmp(&self, other: &ShangHai) -> 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 + PartialOrd,

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

impl PartialEq for ShangHai

source§

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

source§

fn partial_cmp(&self, other: &ShangHai) -> 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 Copy for ShangHai

source§

impl Eq for ShangHai

source§

impl StructuralPartialEq for ShangHai

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.