DatingDapp

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

No Event Emitted in `LikeRegistry::withdrawFees`

Summary

The LikeRegistry::withdrawFees function does not emit an event, reducing transparency.

Vulnerability Details

The withdrawFees function transfers fees to the owner but does not emit an event to log this action.

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

Impact

  • Lack of transparency for fee withdrawals.

  • Difficulty in auditing or tracking fee withdrawals.

Tools Used

  • Manual code review.

Recommendations

Emit an event in the withdrawFees function:

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