Update dependency @nomicfoundation/hardhat-toolbox to v5 #114
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 PR contains the following updates:
^2.0.2
->^5.0.0
Release Notes
nomicfoundation/hardhat (@nomicfoundation/hardhat-toolbox)
v5.0.0
Compare Source
This version of Hardhat Toolbox adds Hardhat Ignition as the default deployment system. See the Hardhat Ignition docs for more information.
v4.0.0
Compare Source
This version of Hardhat Toolbox bumps the versions of
hardhat-verify
andtypechain
. This is a new major because the new versions of those peer dependencies are not compatible with the previous ones, but you can consider this a low-risk upgrade.v3.0.0
: Hardhat Toolbox v3.0.0: ethers v6, bigints and more!Compare Source
This new major version of Hardhat Toolbox is based on ethers v6 and uses new versions of the
hardhat-ethers
,hardhat-chai-matchers
and typechain plugins.Using in a new project
Nothing has changed in how you use the Toolbox for a new project: if you initialize one with the latest version of Hardhat, then this version of the Toolbox will be used. Check our Setting up a project guide for the complete instructions.
Upgrading an existing project
To use this new version of the Toolbox in an existing project, you need to upgrade the Toolbox and its relevant peer dependencies.
If you are using npm 7 or later, you just need to upgrade the Toolbox and npm will handle the rest:
If you are using yarn or an older version of npm, you’ll need to manually upgrade all the relevant packages and remove the ones that are no longer needed:
What’s new?
Ethers v6 has several changes with respect to v5. These are some of them, but check their migration guide for the full details.
Native bigints
One of the most important changes in v6 is that now native bigints are used instead of BigNumber objects. For example, checking if an address has a positive amount of tokens is done like this in v5:
While in v6 you would do it this way:
For more info on native bigints, check the MDN page.
ethers.utils
In ethers v6,
ethers.utils
doesn’t exist anymore. In many cases, just removing.utils
is enough to adapt your code, but other functions were renamed. Again, check ethers’s migration guide to learn more.Signers and contracts can be used as addresses
Sending ether to a contract was done like this in ethers v5:
In ethers v6, you can just use the contract instance:
Address property of contracts
Contract instances in ethers v5 had a
.address
property with the address of the contract. In ethers v6 this was replaced by an async.getAddress()
function. That is, before you would do this:Now you have to do this:
Alternatively, you can use the
.target
property, but keep in mind that this might not work in some scenarios (for example, if you create a contract instance with an ENS address)..deployed
methodThe
.deployed()
method of contracts is now called.waitForDeployment()
Network helpers re-export
When the Toolbox is installed using npm 7 or later, its peer dependencies are automatically installed. However, these dependencies won't be listed in the
package.json
. As a result, directly importing the Network Helpers can be problematic for certain tools or IDEs. To address this issue, this new version of the Toolbox re-exports the Hardhat Network Helpers. You can use them like this now:Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.