Submitted by bin2chen, also found by bin2chen, 0xStalin, rvierdiiev, and zhaojie
In Vault.deposit(), we will limit the users maximum deposit cannot exceed settings().getMaxDepositInETH().
The code above uses (balanceOf(msg.sender) * _tokenPerETH(maxPriceAge) / 1e18 to calculate the current ETH deposit.
Based on the definition of the _tokenPerETH() method, this formula is incorrect.
It should be balanceOf(msg.sender) * 1e18 / _tokenPerETH(maxPriceAge).
An incorrect calculation formula can result in exceeding getMaxDepositInETH or prematurely triggering a MaxDepositReached revert. Users may not be able to deposit properly.
hvasconcelos (BakerFi) confirmed
ickas (BakerFi) commented:
