evm v0.1.1 EVM.Instruction.Impl

Reference implementation for all opcodes in the Ethereum VM.

Link to this section Summary

Functions

Addition operation

Modulo addition operation

Get address of currently executing account

Bitwise AND operation

Get balance of the given account

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

Retrieve single byte from word

Message-call into an account.,

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

Copy input data in current environment to memory

Get input data of current environment

Get size of input data in current environment

Get caller address

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

Copy code running in current environment to memory

Get size of code running in current environment

Get the block’s beneficiary address

Create a new account with associated code

Message-call into this account with an alternative account’s code, but persisting the current values for sender and value

Get the block’s difficulty

Integer division operation

Duplicate 1st stack item

Duplicate 10th stack item

Duplicate 11th stack item

Duplicate 12th stack item

Duplicate 13th stack item

Duplicate 14th stack item

Duplicate 15th stack item

Duplicate 16th stack item

Duplicate 2nd stack item

Duplicate 3rd stack item

Duplicate 4th stack item

Duplicate 5th stack item

Duplicate 6th stack item

Duplicate 7th stack item

Duplicate 8th stack item

Duplicate 9th stack item

Equality comparision

Exponential operation

Copy an account’s code to memory

Get size of an account’s code

Get the amount of available gas, including the corresponding reduction for the cost of this instruction

Get the block’s gas limit

Get price of gas in current environment

Greater-than comparision

Simple not operator

Alter the program counter

Mark a valid destination for jumps

Conditionally alter the program counter

Append log record with no topics

Append log record with one topic

Append log record with two topics

Append log record with three topics

Append log record with four topics

Less-than comparision

Load word from memory

Modulo remainder operation

Get the size of active memory in bytes

Save word to memory

Save byte to memory

Multiplication operation

Modulo multiplication operation

Bitwise NOT operation

Get the block’s number

Bitwise OR operation

Get execution origination address

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

Remove item from stack

Place n-byte item on stack

Halt execution returning output data,

Signed integer division operation (truncated)

Signed greater-than comparision

Compute Keccak-256 hash

Extend length of two’s complement signed integer

Load word from storage

Signed less-than comparision

Signed modulo remainder operation

Save word to storage

Halts execution

Subtraction operation

Halt execution and register account for later deletion

Exchange 1st and 2nd stack items

Exchange 10th and 11th stack items

Exchange 11th and 12th stack items

Exchange 12th and 13th stack items

Exchange 13th and 14th stack items

Exchange 14th and 15th stack items

Exchange 15th and 16th stack items

Exchange 16th and 17th stack items

Exchange 2nd and 3rd stack items

Exchange 3rd and 4th stack items

Exchange 4th and 5th stack items

Exchange 5th and 6th stack items

Exchange 6th and 7th stack items

Exchange 7th and 8th stack items

Exchange 8th and 9th stack items

Exchange 9th and 10th stack items

Get the block’s timestamp

Bitwise XOR operation

Link to this section Types

Link to this type op_result()
op_result ::
  :noop |
  :unimplemented |
  vm_map |
  EVM.MachineState.t
Link to this type stack_args()
stack_args() :: [EVM.val]
Link to this type vm_map()
vm_map() :: %{optional(:state) => MerklePatriciaTree.Trie.t, optional(:stack) => EVM.Stack.t, optional(:machine_state) => EVM.MachineState.t, optional(:sub_state) => EVM.SubState.t, optional(:exec_env) => EVM.ExecEnv.t}

Link to this section Functions

Addition operation.

Takes an instruction, stack arguments and the current state, and returns an updated state.

The function expects the arguments for the instruction have already been popped off the stack.

Examples

iex> EVM.Instruction.Impl.add([1, 2], %{stack: []})
%{stack: [3]}

iex> EVM.Instruction.Impl.add([-1, -5], %{stack: []})
%{stack: [-6]}

iex> EVM.Instruction.Impl.add([0, 0], %{stack: []})
%{stack: [0]}

iex> EVM.Instruction.Impl.add([EVM.max_int() - 2, 1], %{stack: []})
%{stack: [EVM.max_int() - 1]}

iex> EVM.Instruction.Impl.add([EVM.max_int() - 2, 5], %{stack: []})
%{stack: [3]}

iex> EVM.Instruction.Impl.add([EVM.max_int() + 2, EVM.max_int() + 2], %{stack: []})
%{stack: [4]}
Link to this function addmod(args, map)

Modulo addition operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.addmod([], %{stack: []})
:unimplemented
Link to this function address(args, map)
address(stack_args, vm_map) :: op_result

Get address of currently executing account.

Examples

iex> EVM.Instruction.Impl.address([], %{stack: [], exec_env: %EVM.ExecEnv{address: <<01, 00>>}})
%{stack: [0x100]}

Bitwise AND operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.and_([], %{stack: []})
:unimplemented
Link to this function balance(args, map)
balance(stack_args, vm_map) :: op_result

Get balance of the given account.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.balance([], %{stack: []})
:unimplemented
Link to this function blockhash(args, map)
blockhash(stack_args, vm_map) :: op_result

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

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.blockhash([], %{stack: []})
:unimplemented

Retrieve single byte from word.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.byte([], %{stack: []})
:unimplemented

Message-call into an account.,

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.call([], %{stack: []})
:unimplemented
Link to this function callcode(args, map)
callcode(stack_args, vm_map) :: op_result

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

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.callcode([], %{stack: []})
:unimplemented
Link to this function calldatacopy(args, map)
calldatacopy(stack_args, vm_map) :: op_result

Copy input data in current environment to memory.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.calldatacopy([], %{stack: []})
:unimplemented
Link to this function calldataload(args, map)
calldataload(stack_args, vm_map) :: op_result

Get input data of current environment.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.calldataload([], %{stack: []})
:unimplemented
Link to this function calldatasize(args, map)
calldatasize(stack_args, vm_map) :: op_result

Get size of input data in current environment.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.calldatasize([], %{stack: []})
:unimplemented
Link to this function caller(args, map)

Get caller address.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.caller([], %{stack: []})
:unimplemented
Link to this function callvalue(args, map)
callvalue(stack_args, vm_map) :: op_result

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

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.callvalue([], %{stack: []})
:unimplemented
Link to this function codecopy(args, map)
codecopy(stack_args, vm_map) :: op_result

Copy code running in current environment to memory.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.codecopy([], %{stack: []})
:unimplemented
Link to this function codesize(args, map)
codesize(stack_args, vm_map) :: op_result

Get size of code running in current environment.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.codesize([], %{stack: []})
:unimplemented
Link to this function coinbase(args, map)
coinbase(stack_args, vm_map) :: op_result

Get the block’s beneficiary address

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.coinbase([], %{stack: []})
:unimplemented
Link to this function create(args, map)

Create a new account with associated code.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.create([], %{stack: []})
:unimplemented
Link to this function delegatecall(args, map)
delegatecall(stack_args, vm_map) :: op_result

Message-call into this account with an alternative account’s code, but persisting the current values for sender and value.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.delegatecall([], %{stack: []})
:unimplemented
Link to this function difficulty(args, map)
difficulty(stack_args, vm_map) :: op_result

Get the block’s difficulty.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.difficulty([], %{stack: []})
:unimplemented

Integer division operation.

Examples

iex> EVM.Instruction.Impl.div([5, 2], %{stack: []})
%{stack: [2]}

iex> EVM.Instruction.Impl.div([5, -2], %{stack: []})
%{stack: [-3]}

iex> EVM.Instruction.Impl.div([10, 2], %{stack: []})
%{stack: [5]}

iex> EVM.Instruction.Impl.div([10, 0], %{stack: []})
%{stack: [0]}

iex> EVM.Instruction.Impl.div([EVM.max_int() + 6, 1], %{stack: []})
%{stack: [6]}

Duplicate 1st stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup1([], %{stack: []})
:unimplemented

Duplicate 10th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup10([], %{stack: []})
:unimplemented

Duplicate 11th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup11([], %{stack: []})
:unimplemented

Duplicate 12th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup12([], %{stack: []})
:unimplemented

Duplicate 13th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup13([], %{stack: []})
:unimplemented

Duplicate 14th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup14([], %{stack: []})
:unimplemented

Duplicate 15th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup15([], %{stack: []})
:unimplemented

Duplicate 16th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup16([], %{stack: []})
:unimplemented

Duplicate 2nd stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup2([], %{stack: []})
:unimplemented

Duplicate 3rd stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup3([], %{stack: []})
:unimplemented

Duplicate 4th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup4([], %{stack: []})
:unimplemented

Duplicate 5th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup5([], %{stack: []})
:unimplemented

Duplicate 6th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup6([], %{stack: []})
:unimplemented

Duplicate 7th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup7([], %{stack: []})
:unimplemented

Duplicate 8th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup8([], %{stack: []})
:unimplemented

Duplicate 9th stack item.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.dup9([], %{stack: []})
:unimplemented

Equality comparision.

Examples

iex> EVM.Instruction.Impl.eq([55, 1], %{stack: []})
%{stack: [0]}

iex> EVM.Instruction.Impl.eq([55, 55], %{stack: []})
%{stack: [1]}

iex> EVM.Instruction.Impl.eq([0, 0], %{stack: []})
%{stack: [1]}

Exponential operation

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.exp([2, 3], %{stack: []})
%{stack: [8]}

iex> EVM.Instruction.Impl.exp([-2, 7], %{stack: []})
%{stack: [-128]}

iex> EVM.Instruction.Impl.exp([2, 257], %{stack: []})
%{stack: [0]}
Link to this function extcodecopy(args, map)
extcodecopy(stack_args, vm_map) :: op_result

Copy an account’s code to memory.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.extcodecopy([], %{stack: []})
:unimplemented
Link to this function extcodesize(args, map)
extcodesize(stack_args, vm_map) :: op_result

Get size of an account’s code.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.extcodesize([], %{stack: []})
:unimplemented

Get the amount of available gas, including the corresponding reduction for the cost of this instruction.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.gas([], %{stack: []})
:unimplemented
Link to this function gaslimit(args, map)
gaslimit(stack_args, vm_map) :: op_result

Get the block’s gas limit.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.gaslimit([], %{stack: []})
:unimplemented
Link to this function gasprice(args, map)
gasprice(stack_args, vm_map) :: op_result

Get price of gas in current environment.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.gasprice([], %{stack: []})
:unimplemented

Greater-than comparision.

Examples

iex> EVM.Instruction.Impl.gt([55, 66], %{stack: []})
%{stack: [0]}

iex> EVM.Instruction.Impl.gt([66, 55], %{stack: []})
%{stack: [1]}

iex> EVM.Instruction.Impl.gt([55, 55], %{stack: []})
%{stack: [0]}
Link to this function iszero(args, map)

Simple not operator.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.iszero([], %{stack: []})
:unimplemented

Alter the program counter.

This is a no-op as it’s handled elsewhere in the VM.

Examples

iex> EVM.Instruction.Impl.jump([], %{stack: []})
:noop
Link to this function jumpdest(args, map)
jumpdest(stack_args, vm_map) :: op_result

Mark a valid destination for jumps.

This is a no-op.

Examples

iex> EVM.Instruction.Impl.jumpdest([], %{stack: []})
:noop

Conditionally alter the program counter.

This is a no-op as it’s handled elsewhere in the VM.

Examples

iex> EVM.Instruction.Impl.jumpi([], %{stack: []})
:noop

Append log record with no topics.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.log0([], %{stack: []})
:unimplemented

Append log record with one topic.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.log1([], %{stack: []})
:unimplemented

Append log record with two topics.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.log2([], %{stack: []})
:unimplemented

Append log record with three topics.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.log3([], %{stack: []})
:unimplemented

Append log record with four topics.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.log4([], %{stack: []})
:unimplemented

Less-than comparision.

Examples

iex> EVM.Instruction.Impl.lt([55, 66], %{stack: []})
%{stack: [1]}

iex> EVM.Instruction.Impl.lt([66, 55], %{stack: []})
%{stack: [0]}

iex> EVM.Instruction.Impl.lt([55, 55], %{stack: []})
%{stack: [0]}

Load word from memory

Examples

iex> EVM.Instruction.Impl.mload([0], %{machine_state: %EVM.MachineState{stack: [1], memory: <<0x55::256, 0xff>>}})
%{machine_state: %EVM.MachineState{stack: [0x55, 1], memory: <<0x55::256, 0xff>>, active_words: 1}}

iex> EVM.Instruction.Impl.mload([1], %{machine_state: %EVM.MachineState{stack: [], memory: <<0x55::256, 0xff>>}})
%{machine_state: %EVM.MachineState{stack: [22015], memory: <<0x55::256, 0xff>>, active_words: 2}}

# TODO: Add a test for overflow, etc.
# TODO: Handle sign?

Modulo remainder operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.mod([], %{stack: []})
:unimplemented

Get the size of active memory in bytes

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.msize([], %{stack: []})
:unimplemented
Link to this function mstore(list, map)

Save word to memory.

Examples

iex> EVM.Instruction.Impl.mstore([0, 0x55], %{machine_state: %EVM.MachineState{stack: [], memory: <<>>}})
%{machine_state: %EVM.MachineState{stack: [], memory: <<0x55::256>>, active_words: 1}}

iex> EVM.Instruction.Impl.mstore([1, 0x55], %{machine_state: %EVM.MachineState{stack: [], memory: <<>>}})
%{machine_state: %EVM.MachineState{stack: [], memory: <<0, 0x55::256>>, active_words: 2}}

# TODO: Add a test for overflow, etc.
# TODO: Handle sign?
Link to this function mstore8(args, map)
mstore8(stack_args, vm_map) :: op_result

Save byte to memory.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.mstore8([], %{stack: []})
:unimplemented

Multiplication operation.

Examples

iex> EVM.Instruction.Impl.mul([5, 2], %{stack: []})
%{stack: [10]}

iex> EVM.Instruction.Impl.mul([-1, 5], %{stack: []})
%{stack: [-5]}

iex> EVM.Instruction.Impl.mul([EVM.max_int() + 1, 5], %{stack: []})
%{stack: [5]}
Link to this function mulmod(args, map)

Modulo multiplication operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.mulmod([], %{stack: []})
:unimplemented

Bitwise NOT operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.not_([], %{stack: []})
:unimplemented
Link to this function number(args, map)

Get the block’s number.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.number([], %{stack: []})
:unimplemented

Bitwise OR operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.or_([], %{stack: []})
:unimplemented
Link to this function origin(args, map)

Get execution origination address.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.origin([], %{stack: []})
:unimplemented

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

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.pc([], %{stack: []})
:unimplemented

Remove item from stack.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.pop([55], %{stack: []})
:noop
Link to this function push_n(n, list, map)
push_n(integer, stack_args, vm_map) :: op_result

Place n-byte item on stack

Examples

iex> EVM.Instruction.Impl.push_n(1, [], %{machine_state: %EVM.MachineState{stack: [], pc: 1}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x12], pc: 1}}

iex> EVM.Instruction.Impl.push_n(1, [], %{machine_state: %EVM.MachineState{stack: [], pc: 2}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x13], pc: 2}}

iex> EVM.Instruction.Impl.push_n(1, [], %{machine_state: %EVM.MachineState{stack: [], pc: 3}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x00], pc: 3}}

iex> EVM.Instruction.Impl.push_n(1, [], %{machine_state: %EVM.MachineState{stack: [], pc: 4}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x00], pc: 4}}

iex> EVM.Instruction.Impl.push_n(1, [], %{machine_state: %EVM.MachineState{stack: [], pc: 100}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x00], pc: 100}}

iex> EVM.Instruction.Impl.push_n(6, [], %{machine_state: %EVM.MachineState{stack: [], pc: 0}, exec_env: %EVM.ExecEnv{machine_code: <<0xFF, 0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [17665503723520], pc: 0}}

iex> EVM.Instruction.Impl.push_n(16, [], %{machine_state: %EVM.MachineState{stack: [], pc: 100}, exec_env: %EVM.ExecEnv{machine_code: <<0x10, 0x11, 0x12, 0x13>>}})
%{machine_state: %EVM.MachineState{stack: [0x00], pc: 100}}
Link to this function return(list, map)

Halt execution returning output data,

Examples

iex> EVM.Instruction.Impl.return([5, 33], %{machine_state: %EVM.MachineState{active_words: 0}})
%EVM.MachineState{active_words: 2}

iex> EVM.Instruction.Impl.return([5, 33], %{machine_state: %EVM.MachineState{active_words: 5}})
%EVM.MachineState{active_words: 5}

Signed integer division operation (truncated).

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.sdiv([], %{stack: []})
:unimplemented

Signed greater-than comparision

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.sgt([], %{stack: []})
:unimplemented

Compute Keccak-256 hash.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.sha3([], %{stack: []})
:unimplemented
Link to this function signextend(args, map)
signextend(stack_args, vm_map) :: op_result

Extend length of two’s complement signed integer.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.signextend([], %{stack: []})
:unimplemented

Load word from storage.

TODO: Handle signed values?

Examples

iex> db = MerklePatriciaTree.Test.random_ets_db()
iex> state = EVM.Instruction.Impl.sstore([0x11223344556677889900, 0x111222333444555], %{state: MerklePatriciaTree.Trie.new(db)})[:state]
iex> EVM.Instruction.Impl.sload([0x11223344556677889900], %{state: state, stack: []})
%{
  stack: [0x111222333444555]
}

iex> db = MerklePatriciaTree.Test.random_ets_db()
iex> state = EVM.Instruction.Impl.sstore([0x11223344556677889900, 0x111222333444555], %{state: MerklePatriciaTree.Trie.new(db)})[:state]
iex> EVM.Instruction.Impl.sload([0x1234], %{state: state, stack: []})
%{
  stack: [0x0]
}

Signed less-than comparision.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.slt([], %{stack: []})
:unimplemented

Signed modulo remainder operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.smod([], %{stack: []})
:unimplemented
Link to this function sstore(list, map)

Save word to storage.

Defined as σ′[Ia]_s[μ_s[0]] ≡ μ_s[1]

TODO: Complex gas costs, including refund. TODO: Handle signed values

Examples

iex> db = MerklePatriciaTree.Test.random_ets_db(:store_word_test)
iex> EVM.Instruction.Impl.sstore([0x11223344556677889900, 0x111222333444555], %{state: MerklePatriciaTree.Trie.new(db)})
%{
  state: %MerklePatriciaTree.Trie{db: {MerklePatriciaTree.DB.ETS, :store_word_test}, root_hash: <<128, 58, 53, 102, 7, 182, 120, 131, 145, 91, 222, 83, 56, 42, 251, 168, 203, 138, 130, 246, 76, 122, 110, 218, 183, 131, 33, 205, 154, 136, 194, 212>>}
}

iex> db = MerklePatriciaTree.Test.random_ets_db()
iex> EVM.Instruction.Impl.sstore([0x11223344556677889900, 0x111222333444555], %{state: MerklePatriciaTree.Trie.new(db)})[:state] |> MerklePatriciaTree.Trie.Inspector.all_values()
[
  {<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     17, 34, 51, 68, 85, 102, 119, 136, 153, 0>>,
   <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 1, 17, 34, 35, 51, 68, 69, 85>>
  }
]

Halts execution.

In our implementation, this is a no-op.

Examples

iex> EVM.Instruction.Impl.stop([], %{})
:noop

Subtraction operation.

Examples

iex> EVM.Instruction.Impl.sub([5, 2], %{stack: []})
%{stack: [3]}

iex> EVM.Instruction.Impl.sub([-1, 5], %{stack: []})
%{stack: [-6]}

iex> EVM.Instruction.Impl.sub([EVM.max_int() + 6, 5], %{stack: []})
%{stack: [1]}
Link to this function suicide(args, map)
suicide(stack_args, vm_map) :: op_result

Halt execution and register account for later deletion.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.suicide([], %{stack: []})
:unimplemented

Exchange 1st and 2nd stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap1([], %{stack: []})
:unimplemented
Link to this function swap10(args, map)

Exchange 10th and 11th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap10([], %{stack: []})
:unimplemented
Link to this function swap11(args, map)

Exchange 11th and 12th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap11([], %{stack: []})
:unimplemented
Link to this function swap12(args, map)

Exchange 12th and 13th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap12([], %{stack: []})
:unimplemented
Link to this function swap13(args, map)

Exchange 13th and 14th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap13([], %{stack: []})
:unimplemented
Link to this function swap14(args, map)

Exchange 14th and 15th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap14([], %{stack: []})
:unimplemented
Link to this function swap15(args, map)

Exchange 15th and 16th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap15([], %{stack: []})
:unimplemented
Link to this function swap16(args, map)

Exchange 16th and 17th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap16([], %{stack: []})
:unimplemented

Exchange 2nd and 3rd stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap2([], %{stack: []})
:unimplemented

Exchange 3rd and 4th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap3([], %{stack: []})
:unimplemented

Exchange 4th and 5th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap4([], %{stack: []})
:unimplemented

Exchange 5th and 6th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap5([], %{stack: []})
:unimplemented

Exchange 6th and 7th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap6([], %{stack: []})
:unimplemented

Exchange 7th and 8th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap7([], %{stack: []})
:unimplemented

Exchange 8th and 9th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap8([], %{stack: []})
:unimplemented

Exchange 9th and 10th stack items.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.swap9([], %{stack: []})
:unimplemented
Link to this function timestamp(args, map)
timestamp(stack_args, vm_map) :: op_result

Get the block’s timestamp

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.timestamp([], %{stack: []})
:unimplemented

Bitwise XOR operation.

TODO: Implement opcode

Examples

iex> EVM.Instruction.Impl.xor_([], %{stack: []})
:unimplemented