Skip to content

Wrong nonce when setting the deployer in a script #12646

@LogvinovLeon

Description

@LogvinovLeon

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:

pub async fn next_nonce(

This is called in two places:

There is a workaround of just using --sender in CLI but would still be nice to get it fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions