Possible to deploy contract to polygon with Ledger?

186 Views Asked by At

I'm trying to deploy a contract to Polygon using a Ledger device thru Truffle. However, the signature returned is invalid because it appears ledger wraps the chainID at 127.

https://github.com/LedgerHQ/ledgerjs-legacy/blob/6d655aa89b748e50ae15c0cfb30c08f2215f6d84/packages/web3-subprovider/src/index.js#L143

I've mostly duplicated this sample. I get the signature correctly, but then truffle (correctly) points out that the signature is no good because of the bad v parameter.

Has anyone successfully deployed a contract on Polygon using Ledger?

1

There are 1 best solutions below

0
On

Figured it out - the problem was I was trying to use ethers.js LedgerSigner, which uses out-of-date versions of the ledger libraries.

Removing that library, wrote my own LedgerSigner with latest ledger libraries fixed that issue.