@@ -7,12 +7,7 @@ import {Wallet1} from "../src/Wallet1.sol";
77
88contract ReentrancyTest {
99 function reenter () public {
10- (bool success , ) = msg .sender .call (
11- abi.encodeWithSelector (
12- Wallet1.changeOwner1da7b.selector ,
13- address (this )
14- )
15- );
10+ (bool success ,) = msg .sender .call (abi.encodeWithSelector (Wallet1.changeOwner1da7b.selector , address (this )));
1611 require (success);
1712 }
1813
@@ -37,16 +32,8 @@ contract TestSetupWallet1 is Test {
3732 }
3833
3934 function testInitialState () public {
40- assertEq (
41- proxyWallet.getOwner15569 (),
42- address (owner),
43- "Owner should be contract deployer "
44- );
45- assertEq (
46- proxy.getImplementation1599d (),
47- address (wallet1),
48- "Implementation should be set correctly "
49- );
35+ assertEq (proxyWallet.getOwner15569 (), address (owner), "Owner should be contract deployer " );
36+ assertEq (proxy.getImplementation1599d (), address (wallet1), "Implementation should be set correctly " );
5037 }
5138
5239 function testReinitialize () public {
@@ -61,17 +48,10 @@ contract TestSetupWallet1 is Test {
6148 uint256 balanceBefore = fuzzyRecipient.balance;
6249 vm.broadcast (owner);
6350 proxyWallet.distribute38c1b (fuzzyRecipient);
64- assertEq (
65- fuzzyRecipient.balance,
66- balanceBefore + 0.5 ether,
67- "Recipient should receive 0.5 ether "
68- );
51+ assertEq (fuzzyRecipient.balance, balanceBefore + 0.5 ether, "Recipient should receive 0.5 ether " );
6952 }
7053
71- function testShouldDistributeFail (
72- address fuzzyRecipient ,
73- address fuzzySender
74- ) public {
54+ function testShouldDistributeFail (address fuzzyRecipient , address fuzzySender ) public {
7555 vm.assume (fuzzySender != owner);
7656 vm.broadcast (fuzzySender);
7757 vm.expectRevert (bytes ("nope " ));
@@ -81,17 +61,10 @@ contract TestSetupWallet1 is Test {
8161 function testShouldchangeOwner1da7b (address fuzzyNewOwner ) public {
8262 vm.broadcast (owner);
8363 proxyWallet.changeOwner1da7b (fuzzyNewOwner);
84- assertEq (
85- proxyWallet.getOwner15569 (),
86- fuzzyNewOwner,
87- "Owner should be changed to fuzzy address "
88- );
64+ assertEq (proxyWallet.getOwner15569 (), fuzzyNewOwner, "Owner should be changed to fuzzy address " );
8965 }
9066
91- function testShouldchangeOwner1da7bFail (
92- address fuzzyNewOwner ,
93- address fuzzySender
94- ) public {
67+ function testShouldchangeOwner1da7bFail (address fuzzyNewOwner , address fuzzySender ) public {
9568 vm.assume (fuzzySender != owner);
9669 vm.broadcast (fuzzySender);
9770 vm.expectRevert (bytes ("nope " ));
@@ -103,10 +76,6 @@ contract TestSetupWallet1 is Test {
10376 vm.broadcast (owner);
10477 vm.expectRevert (bytes ("Recipient should accept ether " ));
10578 proxyWallet.distribute38c1b (payable (address (attacker)));
106- assertEq (
107- proxyWallet.getOwner15569 (),
108- owner,
109- "Owner should be contract deployer "
110- );
79+ assertEq (proxyWallet.getOwner15569 (), owner, "Owner should be contract deployer " );
11180 }
11281}
0 commit comments