deposit
(called from LendingPool
) and redeem
(called from the aToken contract). The aTokens' value is pegged to the value of the corresponding deposited asset at a 1:1 ratio, and can be safely stored, transferred or traded. All interest collected by the aTokens reserves are distributed to aTokens holders directly by continuously increasing their wallet balance. Users can decide to redirect their stream of interest payments to any Ethereum public address.function redeem(uint256 _amount)
_amount
of aTokens for the underlying asset, burning the aTokens during the process. redeem()
will fail if the aTokens to be redeemed are being used as collateral. Please refer to the transferAllowed()
function to understand how to check if a specific redeem/transfer action can be performed._amount
aTokens
to redeem.uint(-1)
function transfer(address recipient, uint256 amount) public
msg.sender
to a specified recipient
. transfer()
will fail if the aTokens to be redeemed are being used as collateral. Please refer to the transferAllowed()
function to understand how to check if a specific redeem/transfer action can be performed.transfer()
will fail if an amount
of 0 is used, which is non-standard ERC20 behaviour.function transferFrom(address from, address to, uint256 amount) public
transferFrom()
will fail if the aTokens to be redeemed are being used as collateral. Please refer to the transferAllowed()
function to understand how to check if a specific redeem/transfer action can be performed.transferFrom()
will fail if an amount
of 0 is used, which is non-standard ERC20 behaviour.function isTransferAllowed(address user, uint256 amount)
return
namefunction redirectInterestStream(address _to)
_to
receiver
of the interest streamfunction redirectInterestStreamOf(address _from, address _to)
_from
depositor
_to
receiver
of the interest streamfunction allowInterestRedirectionTo(address _to)
_to
depositor
Ethereum public addressfunction balanceOf(address _user)
_user
all interest collected included.return
namefunction principalBalanceOf(address _user)
user
current balance deposited to the Aave Protocol reserve contract, with interest collected amount removed.return
namefunction getInterestRedirectionAddress(address _user)
user
current interest stream recipient address, if the user
doesn't have set any receiver the method return 0x00...
.return
namereturn
nameuser
performing the redeem() calluser
actionuser
return
nameuser
performing the mint actionuser
actionuser
return
nameuser
from which the tokens are being burneduser
actionuser
return
nameuser
from which the tokens are being transferredreceiver
user
actionreceiver
actionuser
receiver
return
nameuser
from which the interest are redirectedreceiver
of the interestuser
actionuser
return
nameuser
from which the balance is updateduser
actionuser
return
nameuser
initiating the interest redirectionreceiver
of the interest redirectionreturn
namereserve
being updated