Summary
The aave lending pool produces rounding errors when calling PreDepositVault::earn().
Vulnerability Detail
These errors were found to be negligible, being at most 1 wei, and they can either increase or decrease totalAssets() by 1. It shouldn't be exploitable but it's good to know.
Impact
totalPrincipal will be under/overestimated by 1 wei. For example, earning 1000 in PreDepositVault::earn():
- If it rounds up,
totalPrincipalis 1000 but there will already be 1 profit, as we get 1001 aTokens - If it rounds down,
totalPrincipalis 1000 but we only have 999 aTokens. Due to decimals in the assets, this isn't impactful. 1 wei is at most1e-8wbtc.
Code Snippet
Tool Used
Manual Review
Recommendation
Rounding error is very small so no fix is needed.