Batcher.depositFunds may allow for more deposits than vaultInfo.maxAmount
As part of a gradual rollout strategy, the Brahma-fi system of contracts has a limit of how much can be deposited into the protocol. This is implemented through the `Batcher` contract that allows users to deposit into it and keep the amount they have deposited in the `depositLedger[recipient]` state variable. In order to cap how much is deposited, the user's input `amountIn` is evaluated within the following statement:\\n```\\nrequire(\\n    IERC20(vaultInfo.vaultAddress).totalSupply() +\\n        pendingDeposit -\\n        pendingWithdrawal +\\n        amountIn <=\\n        vaultInfo.maxAmount,\\n    "MAX\\_LIMIT\\_EXCEEDED"\\n);\\n```\\n\\nHowever, while `pendingDeposit`, `amountIn`, and `vaultInfo.maxAmount` are denominated in the vault asset token (WETH in our case), `IERC20(vaultInfo.vaultAddress).totalSupply()` and `pendingWithdrawal` represent vault shares tokens, creating potential mismatches in this evaluation.\\nAs the yield brings in more and more funds to the vault, the amount of share minted for each token deposited in decreases, so `totalSupply()` becomes less than the total deposited amount (not just vault funds) as the strategy succeeds over time. For example, at first `X` deposited tokens would mint `X` shares. After some time, this would create additional funds in the vault through yield, and another `X` deposit of tokens would mint less than `X` shares, say `X-Y`, where `Y` is some number greater than 0 representing the difference in the number of shares minted. So, while there were `2*X` deposited tokens, `totalSupply()=(2*X-Y)` shares would have been minted in total. However, at the time of the next deposit, a user's `amountIn` will be added with `totalSupply()=(2*X-Y)` number of shares instead of a greater `2*X` number of deposited tokens. So, this will undershoot the actual amount of tokens deposited after this user's deposit, thus potentially evaluating it less than `maxAmount`, and letting more user deposits get inside the vault than what was intended.
Consider either documenting this potential discrepancy or keeping track of all deposits in a state variable and using that inside the `require` statement..
```\\nrequire(\\n    IERC20(vaultInfo.vaultAddress).totalSupply() +\\n        pendingDeposit -\\n        pendingWithdrawal +\\n        amountIn <=\\n        vaultInfo.maxAmount,\\n    "MAX\\_LIMIT\\_EXCEEDED"\\n);\\n```\\n