fix: [ethers-v6] codegen/hardhat.ts DeployContractOptions expected #852
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is merged now (needed a lint fix and a changeset added):
Issue
@nomicfoundation/hardhat-ethers@3.0.1 added support for transaction overrides in the
deployContract
helper.Specifically, these are the changes NomicFoundation/hardhat@d8056fb.
Here's issue raised in
hardhat
repository:Fix
Replaced
FactoryOptions
withDeployContractOptions
, and added import for it. Reran the tests to fix other files.Context
A new project is created:
npm init -y npm install --save-dev hardhat npx hardhat # Create a TypeScript project npx hardhat compile
It installs
@nomicfoundation/hardhat-ethers" v3.0.4. As hardhat uses [@typechain/ethers-v6](https://github.com/NomicFoundation/hardhat/blob/c2943366d4f16282c10f92f9f216ac08130a0eb4/yarn.lock#L1672), I've only updated
packages/target-ethers-v6/src/codegen/hardhat.ts`, which should be enough to resolve the issue.The provided
scripts/deploy.ts
contains:IDE complains about
{ value: lockedAmount }
. Third parameter inethers.deployContract
used to be forsignerOrOptions?: ethers.Signer | FactoryOptions
but was changed tosignerOrOptions?: ethers.Signer | DeployContractOptions
Visual Studio Code: