-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathMemberAccess.sol
More file actions
120 lines (117 loc) · 3.81 KB
/
MemberAccess.sol
File metadata and controls
120 lines (117 loc) · 3.81 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
pragma solidity ^0.6.0;
contract MemberAccess {
function foo() {
int256 amount = SafeCast.toInt256(10**(18 - underlyingAssetDecimals)).neg();
longNameAmount = SafeCast.toInt256(10**(18 - underlyingAssetDecimals)).neg();
a.b.c.d;
a.b().c.d;
a.b.c.d();
a.b().c().d();
veryLongVariable.veryLongMember.veryLongMember.veryLongMember.veryLongMember.veryLongMember;
veryLongVariable.veryLongCall(veryLongAttribute).veryLongMember.veryLongMember.veryLongMember;
veryLongVariable.veryLongMember.veryLongCall(veryLongAttribute).veryLongMember.veryLongMember;
veryLongVariable.veryLongMember.veryLongMember.veryLongMember.veryLongCall(veryLongAttribute);
veryLongVariable.veryLongCall(veryLongAttribute).veryLongCall(veryLongAttribute).veryLongCall(veryLongAttribute);
uint256[] memory amounts = IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)[IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)];
uint256[] memory amounts = IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)[IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)][IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)];
uint256[] memory amounts = IUniswapV2Router(routerAddress)
.swapExactTokensForTokens(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
)(
sourceAmount,
minDestination,
path,
address(this, aoeu, aoeueu, aoeu)
);
vm.mockCall(
f.address,
abi.encodeWithSelector(f.selector),
abi.encode(returned1)
);
// Comments in between the chain
game.
// CONFIG
// Do not touch
config. // Window
// Resolution 1000
resolveWindow = 1000;
config.defaultDelay = 0;
begin
.// Comment 1
functionCall(/* Comment about parameter */ parameter)
.// Comment 2
end;
}
}
contract MemberAccessIsEndOfChainCases {
// break if is an ReturnStatement
uint a = b.c;
function foo() modifierCase(b.c) {
// break if is an argument of a FunctionCall
a(b.c);
// break if is an index of an IndexAccess
a[b.c];
// break if is a part of a BinaryOperation
a = b.c;
// break if is a part of a UnaryOperation
!b.c;
// break if is a condition of a IfStatement
if (b.c) {}
// break if is a condition of a WhileStatement
while (b.c) {}
// break if is a part of a ForStatement
// for (b.c;;) {}
for (;b.c;) {}
// for (;;b.c) {}
// break if is a part of a VariableDeclarationStatement
uint a = b.c;
// break if is an ExpressionStatement
b.c;
// break if is an TupleExpression
[a, b.c];
(b.c);
// break if is an Conditional
a.b ? c : d;
a ? b.c : d;
a ? b : c.d;
// break if is an NameValueList
a.b{value: c.d}();
// break if is an TryStatement
try a.b() {} catch {}
// break if is an ReturnStatement
return b.c;
}
}