Skip to content

Commit 382ce46

Browse files
committed
add some ETH checks to be thorough
1 parent a06f385 commit 382ce46

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/EIP7702Proxy/TokenReceive.t.sol

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,28 @@ contract TokenReceiveTest is CoinbaseImplementationTest {
8282
token.transfer(uninitProxy, TOKEN_AMOUNT);
8383
assertEq(token.balanceOf(uninitProxy), TOKEN_AMOUNT);
8484
}
85+
86+
function test_succeeds_ETHTransfer_afterInitialization() public {
87+
// Fund test contract
88+
vm.deal(address(this), 1 ether);
89+
90+
// Send ETH to initialized wallet
91+
(bool success, ) = _eoa.call{value: 1 ether}("");
92+
assertTrue(success);
93+
assertEq(_eoa.balance, 1 ether);
94+
}
95+
96+
function test_succeeds_ETHTransfer_beforeInitialization() public {
97+
// Deploy proxy without initializing
98+
address payable uninitProxy = payable(makeAddr("uninitProxy"));
99+
_deployProxy(uninitProxy);
100+
101+
// Fund test contract
102+
vm.deal(address(this), 1 ether);
103+
104+
// Send ETH to uninitialized wallet
105+
(bool success, ) = uninitProxy.call{value: 1 ether}("");
106+
assertTrue(success);
107+
assertEq(uninitProxy.balance, 1 ether);
108+
}
85109
}

0 commit comments

Comments
 (0)