Skip to content

Commit

Permalink
fix(EVM): Add static MCOPY cost (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Dec 6, 2024
1 parent 5ec8486 commit fa6eb3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system-contracts/contracts/EvmEmulator.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,8 @@ object "EvmEmulator" {
ip := add(ip, 1)
}
case 0x5E { // OP_MCOPY
evmGasLeft := chargeGas(evmGasLeft, 3)

let destOffset, offset, size
popStackCheck(sp, 3)
destOffset, sp, stackHead := popStackItemWithoutCheck(sp, stackHead)
Expand Down Expand Up @@ -5109,6 +5111,8 @@ object "EvmEmulator" {
ip := add(ip, 1)
}
case 0x5E { // OP_MCOPY
evmGasLeft := chargeGas(evmGasLeft, 3)

let destOffset, offset, size
popStackCheck(sp, 3)
destOffset, sp, stackHead := popStackItemWithoutCheck(sp, stackHead)
Expand Down
2 changes: 2 additions & 0 deletions system-contracts/evm-emulator/EvmEmulatorLoop.template.yul
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ for { } true { } {
ip := add(ip, 1)
}
case 0x5E { // OP_MCOPY
evmGasLeft := chargeGas(evmGasLeft, 3)

let destOffset, offset, size
popStackCheck(sp, 3)
destOffset, sp, stackHead := popStackItemWithoutCheck(sp, stackHead)
Expand Down

0 comments on commit fa6eb3e

Please sign in to comment.