-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathQiAttack.interfaces.sol
More file actions
103 lines (71 loc) · 3.17 KB
/
Copy pathQiAttack.interfaces.sol
File metadata and controls
103 lines (71 loc) · 3.17 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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import {IERC20} from "../../interfaces/IERC20.sol";
import {IWETH9} from "../../interfaces/IWETH9.sol";
import {IUniswapV2Router02} from "../../utils/IUniswapV2Router.sol";
interface IUnitroller {
function enterMarkets(address[] memory cTokens) external payable returns (uint256[] memory);
function exitMarket(address market) external;
// Borrow caps enforced by borrowAllowed for each cToken address. Defaults to zero which corresponds to
// unlimited borrowing.
function borrowCaps(address market) external view returns (uint256);
function getAccountLiquidity(address account) external view returns (uint256, uint256, uint256);
}
interface IPriceFeed {
function getUnderlyingPrice(address cToken) external view returns (uint256);
}
interface IVault is IERC20 {
function deposit(uint256) external;
function depositAll() external;
function withdraw(uint256) external;
function withdrawAll() external;
function getPricePerFullShare() external view returns (uint256);
function upgradeStrat() external;
function balance() external view returns (uint256);
function want() external view returns (IERC20);
}
interface ICERC20Delegator {
function mint(uint256 mintAmount) external payable returns (uint256);
function balanceOf(address _of) external view returns (uint256);
function decimals() external view returns (uint16);
function borrow(uint256 borrowAmount) external payable returns (uint256);
function borrowBalanceCurrent(address) external returns (uint256);
function accrueInterest() external;
function approve(address spender, uint256 amt) external;
function redeemUnderlying(uint256 redeemAmount) external payable returns (uint256);
function underlying() external returns (address);
function liquidateBorrow(address borrower, uint256 repayAmount, address cTokenCollateral)
external
returns (uint256);
function redeem(uint256 redeemTokens) external returns (uint256);
}
interface ICurvePool {
function add_liquidity(uint256[2] memory amounts, uint256 min_min_amount, bool use_eth)
external
payable
returns (uint256);
function remove_liquidity(uint256 amount, uint256[2] calldata min_amounts, bool use_eth) external payable;
function token() external pure returns (address);
function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy, bool use_eth)
external
payable
returns (uint256);
}
interface IAaveFlashloan {
function flashLoan(
address arg0,
address[] memory arg1,
uint256[] memory arg2,
uint256[] memory arg3,
address arg4,
bytes memory arg5,
uint16 arg6
) external;
}
// =============================== HELPER FUNCTIONS ===============================
// Gets the price of Curve LP tokens (Beefy's underlying) according to the
// Compound price's feed
function get_lp_token_price_for_compound() view returns (uint256) {
return IPriceFeed(0x71585E806402473Ff25eda3e2C3C17168767858a)
.getUnderlyingPrice(0x570Bc2b7Ad1399237185A27e66AEA9CfFF5F3dB8); // STMATIC_MATIC_DELEGATOR
}