We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug After upgrading hardhat-ethers to 2.1.1, I can't create fake contracts based on abstract contracts or interfaces.
Smock calls hardhat.ethers.getContractAt(contractName, "0x00…000"); to get an interface of a contract:
hardhat.ethers.getContractAt(contractName, "0x00…000");
smock/src/factories/ethers-interface.ts
Line 50 in 91a7aad
However, starting from @nomiclabs/hardhat-ethers v2.1.1 getContractAt throws an error if the on-chain code at the address is "0x".
getContractAt
Reproduction steps @nomiclabs/hardhat-ethers@^2.1.1
@nomiclabs/hardhat-ethers@^2.1.1
contracts/Foo.sol
/* ... */ interface Foo { function foo() external returns (uint); }
tests/bar.ts
/* ... */ const foo = await smock.fake<Foo>("Foo"); /* ... */
Expected behavior No error
Actual behavior
Error: unable to generate smock spec from contract name. 0x0000000000000000000000000000000000000000 is not a contract account.
System Specs:
The text was updated successfully, but these errors were encountered:
The related hardhat PR: NomicFoundation/hardhat#2916
Sorry, something went wrong.
It looks like this issue have been fixed on their end.
NomicFoundation/hardhat#3301
No branches or pull requests
Describe the bug
After upgrading hardhat-ethers to 2.1.1, I can't create fake contracts based on abstract contracts or interfaces.
Smock calls
hardhat.ethers.getContractAt(contractName, "0x00…000");
to get an interface of a contract:smock/src/factories/ethers-interface.ts
Line 50 in 91a7aad
However, starting from @nomiclabs/hardhat-ethers v2.1.1
getContractAt
throws an error if the on-chain code at the address is "0x".Reproduction steps
@nomiclabs/hardhat-ethers@^2.1.1
contracts/Foo.sol
tests/bar.ts
Expected behavior
No error
Actual behavior
System Specs:
The text was updated successfully, but these errors were encountered: