-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
T-bugType: bugType: bugT-needs-triageType: this issue needs to be labelledType: this issue needs to be labelled
Description
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge Version: 1.3.5-stable
What version of Foundryup are you on?
foundryup: 1.3.0
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
If the sender is set from within the script by passing the private key - foundry fetches the nonce for the default sender and because it doesn't change - ends up re-using the 0 nonce causing transactions to get rejected.
Nonces are fetched here:
foundry/crates/script/src/broadcast.rs
Line 50 in 75151e9
| pub async fn next_nonce( |
This is called in two places:
- new (with default sender): https://github.com/foundry-rs/foundry/blob/master/crates/script/src/lib.rs#L586
- update_sender (with custom sender): https://github.com/foundry-rs/foundry/blob/master/crates/script/src/lib.rs#L597
update_senderis only called aftermaybe_new_senderreturnsSome(sender)https://github.com/foundry-rs/foundry/blob/master/crates/script/src/execute.rs#L118
Unfortunately - maybe_new_sender only returns Some when there are libraries to predeploy. So when we have none - sender is left as default.
There is a workaround of just using --sender in CLI but would still be nice to get it fixed.
Metadata
Metadata
Assignees
Labels
T-bugType: bugType: bugT-needs-triageType: this issue needs to be labelledType: this issue needs to be labelled
Type
Projects
Status
Backlog