deposit() function. When a user deposits for another address (receiver), the contract records the deposited assets under the receiver in stakedAsset, but mints ERC4626 shares to the depositor (msg.sender). This desynchronizes ownership between the staked assets and the minted shares.The deposit() function should correctly associate the staked amount and the minted ERC4626 shares with the same address.
This creates a mismatch between the stored stake and the ownership of shares.
As a result:
The depositor fails the joinEvent() validation (noDeposit() revert) because stakedAsset[msg.sender] == 0.
The receiver cannot participate either because they hold no shares.
The deposited funds become permanently unusable and locked in the vault.
Likelihood:
Occurs whenever a user deposits on behalf of a different address (receiver != msg.sender) — a legitimate use case.
No warnings or validation prevent this usage; thus, normal users can easily make this mistake.
Impact:
The depositor cannot participate in the event (noDeposit() revert).
The receiver also cannot participate or withdraw since no shares were minted to them.
Deposited tokens become permanently locked in the vault.
In the test I have used vm.expectRevert so you might not be able to see the revert error in the output
In the output neither can the person join the contest and neither can claim refunds.
Modify the check that if msg.sender have BTT tokens or stakedAsset then the address can join event.
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.