Within the OpenZeppelin's ERC4626 standard, there's a function called previewDeposit that's intended to be called by users whenever they want to have an idea of how many shares they will be getting after making a deposit.
Here, briVault inherits previewDeposit from OpenZeppelin's ERC4626, but does not override it. The base implementation ignores deposit fees, returning the full share amount.
Even EIP-4626 mentions this (under previewDeposit section):
MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
Hence, users are misled here.
Likelihood: High
The wrong share amount is provided every time a user calls previewDeposit
Impact: Medium/Low
Users are misled about shares received
Actual deposit returns fewer shares
Breaks trust and ERC4626 compliance
Add this test_PreviewDeposit_IgnoresFees test in briVault.t.sol:
Run it using:
Logs:
Override previewDeposit to include fees:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.