DatingDapp

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

Absence of Withdrawal Mechanism for Unmatched Likes Creates Fund Lock

Summary

Vulnerability Details

The contract lacks a withdrawal mechanism for users whose likes remain unmatched, resulting in permanent fund lockup. Users who send ETH to like another profile have no recourse to recover their funds if the other party never reciprocates the like.

Impact

Permanent lockup of user funds in unmatched scenarios

Tools Used

Manual Review

Recommendations

Implement a withdrawal function for unmatched likes:

+ event Unliked(address user1, address liked, uint256 cashBackFund);
+ function withdrawalFundWhenLikeAreNotMutual(address liked) public {
+ require ( userBalances[msg.sender] != 0, "InsuffcientFund");
+ require (likes[msg.sender][liked], "No existing likes");
+ uint256 cashBackFunds = userBalances[msg.sender];
+ delete likes[msg.sender][liked];
+ delete userBalances[msg.sender];
+ (bool success, ) = payable(msg.sender).call{value: cashBackFunds}("");
+ require(success, "Transaction Failed");
+ emit Unliked(msg.sender, liked, cashBackFunds);
+ }
Updates

Appeal created

n0kto Lead Judge 7 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.