Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardhat-gas-reporter conflicts with smockit library #57

Open
notsegfault opened this issue Feb 17, 2021 · 1 comment
Open

hardhat-gas-reporter conflicts with smockit library #57

notsegfault opened this issue Feb 17, 2021 · 1 comment

Comments

@notsegfault
Copy link

notsegfault commented Feb 17, 2021

When both are specified in hardhat.config.js

using version 1.0.4

require('@eth-optimism/smock/build/src/plugins/hardhat-storagelayout');
require("hardhat-gas-reporter");

It's impossible to create mocks like this:

const MyMock = await ethers.getContractFactory(
  "MyMockContract"
);
const mock = await MyMock.deploy();
await mock.deployed();

Error:

TypeError: Cannot read property 'from' of undefined
at addGasToAbiMethodsIfNecessary (node_modules/@nomiclabs/hardhat-ethers/src/helpers.ts:313:30)
at getContractFactoryByAbiAndBytecode (node_modules/@nomiclabs/hardhat-ethers/src/helpers.ts:254:27)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

If I try to yarn add ethers, the error changes to this:

TypeError: provider._init is not a function
at exports.smockit (node_modules/@eth-optimism/smock/src/smockit/smockit.ts:22:35)

It seems to be related to a conflict in both library ethers versions or BigNumber. If the bug is not related to hardhat-gas-reporter, I'll report to smockit instead.

@cgewecke
Copy link
Owner

Thanks for reporting. Suspect it's a bug here, unfortunately 😄

Will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants