Reproduction Steps
- Run a local evmd node (Reference: GUIDE.md)
- Attempt to deploy multiple contracts in a single script without using the
--slow flag
forge script script/DeployUniswapV3.s.sol --rpc-url $RPC_URL --broadcast --chain-id $CHAIN_ID
Observed Behavior
- Without the
--slow flag, the deployment fails with a nonce mismatch error.
- Transactions are sent too quickly without waiting for previous transactions to be mined and confirmed.
- As a result, the nonces in subsequent transactions are not aligned properly.
Logs
Error: Failed to send transaction
Context:
- server returned an error response: error code -32000: invalid nonce; got 50, expected 49: invalid sequence: invalid sequence
Additional Information
--slow
Makes sure a transaction is sent, only after its previous one has been confirmed and succeeded
Notes
- When sending multiple transactions in a single script (such as deploying Uniswap V3 contracts), the
--slow flag is mandatory.
Reproduction Steps
--slowflagObserved Behavior
--slowflag, the deployment fails with a nonce mismatch error.Logs
Error: Failed to send transaction Context: - server returned an error response: error code -32000: invalid nonce; got 50, expected 49: invalid sequence: invalid sequenceAdditional Information
The
--slowflag ensures that each transaction is only sent after the previous one has been confirmed and succeeded.From forge
--help:--slow Makes sure a transaction is sent, only after its previous one has been confirmed and succeededNotes
--slowflag is mandatory.