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

Update dependency @nomicfoundation/hardhat-toolbox to v5 #66

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 6, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@nomicfoundation/hardhat-toolbox (source) ^2.0.2 -> ^5.0.0 age adoption passing confidence

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 and typechain. 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:

npm install @​nomicfoundation/hardhat-toolbox@3

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:

### upgrade relevant packages
yarn add @​nomicfoundation/hardhat-toolbox@3 @​nomicfoundation/hardhat-chai-matchers@2 @​nomicfoundation/hardhat-ethers@3 @​nomicfoundation/hardhat-verify @​typechain/ethers-v6 @​typechain/hardhat@8 ethers@6

### remove packages that are no longer needed
yarn remove @​ethersproject/abi @​ethersproject/providers @​nomiclabs/hardhat-ethers @​nomiclabs/hardhat-etherscan @​typechain/ethers-v5

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:

const balance = await token.balanceOf(someAddress)

if (balance.gt(0)) {
  // ...
}

While in v6 you would do it this way:

const balance = await token.balanceOf(someAddress)

if (balance > 0n) {
  // ...
}

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:

await signer.sendTransaction({
  to: contract.address,
  value: ethers.utils.parseEther("0.1")
})

In ethers v6, you can just use the contract instance:

await signer.sendTransaction({
  to: contract,
  value: ethers.parseEther("0.1")
})
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:

console.log("Contract deployed at", contract.address)

Now you have to do this:

console.log("Contract deployed at", await contract.getAddress())

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 method

The .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:

import helpers from "@​nomicfoundation/hardhat-toolbox/network-helpers";

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from marc-aurele-besner as a code owner April 6, 2024 15:25
@renovate renovate bot added the dependencies Pull requests that update a dependency file label Apr 6, 2024
Copy link
Contributor Author

renovate bot commented Apr 6, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: wallets-tracker@1.0.1
npm ERR! Found: ethers@5.7.2
npm ERR! node_modules/ethers
npm ERR!   dev ethers@"^5.7.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer ethers@"^6.1.0" from @nomicfoundation/hardhat-ethers@3.0.5
npm ERR! node_modules/@nomicfoundation/hardhat-ethers
npm ERR!   peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/hardhat-toolbox@5.0.0
npm ERR!   node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!     dev @nomicfoundation/hardhat-toolbox@"^5.0.0" from the root project
npm ERR!   peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/hardhat-chai-matchers@2.0.6
npm ERR!   node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!     peer @nomicfoundation/hardhat-chai-matchers@"^2.0.0" from @nomicfoundation/hardhat-toolbox@5.0.0
npm ERR!     node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!       dev @nomicfoundation/hardhat-toolbox@"^5.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate/cache/others/npm/_logs/2024-05-08T15_45_35_336Z-debug-0.log

@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 11 times, most recently from 46a9c3c to 11bab3a Compare April 10, 2024 19:57
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 3 times, most recently from b65041a to 0883bc3 Compare April 22, 2024 23:23
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 3 times, most recently from a371394 to 58dbd32 Compare May 6, 2024 21:35
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch from 58dbd32 to 2c51f71 Compare May 8, 2024 15:45
Copy link
Contributor Author

renovate bot commented May 13, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: wallets-tracker@1.0.1
npm ERR! Found: ethers@5.7.2
npm ERR! node_modules/ethers
npm ERR!   dev ethers@"^5.7.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer ethers@"^6.1.0" from @nomicfoundation/hardhat-ethers@3.0.6
npm ERR! node_modules/@nomicfoundation/hardhat-ethers
npm ERR!   peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/hardhat-toolbox@5.0.0
npm ERR!   node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!     dev @nomicfoundation/hardhat-toolbox@"^5.0.0" from the root project
npm ERR!   peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/hardhat-chai-matchers@2.0.7
npm ERR!   node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!     peer @nomicfoundation/hardhat-chai-matchers@"^2.0.0" from @nomicfoundation/hardhat-toolbox@5.0.0
npm ERR!     node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!       dev @nomicfoundation/hardhat-toolbox@"^5.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate/cache/others/npm/_logs/2024-06-23T11_09_41_806Z-debug-0.log

@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 4 times, most recently from 5e7ce39 to c23a161 Compare May 20, 2024 05:06
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 4 times, most recently from 30837ab to 6f8b631 Compare May 27, 2024 16:27
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 7 times, most recently from e9898e1 to 8aa8bf4 Compare June 3, 2024 22:32
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 4 times, most recently from 3041444 to 63fd055 Compare June 11, 2024 00:35
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch 2 times, most recently from c9cbfb5 to ef1ef11 Compare June 11, 2024 15:04
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch from ef1ef11 to 53d30f3 Compare June 23, 2024 10:48
@renovate renovate bot force-pushed the renovate/nomicfoundation-hardhat-toolbox-5.x branch from 53d30f3 to c318805 Compare June 23, 2024 11:08
@marc-aurele-besner marc-aurele-besner deleted the renovate/nomicfoundation-hardhat-toolbox-5.x branch June 23, 2024 11:09
Copy link
Contributor Author

renovate bot commented Jun 23, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 5.x releases. But if you manually upgrade to 5.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant