mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fixes #56
This commit is contained in:
parent
5a67250743
commit
c45d6c254b
|
@ -134,7 +134,17 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
|||
}
|
||||
|
||||
function mintToTreasury(uint256 amount, uint256 index) external override onlyLendingPool {
|
||||
_mint(RESERVE_TREASURY_ADDRESS, amount.div(index));
|
||||
|
||||
if(amount == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
//compared to the normal mint, we don't check for rounding errors.
|
||||
//the amount to mint can easily be very small since is a fraction of the interest
|
||||
//accrued. in that case, the treasury will experience a (very small) loss, but it
|
||||
//wont cause potentially valid transactions to fail.
|
||||
|
||||
_mint(RESERVE_TREASURY_ADDRESS, amount.rayDiv(index));
|
||||
|
||||
//transfer event to track balances
|
||||
emit Transfer(address(0), RESERVE_TREASURY_ADDRESS, amount);
|
||||
|
|
Loading…
Reference in New Issue
Block a user