2016-04-14 16:18:24 +00:00
|
|
|
// Copyright 2015 The go-ethereum Authors
|
|
|
|
// This file is part of the go-ethereum library.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-08-30 08:19:10 +00:00
|
|
|
package vm
|
|
|
|
|
2016-10-20 11:36:29 +00:00
|
|
|
import (
|
2017-01-04 19:17:24 +00:00
|
|
|
"errors"
|
2016-10-20 11:36:29 +00:00
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
|
|
)
|
2015-08-30 08:19:10 +00:00
|
|
|
|
2017-01-05 10:52:10 +00:00
|
|
|
type (
|
|
|
|
executionFunc func(pc *uint64, env *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error)
|
2017-01-04 19:17:24 +00:00
|
|
|
gasFunc func(params.GasTable, *EVM, *Contract, *Stack, *Memory, uint64) (uint64, error) // last parameter is the requested memory size as a uint64
|
2017-01-05 10:52:10 +00:00
|
|
|
stackValidationFunc func(*Stack) error
|
|
|
|
memorySizeFunc func(*Stack) *big.Int
|
|
|
|
)
|
|
|
|
|
2017-01-04 19:17:24 +00:00
|
|
|
var errGasUintOverflow = errors.New("gas uint64 overflow")
|
|
|
|
|
2017-01-05 10:52:10 +00:00
|
|
|
type operation struct {
|
|
|
|
// op is the operation function
|
|
|
|
execute executionFunc
|
|
|
|
// gasCost is the gas function and returns the gas required for execution
|
|
|
|
gasCost gasFunc
|
|
|
|
// validateStack validates the stack (size) for the operation
|
|
|
|
validateStack stackValidationFunc
|
|
|
|
// memorySize returns the memory size required for the operation
|
|
|
|
memorySize memorySizeFunc
|
2017-08-16 14:09:29 +00:00
|
|
|
|
2017-11-14 09:44:40 +00:00
|
|
|
halts bool // indicates whether the operation should halt further execution
|
2017-08-16 14:09:29 +00:00
|
|
|
jumps bool // indicates whether the program counter should not increment
|
|
|
|
writes bool // determines whether this a state modifying operation
|
|
|
|
valid bool // indication whether the retrieved operation is valid and known
|
|
|
|
reverts bool // determines whether the operation reverts state (implicitly halts)
|
2017-11-14 09:44:40 +00:00
|
|
|
returns bool // determines whether the operations sets the return data content
|
2015-08-30 08:19:10 +00:00
|
|
|
}
|
|
|
|
|
2017-02-01 21:36:51 +00:00
|
|
|
var (
|
2017-09-14 07:07:31 +00:00
|
|
|
frontierInstructionSet = NewFrontierInstructionSet()
|
|
|
|
homesteadInstructionSet = NewHomesteadInstructionSet()
|
|
|
|
byzantiumInstructionSet = NewByzantiumInstructionSet()
|
2017-02-01 21:36:51 +00:00
|
|
|
)
|
|
|
|
|
2017-09-14 07:07:31 +00:00
|
|
|
// NewByzantiumInstructionSet returns the frontier, homestead and
|
|
|
|
// byzantium instructions.
|
|
|
|
func NewByzantiumInstructionSet() [256]operation {
|
2017-08-15 08:23:23 +00:00
|
|
|
// instructions that can be executed during the homestead phase.
|
|
|
|
instructionSet := NewHomesteadInstructionSet()
|
|
|
|
instructionSet[STATICCALL] = operation{
|
|
|
|
execute: opStaticCall,
|
|
|
|
gasCost: gasStaticCall,
|
|
|
|
validateStack: makeStackFunc(6, 1),
|
|
|
|
memorySize: memoryStaticCall,
|
|
|
|
valid: true,
|
2017-08-16 10:36:48 +00:00
|
|
|
returns: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
}
|
2017-08-16 10:07:33 +00:00
|
|
|
instructionSet[RETURNDATASIZE] = operation{
|
|
|
|
execute: opReturnDataSize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
}
|
|
|
|
instructionSet[RETURNDATACOPY] = operation{
|
|
|
|
execute: opReturnDataCopy,
|
|
|
|
gasCost: gasReturnDataCopy,
|
|
|
|
validateStack: makeStackFunc(3, 0),
|
|
|
|
memorySize: memoryReturnDataCopy,
|
|
|
|
valid: true,
|
|
|
|
}
|
2017-08-16 12:32:59 +00:00
|
|
|
instructionSet[REVERT] = operation{
|
|
|
|
execute: opRevert,
|
2017-08-16 14:09:29 +00:00
|
|
|
gasCost: gasRevert,
|
2017-08-16 12:32:59 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-08-16 14:09:29 +00:00
|
|
|
memorySize: memoryRevert,
|
2017-08-16 12:32:59 +00:00
|
|
|
valid: true,
|
|
|
|
reverts: true,
|
2017-08-16 14:09:29 +00:00
|
|
|
returns: true,
|
2017-08-16 12:32:59 +00:00
|
|
|
}
|
2017-08-15 08:23:23 +00:00
|
|
|
return instructionSet
|
|
|
|
}
|
|
|
|
|
2017-05-12 19:35:45 +00:00
|
|
|
// NewHomesteadInstructionSet returns the frontier and homestead
|
|
|
|
// instructions that can be executed during the homestead phase.
|
2017-02-01 21:36:51 +00:00
|
|
|
func NewHomesteadInstructionSet() [256]operation {
|
2017-05-12 19:35:45 +00:00
|
|
|
instructionSet := NewFrontierInstructionSet()
|
2017-02-01 21:36:51 +00:00
|
|
|
instructionSet[DELEGATECALL] = operation{
|
|
|
|
execute: opDelegateCall,
|
|
|
|
gasCost: gasDelegateCall,
|
|
|
|
validateStack: makeStackFunc(6, 1),
|
|
|
|
memorySize: memoryDelegateCall,
|
|
|
|
valid: true,
|
2017-08-16 10:36:48 +00:00
|
|
|
returns: true,
|
2017-02-01 21:36:51 +00:00
|
|
|
}
|
|
|
|
return instructionSet
|
|
|
|
}
|
2016-01-19 22:50:00 +00:00
|
|
|
|
2017-05-12 19:35:45 +00:00
|
|
|
// NewFrontierInstructionSet returns the frontier instructions
|
|
|
|
// that can be executed during the frontier phase.
|
|
|
|
func NewFrontierInstructionSet() [256]operation {
|
2017-01-05 10:52:10 +00:00
|
|
|
return [256]operation{
|
2017-02-08 12:39:26 +00:00
|
|
|
STOP: {
|
|
|
|
execute: opStop,
|
2017-01-04 19:17:24 +00:00
|
|
|
gasCost: constGasFunc(0),
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeStackFunc(0, 0),
|
|
|
|
halts: true,
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 12:39:26 +00:00
|
|
|
ADD: {
|
|
|
|
execute: opAdd,
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MUL: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMul,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 12:39:26 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SUB: {
|
|
|
|
execute: opSub,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DIV: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opDiv,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SDIV: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSdiv,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MOD: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMod,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SMOD: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSmod,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 12:39:26 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
ADDMOD: {
|
|
|
|
execute: opAddmod,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(3, 1),
|
2017-02-08 12:39:26 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
MULMOD: {
|
|
|
|
execute: opMulmod,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(3, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
EXP: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opExp,
|
|
|
|
gasCost: gasExp,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SIGNEXTEND: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSignExtend,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
LT: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opLt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
GT: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opGt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SLT: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSlt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SGT: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSgt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
EQ: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opEq,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
ISZERO: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opIszero,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
AND: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opAnd,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 12:39:26 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
XOR: {
|
|
|
|
execute: opXor,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
OR: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opOr,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 12:39:26 +00:00
|
|
|
NOT: {
|
|
|
|
execute: opNot,
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
BYTE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opByte,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SHA3: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSha3,
|
|
|
|
gasCost: gasSha3,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
memorySize: memorySha3,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
ADDRESS: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opAddress,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
BALANCE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opBalance,
|
|
|
|
gasCost: gasBalance,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
ORIGIN: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opOrigin,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CALLER: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opCaller,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CALLVALUE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opCallValue,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CALLDATALOAD: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCallDataLoad,
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CALLDATASIZE: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCallDataSize,
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CALLDATACOPY: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCallDataCopy,
|
|
|
|
gasCost: gasCallDataCopy,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-08-16 10:36:48 +00:00
|
|
|
memorySize: memoryCallDataCopy,
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CODESIZE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opCodeSize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
CODECOPY: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opCodeCopy,
|
|
|
|
gasCost: gasCodeCopy,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-01-05 10:52:10 +00:00
|
|
|
memorySize: memoryCodeCopy,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
GASPRICE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opGasprice,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 12:39:26 +00:00
|
|
|
EXTCODESIZE: {
|
|
|
|
execute: opExtCodeSize,
|
|
|
|
gasCost: gasExtCodeSize,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-02-08 12:39:26 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
EXTCODECOPY: {
|
|
|
|
execute: opExtCodeCopy,
|
|
|
|
gasCost: gasExtCodeCopy,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(4, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryExtCodeCopy,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
BLOCKHASH: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opBlockhash,
|
|
|
|
gasCost: constGasFunc(GasExtStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
COINBASE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opCoinbase,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
TIMESTAMP: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opTimestamp,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
NUMBER: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opNumber,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DIFFICULTY: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opDifficulty,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
GASLIMIT: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opGasLimit,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
POP: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opPop,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MLOAD: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMload,
|
|
|
|
gasCost: gasMLoad,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
memorySize: memoryMLoad,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MSTORE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMstore,
|
|
|
|
gasCost: gasMStore,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-01-05 10:52:10 +00:00
|
|
|
memorySize: memoryMStore,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MSTORE8: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMstore8,
|
|
|
|
gasCost: gasMStore8,
|
|
|
|
memorySize: memoryMStore8,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2016-01-21 14:29:58 +00:00
|
|
|
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SLOAD: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSload,
|
|
|
|
gasCost: gasSLoad,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
SSTORE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opSstore,
|
|
|
|
gasCost: gasSStore,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
2017-02-01 21:36:51 +00:00
|
|
|
writes: true,
|
2017-01-05 10:52:10 +00:00
|
|
|
},
|
2017-02-08 12:39:26 +00:00
|
|
|
JUMP: {
|
|
|
|
execute: opJump,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
jumps: true,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
JUMPI: {
|
|
|
|
execute: opJumpi,
|
|
|
|
gasCost: constGasFunc(GasSlowStep),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
jumps: true,
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PC: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opPc,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
MSIZE: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opMsize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
GAS: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: opGas,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 12:39:26 +00:00
|
|
|
JUMPDEST: {
|
|
|
|
execute: opJumpdest,
|
|
|
|
gasCost: constGasFunc(params.JumpdestGas),
|
2017-01-05 10:52:10 +00:00
|
|
|
validateStack: makeStackFunc(0, 0),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH1: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(1, 1),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH2: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(2, 2),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH3: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(3, 3),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH4: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(4, 4),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH5: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(5, 5),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH6: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(6, 6),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH7: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(7, 7),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH8: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(8, 8),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH9: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(9, 9),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH10: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(10, 10),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH11: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(11, 11),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH12: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(12, 12),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH13: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(13, 13),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH14: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(14, 14),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH15: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(15, 15),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH16: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(16, 16),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH17: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(17, 17),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH18: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(18, 18),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH19: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(19, 19),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH20: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(20, 20),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH21: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(21, 21),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH22: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(22, 22),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH23: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(23, 23),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH24: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(24, 24),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH25: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(25, 25),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH26: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(26, 26),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH27: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(27, 27),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH28: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(28, 28),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH29: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(29, 29),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH30: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(30, 30),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH31: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(31, 31),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
PUSH32: {
|
2017-05-23 08:39:53 +00:00
|
|
|
execute: makePush(32, 32),
|
2017-01-05 10:52:10 +00:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP1: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(1),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(1),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP2: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(2),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(2),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP3: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(3),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(3),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP4: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(4),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(4),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP5: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(5),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(5),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP6: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(6),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(6),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP7: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(7),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(7),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP8: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(8),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(8),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP9: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(9),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(9),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP10: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(10),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(10),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP11: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(11),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(11),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP12: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(12),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(12),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP13: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(13),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(13),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP14: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(14),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(14),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP15: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(15),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(15),
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 14:52:03 +00:00
|
|
|
DUP16: {
|
2017-01-05 10:52:10 +00:00
|
|
|
execute: makeDup(16),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 12:39:26 +00:00
|
|
|
validateStack: makeDupStackFunc(16),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP1: {
|
|
|
|
execute: makeSwap(1),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(2),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP2: {
|
|
|
|
execute: makeSwap(2),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(3),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP3: {
|
|
|
|
execute: makeSwap(3),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(4),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP4: {
|
|
|
|
execute: makeSwap(4),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(5),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP5: {
|
|
|
|
execute: makeSwap(5),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(6),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP6: {
|
|
|
|
execute: makeSwap(6),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(7),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP7: {
|
|
|
|
execute: makeSwap(7),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(8),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP8: {
|
|
|
|
execute: makeSwap(8),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(9),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP9: {
|
|
|
|
execute: makeSwap(9),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(10),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP10: {
|
|
|
|
execute: makeSwap(10),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(11),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP11: {
|
|
|
|
execute: makeSwap(11),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(12),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP12: {
|
|
|
|
execute: makeSwap(12),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(13),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP13: {
|
|
|
|
execute: makeSwap(13),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(14),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP14: {
|
|
|
|
execute: makeSwap(14),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(15),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP15: {
|
|
|
|
execute: makeSwap(15),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(16),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SWAP16: {
|
|
|
|
execute: makeSwap(16),
|
|
|
|
gasCost: gasSwap,
|
|
|
|
validateStack: makeSwapStackFunc(17),
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
LOG0: {
|
|
|
|
execute: makeLog(0),
|
|
|
|
gasCost: makeGasLog(0),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
writes: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
LOG1: {
|
|
|
|
execute: makeLog(1),
|
|
|
|
gasCost: makeGasLog(1),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
writes: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
LOG2: {
|
|
|
|
execute: makeLog(2),
|
|
|
|
gasCost: makeGasLog(2),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(4, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
writes: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
LOG3: {
|
|
|
|
execute: makeLog(3),
|
|
|
|
gasCost: makeGasLog(3),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(5, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
writes: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
LOG4: {
|
|
|
|
execute: makeLog(4),
|
|
|
|
gasCost: makeGasLog(4),
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(6, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
2017-08-15 08:23:23 +00:00
|
|
|
writes: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
CREATE: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCreate,
|
|
|
|
gasCost: gasCreate,
|
|
|
|
validateStack: makeStackFunc(3, 1),
|
|
|
|
memorySize: memoryCreate,
|
|
|
|
valid: true,
|
|
|
|
writes: true,
|
|
|
|
returns: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
CALL: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCall,
|
|
|
|
gasCost: gasCall,
|
|
|
|
validateStack: makeStackFunc(7, 1),
|
|
|
|
memorySize: memoryCall,
|
|
|
|
valid: true,
|
|
|
|
returns: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
CALLCODE: {
|
2017-08-16 10:36:48 +00:00
|
|
|
execute: opCallCode,
|
|
|
|
gasCost: gasCallCode,
|
|
|
|
validateStack: makeStackFunc(7, 1),
|
|
|
|
memorySize: memoryCall,
|
|
|
|
valid: true,
|
|
|
|
returns: true,
|
2017-02-08 12:39:26 +00:00
|
|
|
},
|
|
|
|
RETURN: {
|
|
|
|
execute: opReturn,
|
|
|
|
gasCost: gasReturn,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
memorySize: memoryReturn,
|
|
|
|
halts: true,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SELFDESTRUCT: {
|
|
|
|
execute: opSuicide,
|
|
|
|
gasCost: gasSuicide,
|
2017-01-04 19:17:24 +00:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-02-08 12:39:26 +00:00
|
|
|
halts: true,
|
2017-01-05 10:52:10 +00:00
|
|
|
valid: true,
|
2017-02-01 21:36:51 +00:00
|
|
|
writes: true,
|
2017-01-05 10:52:10 +00:00
|
|
|
},
|
2016-01-19 22:50:00 +00:00
|
|
|
}
|
2015-08-30 08:19:10 +00:00
|
|
|
}
|