BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Missing Event in cancelParticipation()

Root + Impact

Description

Normal Behavior:

  • State-changing functions should emit events for off-chain monitoring and transparency.


Issue:

  • The cancelParticipation() function at burns shares and refunds assets but does not emit an event to signal the cancellation.

Risk

Likelihood:

  • Every time a user cancels participation before the event starts.

Impact:

  • No on-chain record of cancellations

  • Off-chain systems cannot track participant withdrawals

  • Difficult to audit historical cancellations

Recommended Mitigation

function cancelParticipation () public {
if (block.timestamp >= eventStartDate){
revert eventStarted();
}
uint256 refundAmount = stakedAsset[msg.sender];
stakedAsset[msg.sender] = 0;
uint256 shares = balanceOf(msg.sender);
_burn(msg.sender, shares);
IERC20(asset()).safeTransfer(msg.sender, refundAmount);
+ emit ParticipationCancelled(msg.sender, refundAmount, shares);
}
Updates

Appeal created

bube Lead Judge 19 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!