forked from Cyfrin/aderyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCallGraphTests.sol
75 lines (54 loc) · 1.44 KB
/
CallGraphTests.sol
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
contract Tower1 {
function visitEighthFloor1() internal {
require(msg.sender == address(0x11));
}
modifier passThroughNinthFloor1() {
visitEighthFloor1();
_;
}
// Start Here
function enterTenthFloor1() external passThroughNinthFloor1() {
}
}
contract Tower2 {
function visitEighthFloor2(address x) internal {
(bool success,) = x.call{value: 10}("calldata");
if (!success) {
revert();
}
}
modifier passThroughNinthFloor2(address x) {
visitEighthFloor2(x);
_;
}
// Start Here
function enterTenthFloor2(address x) external passThroughNinthFloor2(x) {
}
}
contract Tower3 {
function visitEighthFloor3(address x) internal {
(bool success,) = x.call{value: 10}("calldata");
if (!success) {
revert();
}
}
modifier passThroughNinthFloor3(address x) {
visitEighthFloor3(x);
_;
}
// Start Here
function enterTenthFloor3(address x) external passThroughNinthFloor3(x) {
visitSeventhFloor3();
}
function visitSeventhFloor3() internal {
require(msg.sender == address(0x11));
}
}
contract Tower4 {
// A recursive function should have itself as upstream and downstream
function recurse(string memory something) private {
recurse(something);
}
}