generated from foundry-rs/hardhat-foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 214
/
creamfinance.d2
53 lines (44 loc) · 1.47 KB
/
creamfinance.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
44
45
46
47
48
49
50
51
52
53
InterfaceRegistry: Interface Registry
FlashLoan: Flashloan {
requestLoan: flashLoan()
repayLoan: repay
}
weth: WETH9 {
withdrawETH: withdraw()
depositETH: deposit()
}
crETH: Cream ETHER {
mintcrETH: mint()
borrowcrETH: borrow()
}
comptroller: Comptroller {
enterMarkets: enterMarkets()
}
crAMP: Cream AMP {
borrowcrAMP: borrow()
}
MinionContract: Minion Contract {
liquidateAMPBorrow: liquidateAMPBorrow()
redeemLiquidationPrize: redeemLiquidationPrize()
depositAndTransferWeth: depositAndTransferWeth()
selfDestructMinion: selfDestructMinion()
}
Attacker -> InterfaceRegistry: 1°: Add malicious contract to registry
Attacker -> FlashLoan.requestLoan: 2°
FlashLoan.requestLoan -> weth.withdrawETH: 3°
weth.withdrawETH -> crETH.mintcrETH: 4°
crETH.mintcrETH -> comptroller.enterMarkets: 5°
comptroller.enterMarkets -> crAMP.borrowcrAMP: 6°
crAMP.borrowcrAMP -> crETH.borrowcrETH: 7°: reenter
Attacker -> MinionContract: 8°: deploy
Attacker -> MinionContract.liquidateAMPBorrow: 9°
MinionContract.liquidateAMPBorrow -> MinionContract.redeemLiquidationPrize: 10°
MinionContract.redeemLiquidationPrize -> MinionContract.depositAndTransferWeth: 11°
MinionContract.depositAndTransferWeth -> MinionContract.selfDestructMinion: 12°
MinionContract.selfDestructMinion -> weth.deposit: 13°
weth.deposit -> FlashLoan.repayLoan: 14°
explanation: |md
# CreamFinance
- Reentrancy with hookable token
- Borrow without collateral
|