2021-04-07 23:45:00 +00:00
|
|
|
pragma solidity ^0.7.0;
|
|
|
|
|
|
|
|
import {
|
|
|
|
AaveLendingPoolProviderInterface,
|
|
|
|
AaveDataProviderInterface,
|
|
|
|
StateSenderInterface,
|
2021-04-09 01:43:31 +00:00
|
|
|
IndexInterface,
|
|
|
|
FlashloanInterface
|
2021-04-07 23:45:00 +00:00
|
|
|
} from "./interfaces.sol";
|
|
|
|
|
|
|
|
contract Variables {
|
|
|
|
|
|
|
|
struct AaveDataRaw {
|
|
|
|
address targetDsa;
|
|
|
|
uint[] supplyAmts;
|
|
|
|
uint[] variableBorrowAmts;
|
|
|
|
uint[] stableBorrowAmts;
|
|
|
|
address[] supplyTokens;
|
|
|
|
address[] borrowTokens;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct AaveData {
|
|
|
|
address targetDsa;
|
|
|
|
uint[] supplyAmts;
|
|
|
|
uint[] borrowAmts;
|
|
|
|
address[] supplyTokens;
|
|
|
|
address[] borrowTokens;
|
|
|
|
}
|
|
|
|
|
2021-04-10 21:17:34 +00:00
|
|
|
struct TokenPrice {
|
|
|
|
uint priceInEth;
|
|
|
|
uint priceInUsd;
|
|
|
|
}
|
|
|
|
|
2021-04-07 23:45:00 +00:00
|
|
|
/**
|
|
|
|
* @dev Aave referal code
|
|
|
|
*/
|
|
|
|
uint16 constant internal referralCode = 3228;
|
|
|
|
|
2021-04-08 23:44:37 +00:00
|
|
|
address constant internal polygonReceiver = address(0); // TODO: Replace this
|
2021-04-09 01:43:31 +00:00
|
|
|
FlashloanInterface constant internal flashloanContract = FlashloanInterface(address(0)); // TODO: Replace this
|
2021-04-07 23:45:00 +00:00
|
|
|
|
|
|
|
// This will be used to have debt/collateral ratio always 20% less than liquidation
|
|
|
|
// TODO: Is this number correct for it?
|
2021-04-10 21:17:34 +00:00
|
|
|
uint public safeRatioGap = 800000000000000000; // 20%?
|
2021-04-07 23:45:00 +00:00
|
|
|
uint public fee = 998000000000000000; // 0.2% (99.8%) on collateral? TODO: Is this right?
|
|
|
|
// TODO: Set by construtor?
|
|
|
|
mapping(address => bool) public isSupportedToken;
|
|
|
|
address[] public supportedTokens;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Aave Provider
|
|
|
|
*/
|
|
|
|
AaveLendingPoolProviderInterface constant internal aaveProvider = AaveLendingPoolProviderInterface(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Aave Data Provider
|
|
|
|
*/
|
|
|
|
AaveDataProviderInterface constant internal aaveData = AaveDataProviderInterface(0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Polygon State Sync Contract
|
|
|
|
*/
|
|
|
|
StateSenderInterface constant internal stateSender = StateSenderInterface(0x28e4F3a7f651294B9564800b2D01f35189A5bFbE);
|
|
|
|
|
|
|
|
mapping(address => mapping(address => uint)) public deposits;
|
2021-04-13 22:21:08 +00:00
|
|
|
bool public isDepositsEnabled;
|
2021-04-07 23:45:00 +00:00
|
|
|
|
|
|
|
// InstaIndex Address.
|
|
|
|
IndexInterface public constant instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
|
|
|
|
|
|
|
}
|