-
Notifications
You must be signed in to change notification settings - Fork 42
Fix: Update hardhat and plugins versions #417
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
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 21958227451Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the Hardhat toolchain (Hardhat + verify + ledger) and adapts the contract verification helper/config to work with the updated hardhat-verify behavior that requires an explicit provider.
Changes:
- Bump Hardhat and related plugins (
hardhat-verify,hardhat-ledger) and refresh the lockfile accordingly. - Remove
patch-packageusage and delete the previously-applied hardhat-ledger patch. - Update verification helper to pass an explicit verification provider (
etherscan/blockscout) and update Hardhat network account configuration to be shared across networks.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
patches/README.md |
Removes documentation for the removed patch-package workflow. |
patches/@nomicfoundation+hardhat-ledger+3.0.1.patch |
Deletes the hardhat-ledger patch previously applied during postinstall. |
package.json |
Updates Hardhat/plugin versions and removes patch-package + postinstall. |
package-lock.json |
Lockfile refresh to reflect dependency upgrades/removals. |
helpers/helperUtils.ts |
Adds explicit provider selection for verification calls (etherscan/blockscout). |
hardhat.config.ts |
Refactors network account configuration and updates Blockscout explorer URLs for Billions networks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8697167 to
19b3964
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -102,6 +103,7 @@ export async function verifyContract( | |||
| contract: opts.contract, | |||
| constructorArgs: opts.constructorArgsProxy, | |||
| libraries: opts.libraries, | |||
| provider: chainDescriptor?.blockExplorers?.etherscan ? "etherscan" : "blockscout", | |||
| }, | |||
| hre, | |||
| ); | |||
| @@ -116,6 +118,7 @@ export async function verifyContract( | |||
| contract: opts.contract, | |||
| constructorArgs: opts.constructorArgsProxyAdmin, | |||
| libraries: opts.libraries, | |||
| provider: chainDescriptor?.blockExplorers?.etherscan ? "etherscan" : "blockscout", | |||
| }, | |||
| hre, | |||
| ); | |||
| @@ -129,6 +132,7 @@ export async function verifyContract( | |||
| contract: opts.contract, | |||
| constructorArgs: opts.constructorArgsImplementation, | |||
| libraries: opts.libraries, | |||
| provider: chainDescriptor?.blockExplorers?.etherscan ? "etherscan" : "blockscout", | |||
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provider selection logic defaults to "blockscout" when chainDescriptor is undefined or doesn't have an etherscan blockExplorer. However, chainDescriptors in hardhat.config.ts only contains entries for chain IDs 6913 and 45056 (billions networks). For all other networks (polygon-mainnet, ethereum-mainnet, etc.) that use Etherscan, chainDescriptor will be undefined, causing the provider to incorrectly default to "blockscout" instead of "etherscan". This will likely cause verification to fail on networks like Polygon Mainnet (137), Ethereum Mainnet (1), etc.
Consider either:
- Adding chainDescriptor entries for all networks with proper blockExplorer configuration
- Reversing the logic to default to "etherscan" when chainDescriptor is undefined
- Using a different mechanism to determine the correct provider for each network
|
|
||
| export const LEDGER_ACCOUNT = | ||
| process.env.LEDGER_ACCOUNT || "0x0000000000000000000000000000000000000000"; | ||
| export const LEDGER_ACCOUNT = process.env.LEDGER_ACCOUNT || undefined; |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing LEDGER_ACCOUNT default from "0x0000000000000000000000000000000000000000" to undefined is a breaking change. In hardhat.config.ts, the accounts configuration now uses LEDGER_ACCOUNT in a conditional check. If LEDGER_ACCOUNT is undefined, the condition LEDGER_ACCOUNT ? { ledgerAccounts: [LEDGER_ACCOUNT] } : { ... } will work correctly. However, if users had LEDGER_ACCOUNT set to an empty string in their environment, it will now be treated as truthy and cause ledgerAccounts: [""] to be set, which could lead to errors. Consider checking for both undefined and empty string: LEDGER_ACCOUNT && LEDGER_ACCOUNT.trim() ? ...
| @@ -322,8 +313,8 @@ export default defineConfig({ | |||
| blockExplorers: { | |||
| blockscout: { | |||
| name: "billions-mainnet", | |||
| url: "https://billions-rpc.eu-north-2.gateway.fm", | |||
| apiUrl: "https://billions-rpc.eu-north-2.gateway.fm/api/", | |||
| url: "https://explorer.billions.network", | |||
| apiUrl: "https://explorer.billions.network/api/", | |||
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The block explorer URLs for billions networks have been updated from gateway.fm endpoints to billions.network endpoints. Please ensure these new endpoints are accessible and support the same API as the old ones, as the verification scripts depend on these URLs being correct.
| "@nomicfoundation/hardhat-ledger": "^3.0.2", | ||
| "@nomicfoundation/hardhat-toolbox-mocha-ethers": "^3.0.2", | ||
| "@nomicfoundation/hardhat-verify": "^3.0.8", | ||
| "@nomicfoundation/hardhat-verify": "^3.0.10", |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch for hardhat-ledger that handled unsupported eth_accounts RPC method in zkEVM networks has been removed with the upgrade to version 3.0.2. Please verify that zkEVM networks (zkevm-mainnet at chainId 1101 and zkevm-cardona at chainId 2442) still work correctly with Ledger accounts after this change. The patch was specifically addressing the fact that zkEVM RPC or CDK chains don't support eth_accounts. If the upstream package hasn't fixed this, deployments to these networks using Ledger accounts may fail.
Uh oh!
There was an error while loading. Please reload this page.