Fix hardhat-ledger in some chains
- [ ] Because this PR includes a bug fix, relevant tests have been included.
- [ ] Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
- [x] I didn't do anything of this.
Fixes issues: #5785 , #5786
After fixing these issues with this code, I'm able to deploy with Ledger to networks that weren't supported before like Polygon zkEVM.
🦋 Changeset detected
Latest commit: 914178c5333dcebcd541922dc30962f8b5d42a99
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @nomicfoundation/hardhat-ledger | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| hardhat | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 10, 2025 9:08pm |
@daveroga We just released a new version of hardhat (2.24.2) which wraps calls to eth_accounts, defaulting to empty array. Would it be possible for you to test with this new version and see if you are still having issues deploying to polygon or zkEVM ?
@daveroga We just released a new version of hardhat (2.24.2) which wraps calls to eth_accounts, defaulting to empty array. Would it be possible for you to test with this new version and see if you are still having issues deploying to polygon or zkEVM ?
@antico5 I tested and seems that issue for eth_accounts is solved but I still have error for only supporting legacy transactions on zkEVM:
ProviderError: RPC error response: only legacy transactions are supported
I solved this issue in my patch by forcing legacy transaction before signing tx in _ethSendTransaction if EIP1559 fields were not present.
...
if (!hasEip1559Fields) {
baseTx.type = 0; // Legacy transaction type
}
const txToSign =
ethers.Transaction.from(baseTx).unsignedSerialized.substring(2);
...
Thanks @daveroga, you are right #5786 is still an issue.
We are looking now at porting the hardhat-ledger plugin to Hardhat 3. That should give us an opportunity to test chains that require legacy transactions and validate your approach.
Resolved by #6983