IcToken
Interface of the cToken that defined as asset in https://v2-app.compound.finance/
name
function name() external view returns (string)
symbol
function symbol() external view returns (string)
decimals
function decimals() external view returns (uint8)
exchangeRateStored
function exchangeRateStored() external view returns (uint256)
balanceOf
function balanceOf(address account) external view returns (uint256)
Returns the amount of tokens owned by account
.
mint
function mint(uint256 mintAmount) external returns (uint256)
Sender supplies assets into the market and receives cTokens in exchange
Accrues interest whether or not the operation succeeds, unless reverted
Parameters
Name | Type | Description |
---|---|---|
mintAmount | uint256 | The amount of the underlying asset to supply |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) |
redeem
function redeem(uint256 redeemTokens) external returns (uint256)
Sender redeems cTokens in exchange for the underlying asset
Accrues interest whether or not the operation succeeds, unless reverted
Parameters
Name | Type | Description |
---|---|---|
redeemTokens | uint256 | The number of cTokens to redeem into underlying |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint 0=success, otherwise a failure (see ErrorReporter.sol for details) |
approve
function approve(address spender, uint256 amount) external returns (bool)
Approve spender
to transfer up to amount
from src
This will overwrite the approval amount for spender
and is subject to issues noted here
Parameters
Name | Type | Description |
---|---|---|
spender | address | The address of the account which may transfer tokens |
amount | uint256 | The number of tokens that are approved (uint256.max means infinite) |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | Whether or not the approval succeeded |