2022-03-23 08:11:24 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-02-27 04:02:51 +00:00
|
|
|
pragma solidity ^0.7.6;
|
|
|
|
|
|
|
|
interface TokenInterface {
|
2022-03-23 08:11:24 +00:00
|
|
|
function balanceOf(address) external view returns (uint256);
|
|
|
|
|
|
|
|
function allowance(address, address) external view returns (uint256);
|
|
|
|
|
|
|
|
function approve(address, uint256) external;
|
|
|
|
|
|
|
|
function transfer(address, uint256) external returns (bool);
|
|
|
|
|
|
|
|
function transferFrom(
|
|
|
|
address,
|
|
|
|
address,
|
|
|
|
uint256
|
|
|
|
) external returns (bool);
|
2022-02-27 04:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface CTokenInterface {
|
2022-03-23 08:11:24 +00:00
|
|
|
function mint(uint256 mintAmount) external returns (uint256);
|
|
|
|
|
|
|
|
function redeem(uint256 redeemTokens) external returns (uint256);
|
|
|
|
|
|
|
|
function borrow(uint256 borrowAmount) external returns (uint256);
|
|
|
|
|
|
|
|
function repayBorrow(uint256 repayAmount) external returns (uint256);
|
|
|
|
|
|
|
|
function repayBorrowBehalf(address borrower, uint256 repayAmount)
|
|
|
|
external
|
|
|
|
returns (uint256); // For ERC20
|
|
|
|
|
|
|
|
function liquidateBorrow(
|
|
|
|
address borrower,
|
|
|
|
uint256 repayAmount,
|
|
|
|
address cTokenCollateral
|
|
|
|
) external returns (uint256);
|
|
|
|
|
|
|
|
function borrowBalanceCurrent(address account) external returns (uint256);
|
2022-02-27 04:02:51 +00:00
|
|
|
|
2022-03-23 08:11:24 +00:00
|
|
|
function redeemUnderlying(uint256 redeemAmount) external returns (uint256);
|
2022-02-27 04:02:51 +00:00
|
|
|
|
2022-03-23 08:11:24 +00:00
|
|
|
function exchangeRateCurrent() external returns (uint256);
|
2022-02-27 04:02:51 +00:00
|
|
|
|
2022-03-23 08:11:24 +00:00
|
|
|
function balanceOf(address owner) external view returns (uint256 balance);
|
|
|
|
|
|
|
|
function transferFrom(
|
|
|
|
address,
|
|
|
|
address,
|
|
|
|
uint256
|
|
|
|
) external returns (bool);
|
|
|
|
|
|
|
|
function allowance(address, address) external view returns (uint256);
|
2022-02-27 04:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface CETHInterface {
|
2022-03-23 08:11:24 +00:00
|
|
|
function mint() external payable;
|
|
|
|
|
|
|
|
function repayBorrow() external payable;
|
|
|
|
|
|
|
|
function repayBorrowBehalf(address borrower) external payable;
|
|
|
|
|
|
|
|
function liquidateBorrow(address borrower, address cTokenCollateral)
|
|
|
|
external
|
|
|
|
payable;
|
2022-02-27 04:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ComptrollerInterface {
|
2022-03-23 08:11:24 +00:00
|
|
|
function enterMarkets(address[] calldata cTokens)
|
|
|
|
external
|
|
|
|
returns (uint256[] memory);
|
|
|
|
|
|
|
|
function exitMarket(address cTokenAddress) external returns (uint256);
|
|
|
|
|
|
|
|
function getAssetsIn(address account)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (address[] memory);
|
|
|
|
|
|
|
|
function getAccountLiquidity(address account)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (
|
|
|
|
uint256,
|
|
|
|
uint256,
|
|
|
|
uint256
|
|
|
|
);
|
2022-02-27 04:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface CompoundMappingInterface {
|
2022-03-23 08:11:24 +00:00
|
|
|
function cTokenMapping(string calldata tokenId)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (address);
|
|
|
|
|
|
|
|
function getMapping(string calldata tokenId)
|
|
|
|
external
|
|
|
|
view
|
|
|
|
returns (address, address);
|
2022-02-27 04:02:51 +00:00
|
|
|
}
|