From f1e82637d44877d0806575f2d9c88e16e6a864ab Mon Sep 17 00:00:00 2001 From: cgewecke Date: Thu, 26 Aug 2021 19:48:21 -0700 Subject: [PATCH] Use conditional fork check when configuring gas price --- package.json | 2 +- plugins/resources/nomiclabs.utils.js | 7 +++++-- yarn.lock | 18 +++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index b0cc6bf..020926e 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@truffle/contract": "^4.0.36", "buidler-gas-reporter": "^0.1.3", "decache": "^4.5.1", - "hardhat": "^2.5.0", + "hardhat": "^2.6.1", "hardhat-gas-reporter": "^1.0.1", "mocha": "5.2.0", "nyc": "^14.1.1", diff --git a/plugins/resources/nomiclabs.utils.js b/plugins/resources/nomiclabs.utils.js index fde8c30..443a60d 100644 --- a/plugins/resources/nomiclabs.utils.js +++ b/plugins/resources/nomiclabs.utils.js @@ -126,8 +126,11 @@ function configureHardhatEVMGas(networkConfig, api){ networkConfig.allowUnlimitedContractSize = true; networkConfig.blockGasLimit = api.gasLimitNumber; networkConfig.gas = api.gasLimit; - networkConfig.gasPrice = api.gasPrice; - networkConfig.initialBaseFeePerGas = 0; + + // TODO: etherumjs.gte here or equiv. This will break after london. + if (networkConfig.hardfork !== 'london') { + networkConfig.gasPrice = api.gasPrice; + } } function configureNetworkEnv(env, networkName, networkConfig, provider, isHardhatEVM){ diff --git a/yarn.lock b/yarn.lock index a564efd..9a35cb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -131,10 +131,10 @@ "@ethereumjs/common" "^2.4.0" ethereumjs-util "^7.1.0" -"@ethereumjs/vm@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.5.0.tgz#d389c5792320ef28c51366a643b8ab9d64e10a31" - integrity sha512-h6Kr6WqKUP8nVuEzCWPWEPrC63v7HFwt3gRuK7CJiyg9S0iWSBKUA/YVD4YgaSVACuxUfWaOBbwV5uGVupm5PQ== +"@ethereumjs/vm@^5.5.2": + version "5.5.2" + resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.5.2.tgz#918a2c1000aaa9fdbe6007a4fdc2c62833122adf" + integrity sha512-AydZ4wfvZAsBuFzs3xVSA2iU0hxhL8anXco3UW3oh9maVC34kTEytOfjHf06LTEfN0MF9LDQ4ciLa7If6ZN/sg== dependencies: "@ethereumjs/block" "^3.4.0" "@ethereumjs/blockchain" "^5.4.0" @@ -3562,16 +3562,16 @@ hardhat-gas-reporter@^1.0.1: dependencies: eth-gas-reporter "^0.2.19" -hardhat@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.5.0.tgz#0a10bf85d9b2c3c7c12cfa4e35454296c670c054" - integrity sha512-S5CWcmiFZlFF2qFGyf5LlgVnJDXwTs5UBKU3GPQCjsUD3NAIWzXr/4xDSij3YWdg751axgLiKAJM01cHcxGb7A== +hardhat@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.6.1.tgz#4553ca555c1ba8ed7c3c5a5a93e6082a2869b3ae" + integrity sha512-0LozdYbPsiTc6ZXsfDQUTV3L0p4CMO5TRbd5qmeWiCYGmhd+7Mvdg4N+nA8w0g3gZ2OKFUmHIYlAbExI488ceQ== dependencies: "@ethereumjs/block" "^3.4.0" "@ethereumjs/blockchain" "^5.4.0" "@ethereumjs/common" "^2.4.0" "@ethereumjs/tx" "^3.3.0" - "@ethereumjs/vm" "^5.5.0" + "@ethereumjs/vm" "^5.5.2" "@ethersproject/abi" "^5.1.2" "@sentry/node" "^5.18.1" "@solidity-parser/parser" "^0.11.0"