aave / Aave-Vault

ERC4626 vault to hold aToken assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deposit function is taking more assets than needed for the corresponding amount of shares

miguelmtzinf opened this issue · comments

It is possible for the deposit function to pull more assets from the user than needed for the same amount of shares because of rounding issues.
The amount of shares are being calculated on the line 530, but due to rounding issues (previewDeposit is rounding down), the function could make use of more assets than needed.
https://github.com/aave/wrapped-atoken-vault/blob/8374fb5ead3bb67848bfc4cd782035c62bff9da7/src/ATokenVault.sol#L522-L533