github.com/snowblossomcoin/go-ethereum@v1.9.25/core/vm/jump_table.go (about)

     1  // Copyright 2015 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package vm
    18  
    19  import (
    20  	"github.com/ethereum/go-ethereum/params"
    21  )
    22  
    23  type (
    24  	executionFunc func(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]byte, error)
    25  	gasFunc       func(*EVM, *Contract, *Stack, *Memory, uint64) (uint64, error) // last parameter is the requested memory size as a uint64
    26  	// memorySizeFunc returns the required size, and whether the operation overflowed a uint64
    27  	memorySizeFunc func(*Stack) (size uint64, overflow bool)
    28  )
    29  
    30  type operation struct {
    31  	// execute is the operation function
    32  	execute     executionFunc
    33  	constantGas uint64
    34  	dynamicGas  gasFunc
    35  	// minStack tells how many stack items are required
    36  	minStack int
    37  	// maxStack specifies the max length the stack can have for this operation
    38  	// to not overflow the stack.
    39  	maxStack int
    40  
    41  	// memorySize returns the memory size required for the operation
    42  	memorySize memorySizeFunc
    43  
    44  	halts   bool // indicates whether the operation should halt further execution
    45  	jumps   bool // indicates whether the program counter should not increment
    46  	writes  bool // determines whether this a state modifying operation
    47  	reverts bool // determines whether the operation reverts state (implicitly halts)
    48  	returns bool // determines whether the operations sets the return data content
    49  }
    50  
    51  var (
    52  	frontierInstructionSet         = newFrontierInstructionSet()
    53  	homesteadInstructionSet        = newHomesteadInstructionSet()
    54  	tangerineWhistleInstructionSet = newTangerineWhistleInstructionSet()
    55  	spuriousDragonInstructionSet   = newSpuriousDragonInstructionSet()
    56  	byzantiumInstructionSet        = newByzantiumInstructionSet()
    57  	constantinopleInstructionSet   = newConstantinopleInstructionSet()
    58  	istanbulInstructionSet         = newIstanbulInstructionSet()
    59  	yoloV2InstructionSet           = newYoloV2InstructionSet()
    60  )
    61  
    62  // JumpTable contains the EVM opcodes supported at a given fork.
    63  type JumpTable [256]*operation
    64  
    65  // newYoloV2InstructionSet creates an instructionset containing
    66  // - "EIP-2315: Simple Subroutines"
    67  // - "EIP-2929: Gas cost increases for state access opcodes"
    68  func newYoloV2InstructionSet() JumpTable {
    69  	instructionSet := newIstanbulInstructionSet()
    70  	enable2315(&instructionSet) // Subroutines - https://eips.ethereum.org/EIPS/eip-2315
    71  	enable2929(&instructionSet) // Access lists for trie accesses https://eips.ethereum.org/EIPS/eip-2929
    72  	return instructionSet
    73  }
    74  
    75  // newIstanbulInstructionSet returns the frontier, homestead
    76  // byzantium, contantinople and petersburg instructions.
    77  func newIstanbulInstructionSet() JumpTable {
    78  	instructionSet := newConstantinopleInstructionSet()
    79  
    80  	enable1344(&instructionSet) // ChainID opcode - https://eips.ethereum.org/EIPS/eip-1344
    81  	enable1884(&instructionSet) // Reprice reader opcodes - https://eips.ethereum.org/EIPS/eip-1884
    82  	enable2200(&instructionSet) // Net metered SSTORE - https://eips.ethereum.org/EIPS/eip-2200
    83  
    84  	return instructionSet
    85  }
    86  
    87  // newConstantinopleInstructionSet returns the frontier, homestead
    88  // byzantium and contantinople instructions.
    89  func newConstantinopleInstructionSet() JumpTable {
    90  	instructionSet := newByzantiumInstructionSet()
    91  	instructionSet[SHL] = &operation{
    92  		execute:     opSHL,
    93  		constantGas: GasFastestStep,
    94  		minStack:    minStack(2, 1),
    95  		maxStack:    maxStack(2, 1),
    96  	}
    97  	instructionSet[SHR] = &operation{
    98  		execute:     opSHR,
    99  		constantGas: GasFastestStep,
   100  		minStack:    minStack(2, 1),
   101  		maxStack:    maxStack(2, 1),
   102  	}
   103  	instructionSet[SAR] = &operation{
   104  		execute:     opSAR,
   105  		constantGas: GasFastestStep,
   106  		minStack:    minStack(2, 1),
   107  		maxStack:    maxStack(2, 1),
   108  	}
   109  	instructionSet[EXTCODEHASH] = &operation{
   110  		execute:     opExtCodeHash,
   111  		constantGas: params.ExtcodeHashGasConstantinople,
   112  		minStack:    minStack(1, 1),
   113  		maxStack:    maxStack(1, 1),
   114  	}
   115  	instructionSet[CREATE2] = &operation{
   116  		execute:     opCreate2,
   117  		constantGas: params.Create2Gas,
   118  		dynamicGas:  gasCreate2,
   119  		minStack:    minStack(4, 1),
   120  		maxStack:    maxStack(4, 1),
   121  		memorySize:  memoryCreate2,
   122  		writes:      true,
   123  		returns:     true,
   124  	}
   125  	return instructionSet
   126  }
   127  
   128  // newByzantiumInstructionSet returns the frontier, homestead and
   129  // byzantium instructions.
   130  func newByzantiumInstructionSet() JumpTable {
   131  	instructionSet := newSpuriousDragonInstructionSet()
   132  	instructionSet[STATICCALL] = &operation{
   133  		execute:     opStaticCall,
   134  		constantGas: params.CallGasEIP150,
   135  		dynamicGas:  gasStaticCall,
   136  		minStack:    minStack(6, 1),
   137  		maxStack:    maxStack(6, 1),
   138  		memorySize:  memoryStaticCall,
   139  		returns:     true,
   140  	}
   141  	instructionSet[RETURNDATASIZE] = &operation{
   142  		execute:     opReturnDataSize,
   143  		constantGas: GasQuickStep,
   144  		minStack:    minStack(0, 1),
   145  		maxStack:    maxStack(0, 1),
   146  	}
   147  	instructionSet[RETURNDATACOPY] = &operation{
   148  		execute:     opReturnDataCopy,
   149  		constantGas: GasFastestStep,
   150  		dynamicGas:  gasReturnDataCopy,
   151  		minStack:    minStack(3, 0),
   152  		maxStack:    maxStack(3, 0),
   153  		memorySize:  memoryReturnDataCopy,
   154  	}
   155  	instructionSet[REVERT] = &operation{
   156  		execute:    opRevert,
   157  		dynamicGas: gasRevert,
   158  		minStack:   minStack(2, 0),
   159  		maxStack:   maxStack(2, 0),
   160  		memorySize: memoryRevert,
   161  		reverts:    true,
   162  		returns:    true,
   163  	}
   164  	return instructionSet
   165  }
   166  
   167  // EIP 158 a.k.a Spurious Dragon
   168  func newSpuriousDragonInstructionSet() JumpTable {
   169  	instructionSet := newTangerineWhistleInstructionSet()
   170  	instructionSet[EXP].dynamicGas = gasExpEIP158
   171  	return instructionSet
   172  
   173  }
   174  
   175  // EIP 150 a.k.a Tangerine Whistle
   176  func newTangerineWhistleInstructionSet() JumpTable {
   177  	instructionSet := newHomesteadInstructionSet()
   178  	instructionSet[BALANCE].constantGas = params.BalanceGasEIP150
   179  	instructionSet[EXTCODESIZE].constantGas = params.ExtcodeSizeGasEIP150
   180  	instructionSet[SLOAD].constantGas = params.SloadGasEIP150
   181  	instructionSet[EXTCODECOPY].constantGas = params.ExtcodeCopyBaseEIP150
   182  	instructionSet[CALL].constantGas = params.CallGasEIP150
   183  	instructionSet[CALLCODE].constantGas = params.CallGasEIP150
   184  	instructionSet[DELEGATECALL].constantGas = params.CallGasEIP150
   185  	return instructionSet
   186  }
   187  
   188  // newHomesteadInstructionSet returns the frontier and homestead
   189  // instructions that can be executed during the homestead phase.
   190  func newHomesteadInstructionSet() JumpTable {
   191  	instructionSet := newFrontierInstructionSet()
   192  	instructionSet[DELEGATECALL] = &operation{
   193  		execute:     opDelegateCall,
   194  		dynamicGas:  gasDelegateCall,
   195  		constantGas: params.CallGasFrontier,
   196  		minStack:    minStack(6, 1),
   197  		maxStack:    maxStack(6, 1),
   198  		memorySize:  memoryDelegateCall,
   199  		returns:     true,
   200  	}
   201  	return instructionSet
   202  }
   203  
   204  // newFrontierInstructionSet returns the frontier instructions
   205  // that can be executed during the frontier phase.
   206  func newFrontierInstructionSet() JumpTable {
   207  	return JumpTable{
   208  		STOP: {
   209  			execute:     opStop,
   210  			constantGas: 0,
   211  			minStack:    minStack(0, 0),
   212  			maxStack:    maxStack(0, 0),
   213  			halts:       true,
   214  		},
   215  		ADD: {
   216  			execute:     opAdd,
   217  			constantGas: GasFastestStep,
   218  			minStack:    minStack(2, 1),
   219  			maxStack:    maxStack(2, 1),
   220  		},
   221  		MUL: {
   222  			execute:     opMul,
   223  			constantGas: GasFastStep,
   224  			minStack:    minStack(2, 1),
   225  			maxStack:    maxStack(2, 1),
   226  		},
   227  		SUB: {
   228  			execute:     opSub,
   229  			constantGas: GasFastestStep,
   230  			minStack:    minStack(2, 1),
   231  			maxStack:    maxStack(2, 1),
   232  		},
   233  		DIV: {
   234  			execute:     opDiv,
   235  			constantGas: GasFastStep,
   236  			minStack:    minStack(2, 1),
   237  			maxStack:    maxStack(2, 1),
   238  		},
   239  		SDIV: {
   240  			execute:     opSdiv,
   241  			constantGas: GasFastStep,
   242  			minStack:    minStack(2, 1),
   243  			maxStack:    maxStack(2, 1),
   244  		},
   245  		MOD: {
   246  			execute:     opMod,
   247  			constantGas: GasFastStep,
   248  			minStack:    minStack(2, 1),
   249  			maxStack:    maxStack(2, 1),
   250  		},
   251  		SMOD: {
   252  			execute:     opSmod,
   253  			constantGas: GasFastStep,
   254  			minStack:    minStack(2, 1),
   255  			maxStack:    maxStack(2, 1),
   256  		},
   257  		ADDMOD: {
   258  			execute:     opAddmod,
   259  			constantGas: GasMidStep,
   260  			minStack:    minStack(3, 1),
   261  			maxStack:    maxStack(3, 1),
   262  		},
   263  		MULMOD: {
   264  			execute:     opMulmod,
   265  			constantGas: GasMidStep,
   266  			minStack:    minStack(3, 1),
   267  			maxStack:    maxStack(3, 1),
   268  		},
   269  		EXP: {
   270  			execute:    opExp,
   271  			dynamicGas: gasExpFrontier,
   272  			minStack:   minStack(2, 1),
   273  			maxStack:   maxStack(2, 1),
   274  		},
   275  		SIGNEXTEND: {
   276  			execute:     opSignExtend,
   277  			constantGas: GasFastStep,
   278  			minStack:    minStack(2, 1),
   279  			maxStack:    maxStack(2, 1),
   280  		},
   281  		LT: {
   282  			execute:     opLt,
   283  			constantGas: GasFastestStep,
   284  			minStack:    minStack(2, 1),
   285  			maxStack:    maxStack(2, 1),
   286  		},
   287  		GT: {
   288  			execute:     opGt,
   289  			constantGas: GasFastestStep,
   290  			minStack:    minStack(2, 1),
   291  			maxStack:    maxStack(2, 1),
   292  		},
   293  		SLT: {
   294  			execute:     opSlt,
   295  			constantGas: GasFastestStep,
   296  			minStack:    minStack(2, 1),
   297  			maxStack:    maxStack(2, 1),
   298  		},
   299  		SGT: {
   300  			execute:     opSgt,
   301  			constantGas: GasFastestStep,
   302  			minStack:    minStack(2, 1),
   303  			maxStack:    maxStack(2, 1),
   304  		},
   305  		EQ: {
   306  			execute:     opEq,
   307  			constantGas: GasFastestStep,
   308  			minStack:    minStack(2, 1),
   309  			maxStack:    maxStack(2, 1),
   310  		},
   311  		ISZERO: {
   312  			execute:     opIszero,
   313  			constantGas: GasFastestStep,
   314  			minStack:    minStack(1, 1),
   315  			maxStack:    maxStack(1, 1),
   316  		},
   317  		AND: {
   318  			execute:     opAnd,
   319  			constantGas: GasFastestStep,
   320  			minStack:    minStack(2, 1),
   321  			maxStack:    maxStack(2, 1),
   322  		},
   323  		XOR: {
   324  			execute:     opXor,
   325  			constantGas: GasFastestStep,
   326  			minStack:    minStack(2, 1),
   327  			maxStack:    maxStack(2, 1),
   328  		},
   329  		OR: {
   330  			execute:     opOr,
   331  			constantGas: GasFastestStep,
   332  			minStack:    minStack(2, 1),
   333  			maxStack:    maxStack(2, 1),
   334  		},
   335  		NOT: {
   336  			execute:     opNot,
   337  			constantGas: GasFastestStep,
   338  			minStack:    minStack(1, 1),
   339  			maxStack:    maxStack(1, 1),
   340  		},
   341  		BYTE: {
   342  			execute:     opByte,
   343  			constantGas: GasFastestStep,
   344  			minStack:    minStack(2, 1),
   345  			maxStack:    maxStack(2, 1),
   346  		},
   347  		SHA3: {
   348  			execute:     opSha3,
   349  			constantGas: params.Sha3Gas,
   350  			dynamicGas:  gasSha3,
   351  			minStack:    minStack(2, 1),
   352  			maxStack:    maxStack(2, 1),
   353  			memorySize:  memorySha3,
   354  		},
   355  		ADDRESS: {
   356  			execute:     opAddress,
   357  			constantGas: GasQuickStep,
   358  			minStack:    minStack(0, 1),
   359  			maxStack:    maxStack(0, 1),
   360  		},
   361  		BALANCE: {
   362  			execute:     opBalance,
   363  			constantGas: params.BalanceGasFrontier,
   364  			minStack:    minStack(1, 1),
   365  			maxStack:    maxStack(1, 1),
   366  		},
   367  		ORIGIN: {
   368  			execute:     opOrigin,
   369  			constantGas: GasQuickStep,
   370  			minStack:    minStack(0, 1),
   371  			maxStack:    maxStack(0, 1),
   372  		},
   373  		CALLER: {
   374  			execute:     opCaller,
   375  			constantGas: GasQuickStep,
   376  			minStack:    minStack(0, 1),
   377  			maxStack:    maxStack(0, 1),
   378  		},
   379  		CALLVALUE: {
   380  			execute:     opCallValue,
   381  			constantGas: GasQuickStep,
   382  			minStack:    minStack(0, 1),
   383  			maxStack:    maxStack(0, 1),
   384  		},
   385  		CALLDATALOAD: {
   386  			execute:     opCallDataLoad,
   387  			constantGas: GasFastestStep,
   388  			minStack:    minStack(1, 1),
   389  			maxStack:    maxStack(1, 1),
   390  		},
   391  		CALLDATASIZE: {
   392  			execute:     opCallDataSize,
   393  			constantGas: GasQuickStep,
   394  			minStack:    minStack(0, 1),
   395  			maxStack:    maxStack(0, 1),
   396  		},
   397  		CALLDATACOPY: {
   398  			execute:     opCallDataCopy,
   399  			constantGas: GasFastestStep,
   400  			dynamicGas:  gasCallDataCopy,
   401  			minStack:    minStack(3, 0),
   402  			maxStack:    maxStack(3, 0),
   403  			memorySize:  memoryCallDataCopy,
   404  		},
   405  		CODESIZE: {
   406  			execute:     opCodeSize,
   407  			constantGas: GasQuickStep,
   408  			minStack:    minStack(0, 1),
   409  			maxStack:    maxStack(0, 1),
   410  		},
   411  		CODECOPY: {
   412  			execute:     opCodeCopy,
   413  			constantGas: GasFastestStep,
   414  			dynamicGas:  gasCodeCopy,
   415  			minStack:    minStack(3, 0),
   416  			maxStack:    maxStack(3, 0),
   417  			memorySize:  memoryCodeCopy,
   418  		},
   419  		GASPRICE: {
   420  			execute:     opGasprice,
   421  			constantGas: GasQuickStep,
   422  			minStack:    minStack(0, 1),
   423  			maxStack:    maxStack(0, 1),
   424  		},
   425  		EXTCODESIZE: {
   426  			execute:     opExtCodeSize,
   427  			constantGas: params.ExtcodeSizeGasFrontier,
   428  			minStack:    minStack(1, 1),
   429  			maxStack:    maxStack(1, 1),
   430  		},
   431  		EXTCODECOPY: {
   432  			execute:     opExtCodeCopy,
   433  			constantGas: params.ExtcodeCopyBaseFrontier,
   434  			dynamicGas:  gasExtCodeCopy,
   435  			minStack:    minStack(4, 0),
   436  			maxStack:    maxStack(4, 0),
   437  			memorySize:  memoryExtCodeCopy,
   438  		},
   439  		BLOCKHASH: {
   440  			execute:     opBlockhash,
   441  			constantGas: GasExtStep,
   442  			minStack:    minStack(1, 1),
   443  			maxStack:    maxStack(1, 1),
   444  		},
   445  		COINBASE: {
   446  			execute:     opCoinbase,
   447  			constantGas: GasQuickStep,
   448  			minStack:    minStack(0, 1),
   449  			maxStack:    maxStack(0, 1),
   450  		},
   451  		TIMESTAMP: {
   452  			execute:     opTimestamp,
   453  			constantGas: GasQuickStep,
   454  			minStack:    minStack(0, 1),
   455  			maxStack:    maxStack(0, 1),
   456  		},
   457  		NUMBER: {
   458  			execute:     opNumber,
   459  			constantGas: GasQuickStep,
   460  			minStack:    minStack(0, 1),
   461  			maxStack:    maxStack(0, 1),
   462  		},
   463  		DIFFICULTY: {
   464  			execute:     opDifficulty,
   465  			constantGas: GasQuickStep,
   466  			minStack:    minStack(0, 1),
   467  			maxStack:    maxStack(0, 1),
   468  		},
   469  		GASLIMIT: {
   470  			execute:     opGasLimit,
   471  			constantGas: GasQuickStep,
   472  			minStack:    minStack(0, 1),
   473  			maxStack:    maxStack(0, 1),
   474  		},
   475  		POP: {
   476  			execute:     opPop,
   477  			constantGas: GasQuickStep,
   478  			minStack:    minStack(1, 0),
   479  			maxStack:    maxStack(1, 0),
   480  		},
   481  		MLOAD: {
   482  			execute:     opMload,
   483  			constantGas: GasFastestStep,
   484  			dynamicGas:  gasMLoad,
   485  			minStack:    minStack(1, 1),
   486  			maxStack:    maxStack(1, 1),
   487  			memorySize:  memoryMLoad,
   488  		},
   489  		MSTORE: {
   490  			execute:     opMstore,
   491  			constantGas: GasFastestStep,
   492  			dynamicGas:  gasMStore,
   493  			minStack:    minStack(2, 0),
   494  			maxStack:    maxStack(2, 0),
   495  			memorySize:  memoryMStore,
   496  		},
   497  		MSTORE8: {
   498  			execute:     opMstore8,
   499  			constantGas: GasFastestStep,
   500  			dynamicGas:  gasMStore8,
   501  			memorySize:  memoryMStore8,
   502  			minStack:    minStack(2, 0),
   503  			maxStack:    maxStack(2, 0),
   504  		},
   505  		SLOAD: {
   506  			execute:     opSload,
   507  			constantGas: params.SloadGasFrontier,
   508  			minStack:    minStack(1, 1),
   509  			maxStack:    maxStack(1, 1),
   510  		},
   511  		SSTORE: {
   512  			execute:    opSstore,
   513  			dynamicGas: gasSStore,
   514  			minStack:   minStack(2, 0),
   515  			maxStack:   maxStack(2, 0),
   516  			writes:     true,
   517  		},
   518  		JUMP: {
   519  			execute:     opJump,
   520  			constantGas: GasMidStep,
   521  			minStack:    minStack(1, 0),
   522  			maxStack:    maxStack(1, 0),
   523  			jumps:       true,
   524  		},
   525  		JUMPI: {
   526  			execute:     opJumpi,
   527  			constantGas: GasSlowStep,
   528  			minStack:    minStack(2, 0),
   529  			maxStack:    maxStack(2, 0),
   530  			jumps:       true,
   531  		},
   532  		PC: {
   533  			execute:     opPc,
   534  			constantGas: GasQuickStep,
   535  			minStack:    minStack(0, 1),
   536  			maxStack:    maxStack(0, 1),
   537  		},
   538  		MSIZE: {
   539  			execute:     opMsize,
   540  			constantGas: GasQuickStep,
   541  			minStack:    minStack(0, 1),
   542  			maxStack:    maxStack(0, 1),
   543  		},
   544  		GAS: {
   545  			execute:     opGas,
   546  			constantGas: GasQuickStep,
   547  			minStack:    minStack(0, 1),
   548  			maxStack:    maxStack(0, 1),
   549  		},
   550  		JUMPDEST: {
   551  			execute:     opJumpdest,
   552  			constantGas: params.JumpdestGas,
   553  			minStack:    minStack(0, 0),
   554  			maxStack:    maxStack(0, 0),
   555  		},
   556  		PUSH1: {
   557  			execute:     opPush1,
   558  			constantGas: GasFastestStep,
   559  			minStack:    minStack(0, 1),
   560  			maxStack:    maxStack(0, 1),
   561  		},
   562  		PUSH2: {
   563  			execute:     makePush(2, 2),
   564  			constantGas: GasFastestStep,
   565  			minStack:    minStack(0, 1),
   566  			maxStack:    maxStack(0, 1),
   567  		},
   568  		PUSH3: {
   569  			execute:     makePush(3, 3),
   570  			constantGas: GasFastestStep,
   571  			minStack:    minStack(0, 1),
   572  			maxStack:    maxStack(0, 1),
   573  		},
   574  		PUSH4: {
   575  			execute:     makePush(4, 4),
   576  			constantGas: GasFastestStep,
   577  			minStack:    minStack(0, 1),
   578  			maxStack:    maxStack(0, 1),
   579  		},
   580  		PUSH5: {
   581  			execute:     makePush(5, 5),
   582  			constantGas: GasFastestStep,
   583  			minStack:    minStack(0, 1),
   584  			maxStack:    maxStack(0, 1),
   585  		},
   586  		PUSH6: {
   587  			execute:     makePush(6, 6),
   588  			constantGas: GasFastestStep,
   589  			minStack:    minStack(0, 1),
   590  			maxStack:    maxStack(0, 1),
   591  		},
   592  		PUSH7: {
   593  			execute:     makePush(7, 7),
   594  			constantGas: GasFastestStep,
   595  			minStack:    minStack(0, 1),
   596  			maxStack:    maxStack(0, 1),
   597  		},
   598  		PUSH8: {
   599  			execute:     makePush(8, 8),
   600  			constantGas: GasFastestStep,
   601  			minStack:    minStack(0, 1),
   602  			maxStack:    maxStack(0, 1),
   603  		},
   604  		PUSH9: {
   605  			execute:     makePush(9, 9),
   606  			constantGas: GasFastestStep,
   607  			minStack:    minStack(0, 1),
   608  			maxStack:    maxStack(0, 1),
   609  		},
   610  		PUSH10: {
   611  			execute:     makePush(10, 10),
   612  			constantGas: GasFastestStep,
   613  			minStack:    minStack(0, 1),
   614  			maxStack:    maxStack(0, 1),
   615  		},
   616  		PUSH11: {
   617  			execute:     makePush(11, 11),
   618  			constantGas: GasFastestStep,
   619  			minStack:    minStack(0, 1),
   620  			maxStack:    maxStack(0, 1),
   621  		},
   622  		PUSH12: {
   623  			execute:     makePush(12, 12),
   624  			constantGas: GasFastestStep,
   625  			minStack:    minStack(0, 1),
   626  			maxStack:    maxStack(0, 1),
   627  		},
   628  		PUSH13: {
   629  			execute:     makePush(13, 13),
   630  			constantGas: GasFastestStep,
   631  			minStack:    minStack(0, 1),
   632  			maxStack:    maxStack(0, 1),
   633  		},
   634  		PUSH14: {
   635  			execute:     makePush(14, 14),
   636  			constantGas: GasFastestStep,
   637  			minStack:    minStack(0, 1),
   638  			maxStack:    maxStack(0, 1),
   639  		},
   640  		PUSH15: {
   641  			execute:     makePush(15, 15),
   642  			constantGas: GasFastestStep,
   643  			minStack:    minStack(0, 1),
   644  			maxStack:    maxStack(0, 1),
   645  		},
   646  		PUSH16: {
   647  			execute:     makePush(16, 16),
   648  			constantGas: GasFastestStep,
   649  			minStack:    minStack(0, 1),
   650  			maxStack:    maxStack(0, 1),
   651  		},
   652  		PUSH17: {
   653  			execute:     makePush(17, 17),
   654  			constantGas: GasFastestStep,
   655  			minStack:    minStack(0, 1),
   656  			maxStack:    maxStack(0, 1),
   657  		},
   658  		PUSH18: {
   659  			execute:     makePush(18, 18),
   660  			constantGas: GasFastestStep,
   661  			minStack:    minStack(0, 1),
   662  			maxStack:    maxStack(0, 1),
   663  		},
   664  		PUSH19: {
   665  			execute:     makePush(19, 19),
   666  			constantGas: GasFastestStep,
   667  			minStack:    minStack(0, 1),
   668  			maxStack:    maxStack(0, 1),
   669  		},
   670  		PUSH20: {
   671  			execute:     makePush(20, 20),
   672  			constantGas: GasFastestStep,
   673  			minStack:    minStack(0, 1),
   674  			maxStack:    maxStack(0, 1),
   675  		},
   676  		PUSH21: {
   677  			execute:     makePush(21, 21),
   678  			constantGas: GasFastestStep,
   679  			minStack:    minStack(0, 1),
   680  			maxStack:    maxStack(0, 1),
   681  		},
   682  		PUSH22: {
   683  			execute:     makePush(22, 22),
   684  			constantGas: GasFastestStep,
   685  			minStack:    minStack(0, 1),
   686  			maxStack:    maxStack(0, 1),
   687  		},
   688  		PUSH23: {
   689  			execute:     makePush(23, 23),
   690  			constantGas: GasFastestStep,
   691  			minStack:    minStack(0, 1),
   692  			maxStack:    maxStack(0, 1),
   693  		},
   694  		PUSH24: {
   695  			execute:     makePush(24, 24),
   696  			constantGas: GasFastestStep,
   697  			minStack:    minStack(0, 1),
   698  			maxStack:    maxStack(0, 1),
   699  		},
   700  		PUSH25: {
   701  			execute:     makePush(25, 25),
   702  			constantGas: GasFastestStep,
   703  			minStack:    minStack(0, 1),
   704  			maxStack:    maxStack(0, 1),
   705  		},
   706  		PUSH26: {
   707  			execute:     makePush(26, 26),
   708  			constantGas: GasFastestStep,
   709  			minStack:    minStack(0, 1),
   710  			maxStack:    maxStack(0, 1),
   711  		},
   712  		PUSH27: {
   713  			execute:     makePush(27, 27),
   714  			constantGas: GasFastestStep,
   715  			minStack:    minStack(0, 1),
   716  			maxStack:    maxStack(0, 1),
   717  		},
   718  		PUSH28: {
   719  			execute:     makePush(28, 28),
   720  			constantGas: GasFastestStep,
   721  			minStack:    minStack(0, 1),
   722  			maxStack:    maxStack(0, 1),
   723  		},
   724  		PUSH29: {
   725  			execute:     makePush(29, 29),
   726  			constantGas: GasFastestStep,
   727  			minStack:    minStack(0, 1),
   728  			maxStack:    maxStack(0, 1),
   729  		},
   730  		PUSH30: {
   731  			execute:     makePush(30, 30),
   732  			constantGas: GasFastestStep,
   733  			minStack:    minStack(0, 1),
   734  			maxStack:    maxStack(0, 1),
   735  		},
   736  		PUSH31: {
   737  			execute:     makePush(31, 31),
   738  			constantGas: GasFastestStep,
   739  			minStack:    minStack(0, 1),
   740  			maxStack:    maxStack(0, 1),
   741  		},
   742  		PUSH32: {
   743  			execute:     makePush(32, 32),
   744  			constantGas: GasFastestStep,
   745  			minStack:    minStack(0, 1),
   746  			maxStack:    maxStack(0, 1),
   747  		},
   748  		DUP1: {
   749  			execute:     makeDup(1),
   750  			constantGas: GasFastestStep,
   751  			minStack:    minDupStack(1),
   752  			maxStack:    maxDupStack(1),
   753  		},
   754  		DUP2: {
   755  			execute:     makeDup(2),
   756  			constantGas: GasFastestStep,
   757  			minStack:    minDupStack(2),
   758  			maxStack:    maxDupStack(2),
   759  		},
   760  		DUP3: {
   761  			execute:     makeDup(3),
   762  			constantGas: GasFastestStep,
   763  			minStack:    minDupStack(3),
   764  			maxStack:    maxDupStack(3),
   765  		},
   766  		DUP4: {
   767  			execute:     makeDup(4),
   768  			constantGas: GasFastestStep,
   769  			minStack:    minDupStack(4),
   770  			maxStack:    maxDupStack(4),
   771  		},
   772  		DUP5: {
   773  			execute:     makeDup(5),
   774  			constantGas: GasFastestStep,
   775  			minStack:    minDupStack(5),
   776  			maxStack:    maxDupStack(5),
   777  		},
   778  		DUP6: {
   779  			execute:     makeDup(6),
   780  			constantGas: GasFastestStep,
   781  			minStack:    minDupStack(6),
   782  			maxStack:    maxDupStack(6),
   783  		},
   784  		DUP7: {
   785  			execute:     makeDup(7),
   786  			constantGas: GasFastestStep,
   787  			minStack:    minDupStack(7),
   788  			maxStack:    maxDupStack(7),
   789  		},
   790  		DUP8: {
   791  			execute:     makeDup(8),
   792  			constantGas: GasFastestStep,
   793  			minStack:    minDupStack(8),
   794  			maxStack:    maxDupStack(8),
   795  		},
   796  		DUP9: {
   797  			execute:     makeDup(9),
   798  			constantGas: GasFastestStep,
   799  			minStack:    minDupStack(9),
   800  			maxStack:    maxDupStack(9),
   801  		},
   802  		DUP10: {
   803  			execute:     makeDup(10),
   804  			constantGas: GasFastestStep,
   805  			minStack:    minDupStack(10),
   806  			maxStack:    maxDupStack(10),
   807  		},
   808  		DUP11: {
   809  			execute:     makeDup(11),
   810  			constantGas: GasFastestStep,
   811  			minStack:    minDupStack(11),
   812  			maxStack:    maxDupStack(11),
   813  		},
   814  		DUP12: {
   815  			execute:     makeDup(12),
   816  			constantGas: GasFastestStep,
   817  			minStack:    minDupStack(12),
   818  			maxStack:    maxDupStack(12),
   819  		},
   820  		DUP13: {
   821  			execute:     makeDup(13),
   822  			constantGas: GasFastestStep,
   823  			minStack:    minDupStack(13),
   824  			maxStack:    maxDupStack(13),
   825  		},
   826  		DUP14: {
   827  			execute:     makeDup(14),
   828  			constantGas: GasFastestStep,
   829  			minStack:    minDupStack(14),
   830  			maxStack:    maxDupStack(14),
   831  		},
   832  		DUP15: {
   833  			execute:     makeDup(15),
   834  			constantGas: GasFastestStep,
   835  			minStack:    minDupStack(15),
   836  			maxStack:    maxDupStack(15),
   837  		},
   838  		DUP16: {
   839  			execute:     makeDup(16),
   840  			constantGas: GasFastestStep,
   841  			minStack:    minDupStack(16),
   842  			maxStack:    maxDupStack(16),
   843  		},
   844  		SWAP1: {
   845  			execute:     makeSwap(1),
   846  			constantGas: GasFastestStep,
   847  			minStack:    minSwapStack(2),
   848  			maxStack:    maxSwapStack(2),
   849  		},
   850  		SWAP2: {
   851  			execute:     makeSwap(2),
   852  			constantGas: GasFastestStep,
   853  			minStack:    minSwapStack(3),
   854  			maxStack:    maxSwapStack(3),
   855  		},
   856  		SWAP3: {
   857  			execute:     makeSwap(3),
   858  			constantGas: GasFastestStep,
   859  			minStack:    minSwapStack(4),
   860  			maxStack:    maxSwapStack(4),
   861  		},
   862  		SWAP4: {
   863  			execute:     makeSwap(4),
   864  			constantGas: GasFastestStep,
   865  			minStack:    minSwapStack(5),
   866  			maxStack:    maxSwapStack(5),
   867  		},
   868  		SWAP5: {
   869  			execute:     makeSwap(5),
   870  			constantGas: GasFastestStep,
   871  			minStack:    minSwapStack(6),
   872  			maxStack:    maxSwapStack(6),
   873  		},
   874  		SWAP6: {
   875  			execute:     makeSwap(6),
   876  			constantGas: GasFastestStep,
   877  			minStack:    minSwapStack(7),
   878  			maxStack:    maxSwapStack(7),
   879  		},
   880  		SWAP7: {
   881  			execute:     makeSwap(7),
   882  			constantGas: GasFastestStep,
   883  			minStack:    minSwapStack(8),
   884  			maxStack:    maxSwapStack(8),
   885  		},
   886  		SWAP8: {
   887  			execute:     makeSwap(8),
   888  			constantGas: GasFastestStep,
   889  			minStack:    minSwapStack(9),
   890  			maxStack:    maxSwapStack(9),
   891  		},
   892  		SWAP9: {
   893  			execute:     makeSwap(9),
   894  			constantGas: GasFastestStep,
   895  			minStack:    minSwapStack(10),
   896  			maxStack:    maxSwapStack(10),
   897  		},
   898  		SWAP10: {
   899  			execute:     makeSwap(10),
   900  			constantGas: GasFastestStep,
   901  			minStack:    minSwapStack(11),
   902  			maxStack:    maxSwapStack(11),
   903  		},
   904  		SWAP11: {
   905  			execute:     makeSwap(11),
   906  			constantGas: GasFastestStep,
   907  			minStack:    minSwapStack(12),
   908  			maxStack:    maxSwapStack(12),
   909  		},
   910  		SWAP12: {
   911  			execute:     makeSwap(12),
   912  			constantGas: GasFastestStep,
   913  			minStack:    minSwapStack(13),
   914  			maxStack:    maxSwapStack(13),
   915  		},
   916  		SWAP13: {
   917  			execute:     makeSwap(13),
   918  			constantGas: GasFastestStep,
   919  			minStack:    minSwapStack(14),
   920  			maxStack:    maxSwapStack(14),
   921  		},
   922  		SWAP14: {
   923  			execute:     makeSwap(14),
   924  			constantGas: GasFastestStep,
   925  			minStack:    minSwapStack(15),
   926  			maxStack:    maxSwapStack(15),
   927  		},
   928  		SWAP15: {
   929  			execute:     makeSwap(15),
   930  			constantGas: GasFastestStep,
   931  			minStack:    minSwapStack(16),
   932  			maxStack:    maxSwapStack(16),
   933  		},
   934  		SWAP16: {
   935  			execute:     makeSwap(16),
   936  			constantGas: GasFastestStep,
   937  			minStack:    minSwapStack(17),
   938  			maxStack:    maxSwapStack(17),
   939  		},
   940  		LOG0: {
   941  			execute:    makeLog(0),
   942  			dynamicGas: makeGasLog(0),
   943  			minStack:   minStack(2, 0),
   944  			maxStack:   maxStack(2, 0),
   945  			memorySize: memoryLog,
   946  			writes:     true,
   947  		},
   948  		LOG1: {
   949  			execute:    makeLog(1),
   950  			dynamicGas: makeGasLog(1),
   951  			minStack:   minStack(3, 0),
   952  			maxStack:   maxStack(3, 0),
   953  			memorySize: memoryLog,
   954  			writes:     true,
   955  		},
   956  		LOG2: {
   957  			execute:    makeLog(2),
   958  			dynamicGas: makeGasLog(2),
   959  			minStack:   minStack(4, 0),
   960  			maxStack:   maxStack(4, 0),
   961  			memorySize: memoryLog,
   962  			writes:     true,
   963  		},
   964  		LOG3: {
   965  			execute:    makeLog(3),
   966  			dynamicGas: makeGasLog(3),
   967  			minStack:   minStack(5, 0),
   968  			maxStack:   maxStack(5, 0),
   969  			memorySize: memoryLog,
   970  			writes:     true,
   971  		},
   972  		LOG4: {
   973  			execute:    makeLog(4),
   974  			dynamicGas: makeGasLog(4),
   975  			minStack:   minStack(6, 0),
   976  			maxStack:   maxStack(6, 0),
   977  			memorySize: memoryLog,
   978  			writes:     true,
   979  		},
   980  		CREATE: {
   981  			execute:     opCreate,
   982  			constantGas: params.CreateGas,
   983  			dynamicGas:  gasCreate,
   984  			minStack:    minStack(3, 1),
   985  			maxStack:    maxStack(3, 1),
   986  			memorySize:  memoryCreate,
   987  			writes:      true,
   988  			returns:     true,
   989  		},
   990  		CALL: {
   991  			execute:     opCall,
   992  			constantGas: params.CallGasFrontier,
   993  			dynamicGas:  gasCall,
   994  			minStack:    minStack(7, 1),
   995  			maxStack:    maxStack(7, 1),
   996  			memorySize:  memoryCall,
   997  			returns:     true,
   998  		},
   999  		CALLCODE: {
  1000  			execute:     opCallCode,
  1001  			constantGas: params.CallGasFrontier,
  1002  			dynamicGas:  gasCallCode,
  1003  			minStack:    minStack(7, 1),
  1004  			maxStack:    maxStack(7, 1),
  1005  			memorySize:  memoryCall,
  1006  			returns:     true,
  1007  		},
  1008  		RETURN: {
  1009  			execute:    opReturn,
  1010  			dynamicGas: gasReturn,
  1011  			minStack:   minStack(2, 0),
  1012  			maxStack:   maxStack(2, 0),
  1013  			memorySize: memoryReturn,
  1014  			halts:      true,
  1015  		},
  1016  		SELFDESTRUCT: {
  1017  			execute:    opSuicide,
  1018  			dynamicGas: gasSelfdestruct,
  1019  			minStack:   minStack(1, 0),
  1020  			maxStack:   maxStack(1, 0),
  1021  			halts:      true,
  1022  			writes:     true,
  1023  		},
  1024  	}
  1025  }