Closed bugduino closed 1 year ago
Found the same problem today migrating a hardhat deployment script to use LedgerSigner
, and can confirm this solved the problem:
gasPrice: (tx.gasPrice || tx.maxFeePerGas || undefined),
I'm not entirely sure how easy it would be to make LedgerSigner
support EIP 1559, but at least this allows sending old-style transactions using ethers.js + a Ledger hardware wallet.
Ah, apparently someone already solved it here: https://github.com/ethers-io/ethers.js/pull/1971/
ethers-io/ethers.js#1971 is still not merged?
I worked around it by adding { type: 1 } to the overrides when creating the transaction.
Found the same root cause after 2 hours of frustrating debugging. Solution that @maraoz described seems like a good short-term option and would probably save people lots of headache until proper EIP 1559 support can be added. Can confirm that as @acryptosx adding { type: 1 }
to overrides works as a workaround for now.
ran into the same issue, others might want to use frame, worked like a charm: https://github.com/NomicFoundation/hardhat/issues/1159#issuecomment-789310120
The new @ethers-ext/signer-ledger
(this package) should has been completely re-written. This issue should be addressed by the latest version, so I'm going to close this. If you still experience a problem, please re-open.
Thanks! :)
Thanks for the update @ricmoo, is the package correctly published on npm / yarn registry? I tried installing it but it seems that is not present as npm i @ethers-ext/signer-ledger
yields
Not Found - GET https://registry.npmjs.org/@ethers-ext%2fsigner-ledger - Not found
'@ethers-ext/signer-ledger@*' is not in this registry.
Sorry! Looks like I hadn’t published it to npm. It is now published. :)
Hi, I'm using
"ethers": "5.4.7"
with"@ethersproject/hardware-wallets": "5.4.0"
in an hardhat project and I'm trying to sign a transaction with LedgerSigner but the transaction gas price is always set to 0.After debugging a bit it seems that the problem lies here: https://github.com/ethers-io/ethers.js/blob/master/packages/hardware-wallets/src.ts/ledger.ts#L96-L108
the
transaction
argument and the subsequenttx
variable are in this form for eip 1559 transactions:but when building the
baseTx
object the only reference used for setting the gas price is thegasPrice
key which is not present anymore sogasPrice
is alwaysundefined
.I've made a simple fix locally by changing how
gasPrice
is built so to be able to make it workbut I'm sure that there a better way to manage this