Enum evm::Instruction [−][src]
#[repr(u8)]pub enum Instruction { 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, 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, REVERT, STATICCALL, SUICIDE, }
Virtual machine bytecode instruction.
Variants
STOPhalts execution
ADDaddition operation
MULmulitplication operation
SUBsubtraction operation
DIVinteger division operation
SDIVsigned integer division operation
MODmodulo remainder operation
SMODsigned modulo remainder operation
ADDMODunsigned modular addition
MULMODunsigned modular multiplication
EXPexponential operation
SIGNEXTENDextend length of signed integer
LTless-than comparision
GTgreater-than comparision
SLTsigned less-than comparision
SGTsigned greater-than comparision
EQequality comparision
ISZEROsimple not operator
ANDbitwise AND operation
ORbitwise OR operation
XORbitwise XOR operation
NOTbitwise NOT opertation
BYTEretrieve single byte from word
SHLshift left operation
SHRlogical shift right operation
SARarithmetic shift right operation
SHA3compute SHA3-256 hash
ADDRESSget address of currently executing account
BALANCEget balance of the given account
ORIGINget execution origination address
CALLERget caller address
CALLVALUEget deposited value by the instruction/transaction responsible for this execution
CALLDATALOADget input data of current environment
CALLDATASIZEget size of input data in current environment
CALLDATACOPYcopy input data in current environment to memory
CODESIZEget size of code running in current environment
CODECOPYcopy code running in current environment to memory
GASPRICEget price of gas in current environment
EXTCODESIZEget external code size (from another contract)
EXTCODECOPYcopy external code (from another contract)
RETURNDATASIZEget the size of the return data buffer for the last call
RETURNDATACOPYcopy return data buffer to memory
BLOCKHASHget hash of most recent complete block
COINBASEget the block's coinbase address
TIMESTAMPget the block's timestamp
NUMBERget the block's number
DIFFICULTYget the block's difficulty
GASLIMITget the block's gas limit
POPremove item from stack
MLOADload word from memory
MSTOREsave word to memory
MSTORE8save byte to memory
SLOADload word from storage
SSTOREsave word to storage
JUMPalter the program counter
JUMPIconditionally alter the program counter
PCget the program counter
MSIZEget the size of active memory
GASget the amount of available gas
JUMPDESTset a potential jump destination
PUSH1place 1 byte item on stack
PUSH2place 2 byte item on stack
PUSH3place 3 byte item on stack
PUSH4place 4 byte item on stack
PUSH5place 5 byte item on stack
PUSH6place 6 byte item on stack
PUSH7place 7 byte item on stack
PUSH8place 8 byte item on stack
PUSH9place 9 byte item on stack
PUSH10place 10 byte item on stack
PUSH11place 11 byte item on stack
PUSH12place 12 byte item on stack
PUSH13place 13 byte item on stack
PUSH14place 14 byte item on stack
PUSH15place 15 byte item on stack
PUSH16place 16 byte item on stack
PUSH17place 17 byte item on stack
PUSH18place 18 byte item on stack
PUSH19place 19 byte item on stack
PUSH20place 20 byte item on stack
PUSH21place 21 byte item on stack
PUSH22place 22 byte item on stack
PUSH23place 23 byte item on stack
PUSH24place 24 byte item on stack
PUSH25place 25 byte item on stack
PUSH26place 26 byte item on stack
PUSH27place 27 byte item on stack
PUSH28place 28 byte item on stack
PUSH29place 29 byte item on stack
PUSH30place 30 byte item on stack
PUSH31place 31 byte item on stack
PUSH32place 32 byte item on stack
DUP1copies the highest item in the stack to the top of the stack
DUP2copies the second highest item in the stack to the top of the stack
DUP3copies the third highest item in the stack to the top of the stack
DUP4copies the 4th highest item in the stack to the top of the stack
DUP5copies the 5th highest item in the stack to the top of the stack
DUP6copies the 6th highest item in the stack to the top of the stack
DUP7copies the 7th highest item in the stack to the top of the stack
DUP8copies the 8th highest item in the stack to the top of the stack
DUP9copies the 9th highest item in the stack to the top of the stack
DUP10copies the 10th highest item in the stack to the top of the stack
DUP11copies the 11th highest item in the stack to the top of the stack
DUP12copies the 12th highest item in the stack to the top of the stack
DUP13copies the 13th highest item in the stack to the top of the stack
DUP14copies the 14th highest item in the stack to the top of the stack
DUP15copies the 15th highest item in the stack to the top of the stack
DUP16copies the 16th highest item in the stack to the top of the stack
SWAP1swaps the highest and second highest value on the stack
SWAP2swaps the highest and third highest value on the stack
SWAP3swaps the highest and 4th highest value on the stack
SWAP4swaps the highest and 5th highest value on the stack
SWAP5swaps the highest and 6th highest value on the stack
SWAP6swaps the highest and 7th highest value on the stack
SWAP7swaps the highest and 8th highest value on the stack
SWAP8swaps the highest and 9th highest value on the stack
SWAP9swaps the highest and 10th highest value on the stack
SWAP10swaps the highest and 11th highest value on the stack
SWAP11swaps the highest and 12th highest value on the stack
SWAP12swaps the highest and 13th highest value on the stack
SWAP13swaps the highest and 14th highest value on the stack
SWAP14swaps the highest and 15th highest value on the stack
SWAP15swaps the highest and 16th highest value on the stack
SWAP16swaps the highest and 17th highest value on the stack
LOG0Makes a log entry, no topics.
LOG1Makes a log entry, 1 topic.
LOG2Makes a log entry, 2 topics.
LOG3Makes a log entry, 3 topics.
LOG4Makes a log entry, 4 topics.
CREATEcreate a new account with associated code
CALLmessage-call into an account
CALLCODEmessage-call with another account's code only
RETURNhalt execution returning output data
DELEGATECALLlike CALLCODE but keeps caller's value and sender
CREATE2create a new account and set creation address to sha3(sender + sha3(init code)) % 2**160
REVERTstop execution and revert state changes. Return output data.
STATICCALLlike CALL but it does not take value, nor modify the state
SUICIDEhalt execution and register account for later deletion
Methods
impl Instruction[src]
impl Instructionimpl Instruction[src]
impl Instructionpub fn is_push(&self) -> bool[src]
pub fn is_push(&self) -> boolReturns true if given instruction is PUSHN instruction.
pub fn push_bytes(&self) -> Option<usize>[src]
pub fn push_bytes(&self) -> Option<usize>Returns number of bytes to read for PUSHN instruction
PUSH1 -> 1
pub fn dup_position(&self) -> Option<usize>[src]
pub fn dup_position(&self) -> Option<usize>Returns stack position of item to duplicate DUP1 -> 0
pub fn swap_position(&self) -> Option<usize>[src]
pub fn swap_position(&self) -> Option<usize>Returns stack position of item to SWAP top with SWAP1 -> 1
pub fn log_topics(&self) -> Option<usize>[src]
pub fn log_topics(&self) -> Option<usize>Returns number of topics to take from stack LOG0 -> 0
pub fn info(&self) -> &'static InstructionInfo[src]
pub fn info(&self) -> &'static InstructionInfoReturns the instruction info.
Trait Implementations
impl Eq for Instruction[src]
impl Eq for Instructionimpl PartialEq for Instruction[src]
impl PartialEq for Instructionfn eq(&self, other: &Instruction) -> bool[src]
fn eq(&self, other: &Instruction) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Ord for Instruction[src]
impl Ord for Instructionfn cmp(&self, other: &Instruction) -> Ordering[src]
fn cmp(&self, other: &Instruction) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialOrd for Instruction[src]
impl PartialOrd for Instructionfn partial_cmp(&self, other: &Instruction) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Instruction) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0[src]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Clone for Instruction[src]
impl Clone for Instructionfn clone(&self) -> Instruction[src]
fn clone(&self) -> InstructionReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for Instruction[src]
impl Copy for Instructionimpl Debug for Instruction[src]
impl Debug for InstructionAuto Trait Implementations
impl Send for Instruction
impl Send for Instructionimpl Sync for Instruction
impl Sync for Instruction