openzeppelin-upgrades icon indicating copy to clipboard operation
openzeppelin-upgrades copied to clipboard

gasPrice is set to 0 with LedgerSigner

Open pcpLiu opened this issue 3 years ago • 1 comments

Hey,

I'm trying to call upgradeProxy() with a Ledger wallet via @ethersproject/hardware-wallets but found that the transaction could not be picked up by nodes since the gas prices was setup to 0 due to some bug in @ethersproject/hardware-wallets

There's an issue in repo @ethersproject/hardware-wallets. And in it, it mentioned there's a workaround by setup an option in overrides in Etheres' call function. But the plugin does not expose such deep API.

Wondering if there's any suggested quick work around? Thank you!

pcpLiu avatar Jun 15 '22 00:06 pcpLiu

Hello @pcpLiu

I believe that, until the bug is resolved, you have limited options.

Upgrading a proxy involves 3 steps:

  • checking the storage compatibility of the new implementation
  • deploying the new implementation contract
  • doing the upgrade on the proxy

Steps 2 and 3 require sending a transaction, which is where you are having issues.

IMO you have 2 options:

  1. check the storage compatibility first, then deploy and upgrade using your ledger with "manually" crafted transactions. That could work but I would not recommend it because the manifest is likely not betting updated as it should.

  2. if you have a second wallet with ether (you could create one just for that), use the prepareUpgrade with this signer. The signer will need eth to pay for the deployment, but it doesn't require any authorizations. Once the upgrade is prepared (which will update the manifest file) then you can use your ledger to sign an upgrade transaction (which should be simple enough)

Amxx avatar Jun 22 '22 09:06 Amxx