forked from coinspect/learn-evm-attacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeiprotocol.wsd
126 lines (90 loc) · 1.95 KB
/
feiprotocol.wsd
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
121
122
123
124
125
126
@startuml
interface IUnitroller {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰enterMarkets()
+exitMarket()
+🔍borrowCaps()
}
interface ICERC20Delegator {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰mint()
+🔍balanceOf()
+🔍decimals()
+💰borrow()
+accrueInterest()
+approve()
+💰redeemUnderlying()
}
interface IETHDelegator {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰mint()
+🔍balanceOf()
+🔍decimals()
+💰borrow()
+accrueInterest()
+approve()
+💰redeemUnderlying()
+🔍getCash()
}
class Exploit_Fei_Globals {
' -- inheritance --
' -- usingFor --
' -- vars --
+{static}[[IUnitroller]] unitroller
+{static}[[ICERC20Delegator]] fUSDC
+{static}[[ICERC20Delegator]] fUSDT
+{static}[[ICERC20Delegator]] fFRAX
+{static}[[IETHDelegator]] fETH
+{static}[[IWETH9]] weth
+{static}[[IERC20]] usdc
+{static}[[IERC20]] usdt
+{static}[[IERC20]] frax
+{static}[[address]] attacker
' -- methods --
}
class Exploit_Fei {
' -- inheritance --
{abstract}TestHarness
{abstract}BalancerFlashloan
{abstract}Exploit_Fei_Globals
' -- usingFor --
' -- vars --
' -- methods --
+setUp()
+test_attack()
+💰receiveFlashLoan()
#attackfETH()
+attack_fUSDC()
+💰**__constructor__**()
#log_balances()
}
class Exploiter_Attacker_Minion {
' -- inheritance --
{abstract}Exploit_Fei_Globals
' -- usingFor --
' -- vars --
#[[uint256]] mintAmount
+[[address]] factory
' -- methods --
+**__constructor__**()
+exploiter_setup_function()
+mint()
+borrow()
+redeemAll()
+💰**__constructor__**()
}
' -- inheritance / usingFor --
Exploit_Fei --[#DarkGoldenRod]|> TestHarness
Exploit_Fei --[#DarkGoldenRod]|> BalancerFlashloan
Exploit_Fei --[#DarkGoldenRod]|> Exploit_Fei_Globals
Exploiter_Attacker_Minion --[#DarkGoldenRod]|> Exploit_Fei_Globals
@enduml