File: src/briVault.sol • L207 (deposit header), L231 (mint) • Commit: 1f515387d58149bf494dc4041b6214c2546b3b27
Expected (ERC4626): deposit(assets, receiver) must mint vault shares to receiver.
Actual (current code): stake is credited to receiver, but shares are minted to msg.sender. This breaks ERC4626 semantics and the vault’s join/withdraw flow. A user can deposit “for” another account; the receiver can join (stake recorded) but has 0 shares, so they receive 0 payout even if they picked the winner. The depositor holds the shares but cannot join (no stake), making redemption impossible via the custom withdraw() and silently redistributing value.
Likelihood:
Occurs whenever receiver ≠ msg.sender (common in zaps/routers/wrappers and “deposit for” user flows).
Impact:
Ownership/stake mismatch → receiver gets 0 payout; depositor can’t withdraw; funds misassigned and redistributed; breaks ERC4626 integrations and tooling.
receiver != msg.sender (very common in zaps, routers, referral programs, or custodial UX) will misassign ownership of shares. Stake/accounting is recorded for receiver, but shares are minted to the caller, so:receiver can join the tournament/event (stake recorded) but gets 0 payout (has 0 shares).
msg.sender (the caller) silently receives the shares and can later redeem/benefit.
This breaks ERC-4626 semantics and downstream integrations that rely on Deposit(caller, receiver, assets, shares) + balanceOf(receiver) parity.
High-severity ERC-4626 spec violation (direct deposit)
Preconditions: depositor owns 10e18 asset units and is not the receiver.
Expected (ERC-4626): shares mint to receiver.
Actual (current code): shares mint to caller (msg.sender).
Single test:
All variants with traces:
Pass/Fail meaning
Fail (current code): assertions expecting shares at receiver fail because the contract mints to msg.sender.
Pass (after patch): same tests pass when the mint target is changed to receiver.
Why this is works :
ERC-4626: deposit(assets, receiver) must mint to receiver; caller-mint violates spec.
Invariant: share owner = stake owner → balanceOf(receiver)+=shares; caller unchanged; Deposit(caller, receiver, assets, shares) matches state.
Safety: no storage/ACL/ABI changes; negligible gas; restores ERC-4626 integrator compatibility.
Mitigation :
Patch: _mint(msg.sender, shares) → _mint(receiver, shares).
3) How to run
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.