Hardhat-ledger plugin error using rpc nodes that don't support eth_accounts
Version of Hardhat
2.22.10
What happened?
Trying to deploy smart contracts through hardhat and hardhat-ledger plugin (1.0.3) to Polygon zkEVM networks (Cardona or Mainnet) is not possible because it throws an error when trying to get accounts with eth_accounts.
In hardhat-ledger provider I see that is failing in this code when trying to get accounts through eth_accounts when the rpc node is not supporting this in the API:
if (args.method === "eth_accounts") {
const accounts = (await this._wrappedProvider.request(args));
return [...accounts, ...this.options.accounts];
}
Minimal reproduction steps
- Install
hardhat-ledgerplugin following the instructions here https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-ledger - Try to deploy a smart contract to zkEVM Cardona with some faucet through
ledgerAccountsaddress with any Ledger device.
Search terms
hardhat-ledger zkevm getaccounts eth_accounts
Thanks for the reported error.
I suspect we want there is to guard against eth_accounts throwing and return [] as if there were no unlocked accounts.
Is this problem solved? i am still getting this
Is this problem solved? i am still getting this
Not solved yet. We still have a patch for this in our project https://github.com/iden3/contracts/blob/master/patches/%40nomicfoundation%2Bhardhat-ledger%2B1.0.3.patch
Is this problem solved? i am still getting this
Not solved yet. We still have a patch for this in our project https://github.com/iden3/contracts/blob/master/patches/%40nomicfoundation%2Bhardhat-ledger%2B1.0.3.patch
I don't encounter it. i just changed the RPC to public one
Hey we released a general fix for deprecated eth_accounts in v2.24.2: https://github.com/NomicFoundation/hardhat/releases/tag/hardhat%402.24.2
Hey we released a general fix for deprecated
eth_accountsinv2.24.2: https://github.com/NomicFoundation/hardhat/releases/tag/hardhat%402.24.2
Hey @kanej . The issue about eth_accounts is solved but I still have the issue about legacy transactions in networks like zkEVM.
I left a comment here explaining how I solved the issue in my patch.
Thanks