foundry
foundry copied to clipboard
Forge Script --broadcast -t fails
Component
Forge
Have you ensured that all of these are up to date?
- [x] Foundry
- [ ] Foundryup
What version of Foundry are you on?
forge 0.2.0 (f625d0f 2024-04-02T00:15:52.692780824Z)
What command(s) is the bug in?
forge script --verifier sourcify ./script/deploy.s.sol:Deploy --rpc-url https://eth.llamarpc.com --broadcast --no-auto-detect -t
Operating System
Linux
Describe the bug
When I try to run a script using my trezor as a wallet i get the following.
Error:
Failed to send transaction
Context:
- (code: -32603, message: failed to send tx, data: None)
maybe related https://github.com/foundry-rs/foundry/issues/7342
@wanderer could you please try updating foundry to latest nightly and running script again? we've recently migrated to new wallet adapters and this migration helped to fix some Ledger issues so Trezor connections might be fixed as well
@klkvr i update to forge 0.2.0 (89f0fb9 2024-04-14T00:20:50.727844499Z) and it "sees" the trezor now. But it doesn't use it. It still want to use PRIVATE_KEY.
in my script I have
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
Should this be replaced with a something that is trezor specific?
yeah, you should use vm.startBroadcast() or vm.startBroadcast(address) cheatcodes for hw wallets
using vm.startBroadcast(address) works, in that the trezor is signing. Broadcasting still fails though with the following error
returned an error response: error code -32000: txIndex 0 error: nonce too high: address 0xcb7c5CA542FE243bD1622d2951dEf45c8e3Aaf3F, tx: 18 state:
I have no idea what is address 0xcb7c5CA542FE243bD1622d2951dEf45c8e3Aaf3F. The address the i was deploying from does have nonce of 18.
I am using --trezor --hd-paths="m/44'/60'/0'/0/2"
Also I have tried with various RPCs
does 0xcb7c5CA542FE243bD1622d2951dEf45c8e3Aaf3F match any other addresses on your Trezor?
i check the first dozen or so paths and it does not
Issue maybe related to trezor-client package trezor/trezor-firmware#3952.
Pending Alloy release 0.1.5: https://github.com/alloy-rs/alloy/pull/1045
Marking as resolved by https://github.com/alloy-rs/alloy/releases/tag/v0.2.0 and Foundry having been bumped to 0.2.0 in https://github.com/foundry-rs/foundry/pull/8305/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542
Please re-open if this is still an issue