From b1482a5cebe7e1081c2fc2f0b9111173552fd37c Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 3 Aug 2018 10:57:57 -0700 Subject: [PATCH] . --- lib/opFns.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/opFns.js b/lib/opFns.js index 4b9d2b82a8..837fbd6d3a 100644 --- a/lib/opFns.js +++ b/lib/opFns.js @@ -289,29 +289,29 @@ module.exports = { }) }, EXTCODEHASH: function (address, runState, cb) { + if (!runState._common.gteHardfork('constantinople')) { + trap(ERROR.INVALID_OPCODE) + } var stateManager = runState.stateManager address = addressToBuffer(address) if (runState._precompiled[address.toString('hex')]) { - cb(null, new BN(0)) - return + return cb(null, new BN(0)) } stateManager.exists(address, function (err, exists) { if (err) return cb(err) if (!exists) { - cb(null, new BN(0)) - return + return cb(null, new BN(0)) } stateManager.getContractCode(address, function (err, code) { if (err) return cb(err) if (code.length === 0) { - cb(null, new BN(utils.KECCAK256_NULL)) - return + return cb(null, new BN(utils.KECCAK256_NULL)) } - cb(null, new BN(utils.keccak256(code))) + return cb(null, new BN(utils.keccak256(code))) }) }) },