@@ -48,6 +48,14 @@ contract RecoveryContractTest is Test {
4848 assertEq (address (rc).balance, 1.5 ether);
4949 }
5050
51+ function test_recoverETH_zeroRecipientReverts () public {
52+ vm.deal (address (rc), 1 ether);
53+
54+ vm.prank (OWNER);
55+ vm.expectRevert (abi.encodeWithSelector (RecoveryContract.ZeroAddressRecipient.selector ));
56+ rc.recoverETH (payable (address (0 )), 1 ether);
57+ }
58+
5159 function test_recoverETH_unauthorized () public {
5260 vm.deal (address (rc), 1 ether);
5361
@@ -68,6 +76,14 @@ contract RecoveryContractTest is Test {
6876 assertEq (token.balanceOf (address (rc)), 0 );
6977 }
7078
79+ function test_recoverERC20_zeroRecipientReverts () public {
80+ token.mint (address (rc), 1000e18 );
81+
82+ vm.prank (OWNER);
83+ vm.expectRevert (abi.encodeWithSelector (RecoveryContract.ZeroAddressRecipient.selector ));
84+ rc.recoverERC20 (address (token), address (0 ), 1000e18 );
85+ }
86+
7187 function test_recoverERC20_unauthorized () public {
7288 token.mint (address (rc), 1000e18 );
7389
@@ -96,6 +112,28 @@ contract RecoveryContractTest is Test {
96112 assertEq (nft.ownerOf (42 ), RECIPIENT);
97113 }
98114
115+ function test_execute_zeroTargetReverts () public {
116+ vm.prank (OWNER);
117+ vm.expectRevert (abi.encodeWithSelector (RecoveryContract.ZeroAddressTarget.selector ));
118+ rc.execute (address (0 ), 0 , "" );
119+ }
120+
121+ function test_execute_noCodeWithCalldataReverts () public {
122+ address noCodeTarget = makeAddr ("noCodeTarget " );
123+
124+ vm.prank (OWNER);
125+ vm.expectRevert (abi.encodeWithSelector (RecoveryContract.NoCodeAtTarget.selector , noCodeTarget));
126+ rc.execute (noCodeTarget, 0 , hex "1234 " );
127+ }
128+
129+ function test_execute_noCodeNoValueReverts () public {
130+ address noCodeTarget = makeAddr ("noCodeTarget " );
131+
132+ vm.prank (OWNER);
133+ vm.expectRevert (abi.encodeWithSelector (RecoveryContract.EmptyExecution.selector ));
134+ rc.execute (noCodeTarget, 0 , "" );
135+ }
136+
99137 function test_execute_unauthorized () public {
100138 vm.deal (address (rc), 1 ether);
101139
0 commit comments