Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ledger --hd-paths returns "Ledger device not available" #4692

Closed
2 tasks done
bschreck opened this issue Apr 3, 2023 · 4 comments
Closed
2 tasks done

Ledger --hd-paths returns "Ledger device not available" #4692

bschreck opened this issue Apr 3, 2023 · 4 comments
Labels
C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug T-to-investigate Type: to investigate
Milestone

Comments

@bschreck
Copy link

bschreck commented Apr 3, 2023

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (f7a535d 2023-04-03T00:04:49.769079000Z)

What command(s) is the bug in?

forge script <script.s.sol> --chain-id 137 --rpc-url $POLYGON_RPC_URL --ledger --broadcast --hd-paths "m44'60'/0'/1/0" --sender

Operating System

macOS (Apple Silicon)

Describe the bug

I've tried many versions of the above command with different hd-path variants, removing the m and the last /0. I'm trying to deploy using the second address on my ledger, but even using the hd-path of the first address does not work. The command works fine if I leave out --hd-paths and deploy using the first address of my ledger as the --sender.

I get

Error: 
Ledger device not available.

Context:
- Received unexpected response from device. Expected data in response, found none.
@bschreck bschreck added the T-bug Type: bug label Apr 3, 2023
@gakonst gakonst added this to Foundry Apr 3, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Apr 3, 2023
@mds1 mds1 added C-forge Command: forge Cmd-forge-script Command: forge script labels Apr 4, 2023
@gpsanant
Copy link

gpsanant commented Jun 9, 2023

+1 on this. Anything with the --hd-paths flag breaks for me. Using --sender with the first address derived from my ledger's mnemonic works perfect. Pretty inconvenient though, as I wanted to use a different address...

@brayansdt
Copy link

I was also having the same problem when using the --hd-paths option, however, it works if I use the --mnemonic-indexes option.

eg:

➜  ✗ forge script --rpc-url $SEPOLIA_URL  script/....s.sol --ledger --mnemonic-indexes 1 --sender 0x... --verify --broadcast

@zerosnacks
Copy link
Member

@bschreck / @gpsanant / @brayansdt would be great to know if you are still facing issues around this

Foundry has recently moved to Alloy's Ledger implementation so it is likely your issue may have been resolved

@zerosnacks zerosnacks reopened this Jul 1, 2024
@zerosnacks zerosnacks added the T-to-investigate Type: to investigate label Jul 1, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy
Copy link
Collaborator

I confirm this works with latest version but the derivation path in original comment is wrong (that is m44'60'/0'/1/0 instead m/44'60'/0'/1/0)

forge script script/Counter.s.sol --rpc-url RPC_URL --ledger --broadcast --hd-paths "m/44'/60'/1'/1/0" --sender SENDER
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully.

## Setting up 1 EVM.

==========================

Chain 137

Estimated gas price: 30.000000052 gwei

Estimated total gas used for script: 138729

Estimated amount required: 0.004161870007213908 ETH

==========================

Transactions saved to: /broadcast/Counter.s.sol/137/run-latest.json

Sensitive values saved to: /cache/Counter.s.sol/137/run-latest.json

going to close the issue, @bschreck @gpsanant @brayansdt please reopen if you still hit problems. thank you!

@grandizzy grandizzy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug T-to-investigate Type: to investigate
Projects
Status: Done
Development

No branches or pull requests

6 participants