forked from coinspect/learn-evm-attacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feiprotocol.d2
43 lines (34 loc) · 1.27 KB
/
feiprotocol.d2
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
balancer: Balancer FlashLoan
AttackerCommander: Attacker Factory {
deployOne: deploy(Minion 1)
deployTwo: deploy(Minion 2)
}
AttackerMinion: Attacker Minion 1
AttackerMinionTwo: Attacker Minion 2
fei: Fei Protocol {
fCurrencyETH: fCurrency ETH {
mintETH: mint()
borrowETH: borrow()
redeemETH: redeemUnderlying()
}
fCurrencyStable: fCurrency Stable {
mintStable: mint()
borrowStable: borrow()
redeemStable: redeemUnderlying()
}
}
AttackerCommander -> balancer: 1°
balancer -> AttackerCommander.deployOne: 2°
AttackerCommander.deployOne -> AttackerMinion -> fei.fCurrencyStable.mintStable: 3°: minion mints
AttackerCommander.deployOne -> AttackerMinion -> fei.fCurrencyETH.borrowETH: 4°: minion borrows
AttackerMinion -> fei.fCurrencyStable.redeemStable: 5°
AttackerCommander -> fei.fCurrencyETH.mintETH -> fei.fCurrencyStable.mintStable: 6°: multiple stables
fei.fCurrencyStable.mintStable -> fei.fCurrencyStable.redeemStable: 7°: redeem all stables
AttackerCommander.deployTwo -> AttackerMinionTwo: 8°: repeat 2°-5°
AttackerCommander -> fei.fCurrencyETH.redeemETH: 9°
AttackerCommander -> balancer: 10°: repay
explanation: |md
# Fei Protocol
- Reentrancy
- Undercollateralized borrows
|