evm_opcodes::cancun

Enum Cancun

Source
pub enum Cancun {
Show 150 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, KECCAK256, ADDRESS, BALANCE, ORIGIN, CALLER, CALLVALUE, CALLDATALOAD, CALLDATASIZE, CALLDATACOPY, CODESIZE, CODECOPY, GASPRICE, EXTCODESIZE, EXTCODECOPY, RETURNDATASIZE, RETURNDATACOPY, EXTCODEHASH, BLOCKHASH, COINBASE, TIMESTAMP, NUMBER, DIFFICULTY, GASLIMIT, CHAINID, SELFBALANCE, BASEFEE, BLOBHASH, BLOBBASEFEE, POP, MLOAD, MSTORE, MSTORE8, SLOAD, SSTORE, JUMP, JUMPI, PC, MSIZE, GAS, JUMPDEST, TLOAD, TSTORE, MCOPY, 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

§

KECCAK256

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.

§

EXTCODEHASH

Get hash of an account’s code.

§

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.

§

CHAINID

Get the chain ID.

§

SELFBALANCE

Get balance of currently executing account.

§

BASEFEE

Get the base fee.

§

BLOBHASH

Get versioned hash at index.

§

BLOBBASEFEE

Get the current blob base fee.

§

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.

§

MSIZE

Get the size of active memory in bytes.

§

GAS

Get the amount of available gas.

§

JUMPDEST

Mark a valid destination for jumps.

§

TLOAD

Load word from transient storage

§

TSTORE

Save word to transient storage.

§

MCOPY

copy memory areas

§

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 code.

§

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 with an alternative account’s code, persisting the current 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 gas and providing a reason.

§

INVALID

Designated invalid instruction.

§

SELFDESTRUCT

Halt execution and register account for later deletion.

Trait Implementations§

Source§

impl Clone for Cancun

Source§

fn clone(&self) -> Cancun

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 Cancun

Source§

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

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

impl From<Cancun> for u8

Source§

fn from(version: Cancun) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Cancun

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Cancun

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 Cancun

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 Cancun

Source§

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

Source§

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

Source§

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

Source§

impl Eq for Cancun

Source§

impl StructuralPartialEq for Cancun

Auto Trait Implementations§

§

impl Freeze for Cancun

§

impl RefUnwindSafe for Cancun

§

impl Send for Cancun

§

impl Sync for Cancun

§

impl Unpin for Cancun

§

impl UnwindSafe for Cancun

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 u8)

🔬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.