Commit 5a1a18d0 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix: SuperchainWETH fuzz flake with bad sender (#11728)

Fixes a number of places where SuperchainWETH fuzz tests can flake
as a result of using a sender address that is the ETHLiquidity or
SuperchainWETH contract.
parent e80d23b6
...@@ -134,6 +134,8 @@ contract SuperchainWETH_Test is CommonTest { ...@@ -134,6 +134,8 @@ contract SuperchainWETH_Test is CommonTest {
{ {
// Assume // Assume
vm.assume(_chainId != block.chainid); vm.assume(_chainId != block.chainid);
vm.assume(_caller != address(ethLiquidity));
vm.assume(_caller != address(superchainWeth));
_amount = bound(_amount, 0, type(uint248).max - 1); _amount = bound(_amount, 0, type(uint248).max - 1);
// Arrange // Arrange
...@@ -233,6 +235,9 @@ contract SuperchainWETH_Test is CommonTest { ...@@ -233,6 +235,9 @@ contract SuperchainWETH_Test is CommonTest {
/// @param _amount The amount of WETH to send. /// @param _amount The amount of WETH to send.
function testFuzz_relayERC20_fromMessenger_succeeds(address _sender, uint256 _amount, uint256 _chainId) public { function testFuzz_relayERC20_fromMessenger_succeeds(address _sender, uint256 _amount, uint256 _chainId) public {
// Assume // Assume
vm.assume(_chainId != block.chainid);
vm.assume(_sender != address(ethLiquidity));
vm.assume(_sender != address(superchainWeth));
_amount = bound(_amount, 0, type(uint248).max - 1); _amount = bound(_amount, 0, type(uint248).max - 1);
// Arrange // Arrange
...@@ -272,6 +277,9 @@ contract SuperchainWETH_Test is CommonTest { ...@@ -272,6 +277,9 @@ contract SuperchainWETH_Test is CommonTest {
public public
{ {
// Assume // Assume
vm.assume(_chainId != block.chainid);
vm.assume(_sender != address(ethLiquidity));
vm.assume(_sender != address(superchainWeth));
_amount = bound(_amount, 0, type(uint248).max - 1); _amount = bound(_amount, 0, type(uint248).max - 1);
// Arrange // Arrange
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment