DatingDapp

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

no way to cancel the like, if matching is never achieved, the user will lose the funds

Description: Users should be able to cancel their like if a match is unlikely to occur, providing them with a way to reclaim their Ether.

Impact: user will lose the funds if the matching is never achieved.

Recommended Mitigation:
add a cancel function in LikeRegistry.sol

function cancelLike(address liked) external {
require(likes[msg.sender][liked], "Not liked");
require(!likes[liked][msg.sender], "Matched, cannot cancel like");
uint256 amount = userBalances[msg.sender][liked];
userBalances[msg.sender][liked] = 0;
likes[msg.sender][liked] = false;
(bool success,) = payable(msg.sender).call{value: amount}("");
require(success, "Transfer failed");
}
Updates

Appeal created

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
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.