2016-04-14 11:18:24 -05: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 03:19:10 -05:00
|
|
|
package vm
|
|
|
|
|
2016-10-20 06:36:29 -05:00
|
|
|
import (
|
2017-01-04 13:17:24 -06:00
|
|
|
"errors"
|
2016-10-20 06:36:29 -05:00
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
|
|
)
|
2015-08-30 03:19:10 -05:00
|
|
|
|
2017-01-05 04:52:10 -06:00
|
|
|
type (
|
|
|
|
executionFunc func(pc *uint64, env *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error)
|
2017-01-04 13:17:24 -06: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 04:52:10 -06:00
|
|
|
stackValidationFunc func(*Stack) error
|
|
|
|
memorySizeFunc func(*Stack) *big.Int
|
|
|
|
)
|
|
|
|
|
2017-01-04 13:17:24 -06:00
|
|
|
var errGasUintOverflow = errors.New("gas uint64 overflow")
|
|
|
|
|
2017-01-05 04:52:10 -06: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
|
|
|
|
// halts indicates whether the operation shoult halt further execution
|
|
|
|
// and return
|
|
|
|
halts bool
|
|
|
|
// jumps indicates whether operation made a jump. This prevents the program
|
|
|
|
// counter from further incrementing.
|
|
|
|
jumps bool
|
2017-02-01 15:36:51 -06:00
|
|
|
// writes determines whether this a state modifying operation
|
|
|
|
writes bool
|
2017-01-05 04:52:10 -06:00
|
|
|
// valid is used to check whether the retrieved operation is valid and known
|
2015-08-30 03:19:10 -05:00
|
|
|
valid bool
|
2017-02-01 15:36:51 -06:00
|
|
|
// reverts determined whether the operation reverts state
|
|
|
|
reverts bool
|
2015-08-30 03:19:10 -05:00
|
|
|
}
|
|
|
|
|
2017-02-01 15:36:51 -06:00
|
|
|
var (
|
2017-05-12 14:35:45 -05:00
|
|
|
frontierInstructionSet = NewFrontierInstructionSet()
|
2017-02-01 15:36:51 -06:00
|
|
|
homesteadInstructionSet = NewHomesteadInstructionSet()
|
|
|
|
)
|
|
|
|
|
2017-05-12 14:35:45 -05:00
|
|
|
// NewHomesteadInstructionSet returns the frontier and homestead
|
|
|
|
// instructions that can be executed during the homestead phase.
|
2017-02-01 15:36:51 -06:00
|
|
|
func NewHomesteadInstructionSet() [256]operation {
|
2017-05-12 14:35:45 -05:00
|
|
|
instructionSet := NewFrontierInstructionSet()
|
2017-02-01 15:36:51 -06:00
|
|
|
instructionSet[DELEGATECALL] = operation{
|
|
|
|
execute: opDelegateCall,
|
|
|
|
gasCost: gasDelegateCall,
|
|
|
|
validateStack: makeStackFunc(6, 1),
|
|
|
|
memorySize: memoryDelegateCall,
|
|
|
|
valid: true,
|
|
|
|
}
|
|
|
|
return instructionSet
|
|
|
|
}
|
2016-01-19 16:50:00 -06:00
|
|
|
|
2017-05-12 14:35:45 -05:00
|
|
|
// NewFrontierInstructionSet returns the frontier instructions
|
|
|
|
// that can be executed during the frontier phase.
|
|
|
|
func NewFrontierInstructionSet() [256]operation {
|
2017-01-05 04:52:10 -06:00
|
|
|
return [256]operation{
|
2017-02-08 06:39:26 -06:00
|
|
|
STOP: {
|
|
|
|
execute: opStop,
|
2017-01-04 13:17:24 -06:00
|
|
|
gasCost: constGasFunc(0),
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeStackFunc(0, 0),
|
|
|
|
halts: true,
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 06:39:26 -06:00
|
|
|
ADD: {
|
|
|
|
execute: opAdd,
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MUL: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMul,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SUB: {
|
|
|
|
execute: opSub,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DIV: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opDiv,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SDIV: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSdiv,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MOD: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMod,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SMOD: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSmod,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
ADDMOD: {
|
|
|
|
execute: opAddmod,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
MULMOD: {
|
|
|
|
execute: opMulmod,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
EXP: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opExp,
|
|
|
|
gasCost: gasExp,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SIGNEXTEND: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSignExtend,
|
|
|
|
gasCost: constGasFunc(GasFastStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
LT: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opLt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
GT: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opGt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SLT: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSlt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SGT: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSgt,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
EQ: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opEq,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
ISZERO: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opIszero,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
AND: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opAnd,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
XOR: {
|
|
|
|
execute: opXor,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
OR: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opOr,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 06:39:26 -06:00
|
|
|
NOT: {
|
|
|
|
execute: opNot,
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
BYTE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opByte,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SHA3: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSha3,
|
|
|
|
gasCost: gasSha3,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
memorySize: memorySha3,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
ADDRESS: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opAddress,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
BALANCE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opBalance,
|
|
|
|
gasCost: gasBalance,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
ORIGIN: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opOrigin,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CALLER: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCaller,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CALLVALUE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCallValue,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CALLDATALOAD: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCalldataLoad,
|
|
|
|
gasCost: constGasFunc(GasFastestStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CALLDATASIZE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCalldataSize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CALLDATACOPY: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCalldataCopy,
|
|
|
|
gasCost: gasCalldataCopy,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-01-05 04:52:10 -06:00
|
|
|
memorySize: memoryCalldataCopy,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CODESIZE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCodeSize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
CODECOPY: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCodeCopy,
|
|
|
|
gasCost: gasCodeCopy,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-01-05 04:52:10 -06:00
|
|
|
memorySize: memoryCodeCopy,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
GASPRICE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opGasprice,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 06:39:26 -06:00
|
|
|
EXTCODESIZE: {
|
|
|
|
execute: opExtCodeSize,
|
|
|
|
gasCost: gasExtCodeSize,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
EXTCODECOPY: {
|
|
|
|
execute: opExtCodeCopy,
|
|
|
|
gasCost: gasExtCodeCopy,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(4, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryExtCodeCopy,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
BLOCKHASH: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opBlockhash,
|
|
|
|
gasCost: constGasFunc(GasExtStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
COINBASE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opCoinbase,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
TIMESTAMP: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opTimestamp,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
NUMBER: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opNumber,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DIFFICULTY: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opDifficulty,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
GASLIMIT: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opGasLimit,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
POP: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opPop,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MLOAD: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMload,
|
|
|
|
gasCost: gasMLoad,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
memorySize: memoryMLoad,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MSTORE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMstore,
|
|
|
|
gasCost: gasMStore,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-01-05 04:52:10 -06:00
|
|
|
memorySize: memoryMStore,
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MSTORE8: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMstore8,
|
|
|
|
gasCost: gasMStore8,
|
|
|
|
memorySize: memoryMStore8,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2016-01-21 08:29:58 -06:00
|
|
|
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SLOAD: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSload,
|
|
|
|
gasCost: gasSLoad,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
SSTORE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opSstore,
|
|
|
|
gasCost: gasSStore,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
2017-02-01 15:36:51 -06:00
|
|
|
writes: true,
|
2017-01-05 04:52:10 -06:00
|
|
|
},
|
2017-02-08 06:39:26 -06:00
|
|
|
JUMP: {
|
|
|
|
execute: opJump,
|
|
|
|
gasCost: constGasFunc(GasMidStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
jumps: true,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
JUMPI: {
|
|
|
|
execute: opJumpi,
|
|
|
|
gasCost: constGasFunc(GasSlowStep),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
jumps: true,
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PC: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opPc,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
MSIZE: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opMsize,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
GAS: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: opGas,
|
|
|
|
gasCost: constGasFunc(GasQuickStep),
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-02-08 06:39:26 -06:00
|
|
|
JUMPDEST: {
|
|
|
|
execute: opJumpdest,
|
|
|
|
gasCost: constGasFunc(params.JumpdestGas),
|
2017-01-05 04:52:10 -06:00
|
|
|
validateStack: makeStackFunc(0, 0),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH1: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(1, 1),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH2: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(2, 2),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH3: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(3, 3),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH4: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(4, 4),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH5: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(5, 5),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH6: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(6, 6),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH7: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(7, 7),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH8: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(8, 8),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH9: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(9, 9),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH10: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(10, 10),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH11: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(11, 11),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH12: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(12, 12),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH13: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(13, 13),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH14: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(14, 14),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH15: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(15, 15),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH16: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(16, 16),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH17: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(17, 17),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH18: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(18, 18),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH19: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(19, 19),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH20: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(20, 20),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH21: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(21, 21),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH22: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(22, 22),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH23: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(23, 23),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH24: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(24, 24),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH25: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(25, 25),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH26: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(26, 26),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH27: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(27, 27),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH28: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(28, 28),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH29: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(29, 29),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH30: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(30, 30),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH31: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(31, 31),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
PUSH32: {
|
2017-05-23 03:39:53 -05:00
|
|
|
execute: makePush(32, 32),
|
2017-01-05 04:52:10 -06:00
|
|
|
gasCost: gasPush,
|
|
|
|
validateStack: makeStackFunc(0, 1),
|
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP1: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(1),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(1),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP2: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(2),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(2),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP3: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(3),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(3),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP4: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(4),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(4),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP5: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(5),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(5),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP6: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(6),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(6),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP7: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(7),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(7),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP8: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(8),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(8),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP9: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(9),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(9),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP10: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(10),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(10),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP11: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(11),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(11),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP12: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(12),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(12),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP13: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(13),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(13),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP14: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(14),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(14),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP15: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(15),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06:00
|
|
|
validateStack: makeDupStackFunc(15),
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
|
|
|
},
|
2017-01-06 08:52:03 -06:00
|
|
|
DUP16: {
|
2017-01-05 04:52:10 -06:00
|
|
|
execute: makeDup(16),
|
|
|
|
gasCost: gasDup,
|
2017-02-08 06:39:26 -06: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 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
LOG1: {
|
|
|
|
execute: makeLog(1),
|
|
|
|
gasCost: makeGasLog(1),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
LOG2: {
|
|
|
|
execute: makeLog(2),
|
|
|
|
gasCost: makeGasLog(2),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(4, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
LOG3: {
|
|
|
|
execute: makeLog(3),
|
|
|
|
gasCost: makeGasLog(3),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(5, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
LOG4: {
|
|
|
|
execute: makeLog(4),
|
|
|
|
gasCost: makeGasLog(4),
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(6, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryLog,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
CREATE: {
|
|
|
|
execute: opCreate,
|
|
|
|
gasCost: gasCreate,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(3, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryCreate,
|
|
|
|
valid: true,
|
2017-02-01 15:36:51 -06:00
|
|
|
writes: true,
|
2017-02-08 06:39:26 -06:00
|
|
|
},
|
|
|
|
CALL: {
|
|
|
|
execute: opCall,
|
|
|
|
gasCost: gasCall,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(7, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryCall,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
CALLCODE: {
|
|
|
|
execute: opCallCode,
|
|
|
|
gasCost: gasCallCode,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(7, 1),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryCall,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
RETURN: {
|
|
|
|
execute: opReturn,
|
|
|
|
gasCost: gasReturn,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(2, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
memorySize: memoryReturn,
|
|
|
|
halts: true,
|
|
|
|
valid: true,
|
|
|
|
},
|
|
|
|
SELFDESTRUCT: {
|
|
|
|
execute: opSuicide,
|
|
|
|
gasCost: gasSuicide,
|
2017-01-04 13:17:24 -06:00
|
|
|
validateStack: makeStackFunc(1, 0),
|
2017-02-08 06:39:26 -06:00
|
|
|
halts: true,
|
2017-01-05 04:52:10 -06:00
|
|
|
valid: true,
|
2017-02-01 15:36:51 -06:00
|
|
|
writes: true,
|
2017-01-05 04:52:10 -06:00
|
|
|
},
|
2016-01-19 16:50:00 -06:00
|
|
|
}
|
2015-08-30 03:19:10 -05:00
|
|
|
}
|