-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toggle to update nonce only on first operation to avoid nonce mis…
…match with the network
- Loading branch information
Showing
8 changed files
with
98 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.18; | ||
|
||
import "forge-std/Test.sol"; | ||
import {Greeter} from "../src/Greeter.sol"; | ||
|
||
contract NonceMismatchTest is Test { | ||
function setUp() public { | ||
// Deploy contracts in setup to increment nonce | ||
new Greeter(); | ||
new Greeter(); | ||
new Greeter(); | ||
new Greeter(); | ||
} | ||
|
||
function testNonceMismatch() public { | ||
uint256 nonce = vm.getNonce(address(tx.origin)); | ||
assertEq(nonce, 2); | ||
|
||
// Deploy another contract | ||
new Greeter(); | ||
|
||
uint256 newNonce = vm.getNonce(address(tx.origin)); | ||
assertEq(newNonce, 2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ mod ownership; | |
mod paymaster; | ||
mod proxy; | ||
mod repros; | ||
mod setup_script; | ||
mod traces; | ||
mod setup_script; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters