The BriVault contract inherits from ERC4626 and overrides the deposit function to include custom logic that tracks staked assets and enables users to participate in a tournament by setting the stakedAsset mapping for the receiver.
However, the mint function from ERC4626 is not overridden, allowing users to call it directly to deposit assets and receive shares without triggering the custom logic, which results in the stakedAsset mapping not being updated and prevents those users from joining the tournament via joinEvent.
Likelihood: High
Users interact with the contract via standard ERC4626 interfaces or tools that default to mint for share-based deposits.
Developers or users familiar with ERC4626 may call mint directly assuming equivalence to deposit without reviewing overrides.
Impact: Medium
Users who deposit via mint cannot participate in the tournament, leading to denial of service and potential loss of rewards or opportunities.
Misleading ERC4626 compliance causes users to incur unnecessary gas costs for withdrawals and redeposits or miss time-sensitive events.
Add the following code snippet to the briVault.t.sol test file. This test verifies that user cannot join the tournament if the briVault::mint function is used to deposit.
Recommended Mitigation: Override the ERC4626::mint to add custom logic similar to ERC4626::deposit.
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.