forked from coinspect/learn-evm-attacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vesperrari.wsd
115 lines (79 loc) · 1.7 KB
/
vesperrari.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
@startuml
interface IVUSDMinter {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+mint()
}
interface IUniV3PositionsNFT {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰mint()
}
interface IUnitroller {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰enterMarkets()
+exitMarket()
+🔍borrowCaps()
}
interface ICERC20Delegator {
' -- inheritance --
' -- usingFor --
' -- vars --
' -- methods --
+💰mint()
+🔍balanceOf()
+🔍decimals()
+💰borrow()
+accrueInterest()
+approve()
+💰redeemUnderlying()
}
class ModuleImports {
' -- inheritance --
{abstract}TokenBalanceTracker
{abstract}TWAPGetter
' -- usingFor --
' -- vars --
' -- methods --
}
class Exploit_VesperRariFuse {
' -- inheritance --
{abstract}TestHarness
{abstract}ModuleImports
' -- usingFor --
' -- vars --
#[[IUniswapV3Pair]] pairUsdcWeth
#[[IUniswapV3Pair]] pairUsdcVusd
#[[IVUSDMinter]] minter
#[[IUniV3PositionsNFT]] positionManager
#[[IUnitroller]] unitroller
#{static}[[uint160]] SQRT_SWAP_MAX
#[[uint256]] timesEntered
#[[address]] tokens
#[[address]] cTokens
#[[IWETH9]] weth
#[[uint256]] forkId
' -- methods --
+setUp()
+test_attack()
#attackOne()
#waitAndLogTWAP()
#attackTwo()
+uniswapV3SwapCallback()
+💰**__constructor__**()
+onERC721Received()
#🔍getMintingParams()
}
' -- inheritance / usingFor --
ModuleImports --[#DarkGoldenRod]|> TokenBalanceTracker
ModuleImports --[#DarkGoldenRod]|> TWAPGetter
Exploit_VesperRariFuse --[#DarkGoldenRod]|> TestHarness
Exploit_VesperRariFuse --[#DarkGoldenRod]|> ModuleImports
@enduml