// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/// Portion of external interface for CTokens
// See: https://github.com/compound-finance/compound-protocol/blob/master/contracts/CToken.sol
interface ICToken is IERC20Metadata {
/// @dev From Compound Docs:
/// The current (up to date) exchange rate, scaled by 10^(18 - 8 + Underlying Token Decimals).
function exchangeRateCurrent() external returns (uint256);
/// @dev From Compound Docs: The stored exchange rate, with 18 - 8 + UnderlyingAsset.Decimals.
function exchangeRateStored() external view returns (uint256);
/// @return The address of the underlying token
function underlying() external view returns (address);
/**
* @notice Sender supplies assets into the market and receives cTokens in exchange
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param mintAmount The amount of the underlying asset to supply
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function mint(uint256 mintAmount) external returns (uint256);
/**
* @notice Sender redeems cTokens in exchange for the underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemTokens The number of cTokens to redeem into underlying
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeem(uint256 redeemTokens) external returns (uint256);
}
interface IComptroller {
/// Claim comp for an account, to an account
function claimComp(address account) external;
/// @return The address for COMP token
function getCompAddress() external view returns (address);
}
|