In the BriVault contract, which extends ERC4626, the deposit function is overridden to deduct a participation fee before minting shares based on the net staked assets, ensuring accurate tracking for tournament participation while complying with ERC4626 by returning the shares minted inclusive of fee effects.
However, previewDeposit is not overridden, relying on the base ERC4626 implementation that previews shares without accounting for the custom fee deduction, resulting in previewDeposit returning a higher share amount than what deposit actually mints, violating ERC4626's requirement for consistent preview and execution values.
Likelihood:
Frontends and wallets call previewDeposit to display estimated shares before confirming deposits.
Actual deposits execute with fee deduction, occurring whenever users interact via standard ERC4626 interfaces.
Impact:
Users receive fewer shares than previewed, leading to confusion, perceived losses, and integration failures in DeFi composability.
Undermines ERC4626 compliance, exposing the protocol to exploits from tools assuming accurate previews and eroding integrator trust.
Add the following code snippet to the briVault.t.sol test file.This test verifies that users get different results by calling BriVault::deposit and BriVault::previewDeposit.
Potential mitigation is to override the BriVault.::previewDeposit and add protocol fee calculation.
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.