Submitted by MaratCerby, also found by berndartmueller, cccz, CertoraInc, IllIllI, and reassor
AaveV3YieldSource.sol#L231-L242
Every time transferFrom or transfer function in ERC20 standard is called there is a possibility that underlying smart contract did not transfer the exact amount entered.
It is required to find out contract balance increase/decrease after the transfer.
This pattern also prevents from re-entrancy attack vector.
Recommended code:
function supplyTokenTo(uint256 _depositAmount, address _to) external override nonReentrant {
uint256 _shares = _tokenToShares(_depositAmount);
require(_shares > 0, AaveV3YS/shares-gt-zero);
}
PierrickGT (PoolTogether) acknowledged and commented:
Justin Goro (judge) decreased severity to Medium and commented:
