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