[Snyk] Upgrade hardhat from 2.12.6 to 2.13.1 #32
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 was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade hardhat from 2.12.6 to 2.13.1.
As this is a private repository, Snyk-bot does not have access. Therefore, this PR has been created automatically, but appears to have been created by a real user.
✨ Snyk has automatically assigned this pull request, set who gets assigned.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: hardhat
This release adds support for the upcoming Shanghai hardfork. This hardfork is not enabled by default; if you want to use it, then you have to enable it in your Hardhat config:
Besides that, this version fixes a problem when importing scoped packages in a Yarn Berry monorepo that uses PnP (thanks @ zouguangxian!)
This new version of Hardhat adds two long-awaited features: ES Modules support, and better support for solc’s IR-based compilation pipeline. Besides that, this version includes several other improvements and bug fixes.
Remember to give this repo a star ⭐ if you are enjoying Hardhat!
ES Modules support
Hardhat was designed with CommonJS in mind, but in the last years adoption of ES Modules (ESM) has been growing. This version includes better support for it. You can now write scripts and tests as ESM, but your Hardhat config —and anything imported from it— still needs to use CommonJS.
ES modules let you use
import
/export
and top-level await. This means that instead of writing a script like this:const helpers = require("@ nomicfoundation/hardhat-network-helpers");
async function main() {
const latestBlockNumber = await helpers.time.latestBlock();
console.log("Latest block:", latestBlockNumber);
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
you can now write a less verbose ESM script:
import helpers from "@ nomicfoundation/hardhat-network-helpers";
const latestBlockNumber = await helpers.time.latestBlock();
console.log("Latest block:", latestBlockNumber);
Check our guide about Using ES modules with Hardhat to learn more.
Huge thanks to @ phated, who started the work on this and helped us along the way.
IR-based compilation pipeline
The
solc
compiler has a newer, alternative way of generating bytecode through an intermediate representation (IR). Previous versions of Hardhat don’t work well with this compilation mode, especially when the optimizer is fully-enabled.This release adds better support for the IR compilation pipeline, but you might still get some issues if you use the default settings. We recommend enabling the minimal necessary optimization steps when compiling with IR:
You can learn more about Hardhat and IR here.
Other improvements
In addition to ES Modules and compiling with the IR-based pipeline, this version includes these improvements and bug fixes:
resolveJsonModule
compiler option is now enabled by default in the sample tsconfig (thanks @ mlshv!)Commit messages
Package name: hardhat
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
👩💻 Set who automatically gets assigned
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs