mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Minor changes
This commit is contained in:
parent
9f47cda744
commit
cf423ed970
|
@ -17,25 +17,20 @@ interface TokenInterface {
|
||||||
// Compound Helpers
|
// Compound Helpers
|
||||||
interface CTokenInterface {
|
interface CTokenInterface {
|
||||||
function mint(uint mintAmount) external returns (uint);
|
function mint(uint mintAmount) external returns (uint);
|
||||||
function redeem(uint redeemTokens) external returns (uint);
|
|
||||||
function borrow(uint borrowAmount) external returns (uint);
|
function borrow(uint borrowAmount) external returns (uint);
|
||||||
function repayBorrow(uint repayAmount) external returns (uint);
|
function repayBorrow(uint repayAmount) external returns (uint);
|
||||||
function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint); // For ERC20
|
|
||||||
function liquidateBorrow(address borrower, uint repayAmount, address cTokenCollateral) external returns (uint);
|
|
||||||
|
|
||||||
function borrowBalanceCurrent(address account) external returns (uint);
|
function borrowBalanceCurrent(address account) external returns (uint);
|
||||||
function redeemUnderlying(uint redeemAmount) external returns (uint);
|
function redeemUnderlying(uint redeemAmount) external returns (uint);
|
||||||
function exchangeRateCurrent() external returns (uint);
|
|
||||||
|
|
||||||
function balanceOf(address owner) external view returns (uint256 balance);
|
function balanceOf(address owner) external view returns (uint256 balance);
|
||||||
function transferFrom(address, address, uint) external returns (bool);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CETHInterface {
|
interface CETHInterface {
|
||||||
function mint() external payable;
|
function mint() external payable;
|
||||||
function repayBorrow() external payable;
|
function repayBorrow() external payable;
|
||||||
function repayBorrowBehalf(address borrower) external payable;
|
// function repayBorrowBehalf(address borrower) external payable;
|
||||||
function liquidateBorrow(address borrower, address cTokenCollateral) external payable;
|
// function liquidateBorrow(address borrower, address cTokenCollateral) external payable;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InstaMapping {
|
interface InstaMapping {
|
||||||
|
@ -45,9 +40,9 @@ interface InstaMapping {
|
||||||
|
|
||||||
interface ComptrollerInterface {
|
interface ComptrollerInterface {
|
||||||
function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
|
function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);
|
||||||
function exitMarket(address cTokenAddress) external returns (uint);
|
// function exitMarket(address cTokenAddress) external returns (uint);
|
||||||
function getAssetsIn(address account) external view returns (address[] memory);
|
// function getAssetsIn(address account) external view returns (address[] memory);
|
||||||
function getAccountLiquidity(address account) external view returns (uint, uint, uint);
|
// function getAccountLiquidity(address account) external view returns (uint, uint, uint);
|
||||||
}
|
}
|
||||||
// End Compound Helpers
|
// End Compound Helpers
|
||||||
|
|
||||||
|
@ -128,11 +123,6 @@ interface AaveV2LendingPoolProviderInterface {
|
||||||
|
|
||||||
// Aave Protocol Data Provider
|
// Aave Protocol Data Provider
|
||||||
interface AaveV2DataProviderInterface {
|
interface AaveV2DataProviderInterface {
|
||||||
function getReserveTokensAddresses(address _asset) external view returns (
|
|
||||||
address aTokenAddress,
|
|
||||||
address stableDebtTokenAddress,
|
|
||||||
address variableDebtTokenAddress
|
|
||||||
);
|
|
||||||
function getUserReserveData(address _asset, address _user) external view returns (
|
function getUserReserveData(address _asset, address _user) external view returns (
|
||||||
uint256 currentATokenBalance,
|
uint256 currentATokenBalance,
|
||||||
uint256 currentStableDebt,
|
uint256 currentStableDebt,
|
||||||
|
@ -144,18 +134,6 @@ interface AaveV2DataProviderInterface {
|
||||||
uint40 stableRateLastUpdated,
|
uint40 stableRateLastUpdated,
|
||||||
bool usageAsCollateralEnabled
|
bool usageAsCollateralEnabled
|
||||||
);
|
);
|
||||||
function getReserveConfigurationData(address asset) external view returns (
|
|
||||||
uint256 decimals,
|
|
||||||
uint256 ltv,
|
|
||||||
uint256 liquidationThreshold,
|
|
||||||
uint256 liquidationBonus,
|
|
||||||
uint256 reserveFactor,
|
|
||||||
bool usageAsCollateralEnabled,
|
|
||||||
bool borrowingEnabled,
|
|
||||||
bool stableBorrowRateEnabled,
|
|
||||||
bool isActive,
|
|
||||||
bool isFrozen
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// End Aave v2 Helpers
|
// End Aave v2 Helpers
|
||||||
|
|
||||||
|
@ -176,7 +154,7 @@ interface ManagerLike {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface VatLike {
|
interface VatLike {
|
||||||
function can(address, address) external view returns (uint);
|
// function can(address, address) external view returns (uint);
|
||||||
function ilks(bytes32) external view returns (uint, uint, uint, uint, uint);
|
function ilks(bytes32) external view returns (uint, uint, uint, uint, uint);
|
||||||
function dai(address) external view returns (uint);
|
function dai(address) external view returns (uint);
|
||||||
function urns(bytes32, address) external view returns (uint, uint);
|
function urns(bytes32, address) external view returns (uint, uint);
|
||||||
|
@ -260,7 +238,11 @@ contract Helpers is DSMath {
|
||||||
|
|
||||||
using SafeERC20 for IERC20;
|
using SafeERC20 for IERC20;
|
||||||
|
|
||||||
enum Protocol { Aave, AaveV2, Compound }
|
enum Protocol {
|
||||||
|
Aave,
|
||||||
|
AaveV2,
|
||||||
|
Compound
|
||||||
|
}
|
||||||
|
|
||||||
address payable constant feeCollector = 0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2;
|
address payable constant feeCollector = 0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2;
|
||||||
|
|
||||||
|
@ -738,9 +720,10 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
uint feeAmt = wmul(amt, fee);
|
uint feeAmt = wmul(amt, fee);
|
||||||
uint _amt = sub(amt, feeAmt);
|
uint _amt = sub(amt, feeAmt);
|
||||||
|
|
||||||
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
bool isETH = address(token) == getWethAddr();
|
||||||
|
|
||||||
|
address _token = isETH ? getEthAddr() : address(token);
|
||||||
|
|
||||||
bool isEth = _token == getEthAddr();
|
|
||||||
if (isEth) {
|
if (isEth) {
|
||||||
ethAmt = _amt;
|
ethAmt = _amt;
|
||||||
} else {
|
} else {
|
||||||
|
@ -809,14 +792,15 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
if (amt > 0) {
|
if (amt > 0) {
|
||||||
uint ethAmt;
|
uint ethAmt;
|
||||||
|
|
||||||
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
bool isEth = address(token) == getWethAddr();
|
||||||
|
|
||||||
|
address _token = isEth ? getEthAddr() : address(token);
|
||||||
|
|
||||||
if (amt == uint(-1)) {
|
if (amt == uint(-1)) {
|
||||||
(uint _amt, uint _fee) = getPaybackBalance(aave, _token);
|
(uint _amt, uint _fee) = getPaybackBalance(aave, _token);
|
||||||
amt = _amt + _fee;
|
amt = _amt + _fee;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isEth = _token == getEthAddr();
|
|
||||||
if (isEth) {
|
if (isEth) {
|
||||||
ethAmt = amt;
|
ethAmt = amt;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1386,6 +1370,6 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract ConnectRefinace is RefinanceResolver {
|
contract ConnectRefinance is RefinanceResolver {
|
||||||
string public name = "Refinance-v1";
|
string public name = "Refinance-v1";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user