Skip to content

Commit

Permalink
vm -> spuriousDragon: added Byzantium HF checks for STATICCALL (EIP-2…
Browse files Browse the repository at this point in the history
…14) and REVERT (EIP-140)
  • Loading branch information
holgerd77 committed Jun 25, 2020
1 parent 9d3d3f2 commit cefbc00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vm/lib/evm/opFns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ export const handlers: { [k: string]: OpHandler } = {
runState.stack.push(ret)
},
STATICCALL: async function (runState: RunState) {
if (!runState._common.gteHardfork('byzantium')) {
trap(ERROR.INVALID_OPCODE)
}
const value = new BN(0)
let [gasLimit, toAddress, inOffset, inLength, outOffset, outLength] = runState.stack.popN(6)
const toAddressBuf = addressToBuffer(toAddress)
Expand Down Expand Up @@ -803,6 +806,9 @@ export const handlers: { [k: string]: OpHandler } = {
runState.eei.finish(returnData)
},
REVERT: function (runState: RunState) {
if (!runState._common.gteHardfork('byzantium')) {
trap(ERROR.INVALID_OPCODE)
}
const [offset, length] = runState.stack.popN(2)
subMemUsage(runState, offset, length)
let returnData = Buffer.alloc(0)
Expand Down

0 comments on commit cefbc00

Please sign in to comment.