DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing event emission for fee withdrawal in `LikeRegistry` (State Change + Transparency Impact)

Description: The withdrawFees function in LikeRegistry changes critical state (totalFees) and transfers funds but doesn't emit an event. This makes it difficult to track fee withdrawals off-chain.

function withdrawFees() external onlyOwner {
require(totalFees > 0, "No fees to withdraw");
uint256 totalFeesToWithdraw = totalFees;
@> totalFees = 0; // State change without event
(bool success,) = payable(owner()).call{value: totalFeesToWithdraw}("");
require(success, "Transfer failed");
}

Impact:

  • Lack of transparency in fee withdrawals

  • Difficult to track protocol revenue off-chain

  • Reduced ability to monitor owner actions

Recommended Mitigation: Add an event emission for fee withdrawals:

+ event FeesWithdrawn(address indexed owner, uint256 amount);
function withdrawFees() external onlyOwner {
require(totalFees > 0, "No fees to withdraw");
uint256 totalFeesToWithdraw = totalFees;
totalFees = 0;
+ emit FeesWithdrawn(owner(), totalFeesToWithdraw);
(bool success,) = payable(owner()).call{value: totalFeesToWithdraw}("");
require(success, "Transfer failed");
}
Updates

Appeal created

n0kto Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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