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