mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Moved the mint action after the transfer
This commit is contained in:
parent
e1f636ccd6
commit
47e80d7e4f
|
@ -117,6 +117,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
reserve.updateState();
|
||||
reserve.updateInterestRates(asset, aToken, amount, 0);
|
||||
|
||||
IERC20(asset).safeTransferFrom(msg.sender, aToken, amount);
|
||||
|
||||
bool isFirstDeposit = IAToken(aToken).mint(onBehalfOf, amount, reserve.liquidityIndex);
|
||||
|
||||
if (isFirstDeposit) {
|
||||
|
@ -124,8 +126,6 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
emit ReserveUsedAsCollateralEnabled(asset, onBehalfOf);
|
||||
}
|
||||
|
||||
IERC20(asset).safeTransferFrom(msg.sender, aToken, amount);
|
||||
|
||||
emit Deposit(asset, msg.sender, onBehalfOf, amount, referralCode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user