IAToken

Git Source

Inherits: IERC20, IScaledBalanceToken

Functions

mint

Mints amount aTokens to user

function mint(address user, uint256 amount, uint256 index) external returns (bool);

Parameters

NameTypeDescription
useraddressThe address receiving the minted tokens
amountuint256The amount of tokens getting minted
indexuint256The new liquidity index of the reserve

Returns

NameTypeDescription
<none>booltrue if the the previous balance of the user was 0

burn

Burns aTokens from user and sends the equivalent amount of underlying to receiverOfUnderlying

function burn(address user, address receiverOfUnderlying, uint256 amount, uint256 index) external;

Parameters

NameTypeDescription
useraddressThe owner of the aTokens, getting them burned
receiverOfUnderlyingaddressThe address that will receive the underlying
amountuint256The amount being burned
indexuint256The new liquidity index of the reserve

mintToTreasury

Mints aTokens to the reserve treasury

function mintToTreasury(uint256 amount, uint256 index) external;

Parameters

NameTypeDescription
amountuint256The amount of tokens getting minted
indexuint256The new liquidity index of the reserve

transferOnLiquidation

Transfers aTokens in the event of a borrow being liquidated, in case the liquidators reclaims the aToken

function transferOnLiquidation(address from, address to, uint256 value) external;

Parameters

NameTypeDescription
fromaddressThe address getting liquidated, current owner of the aTokens
toaddressThe recipient
valueuint256The amount of tokens getting transferred

transferUnderlyingTo

Transfers the underlying asset to target. Used by the LendingPool to transfer assets in borrow(), withdraw() and flashLoan()

function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);

Parameters

NameTypeDescription
useraddressThe recipient of the aTokens
amountuint256The amount getting transferred

Returns

NameTypeDescription
<none>uint256The amount transferred

UNDERLYING_ASSET_ADDRESS

function UNDERLYING_ASSET_ADDRESS() external view returns (address);

Events

Mint

Emitted after the mint action

event Mint(address indexed from, uint256 value, uint256 index);

Burn

Emitted after aTokens are burned

event Burn(address indexed from, address indexed target, uint256 value, uint256 index);

BalanceTransfer

Emitted during the transfer action

event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index);