DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

UserBalance is not update properly when a user likes another user

Summary

Vulnerability Details

[Here(https://github.com/CodeHawks-Contests/2025-02-datingdapp/blob/878bd34ef6607afe01f280cd5aedf3184fc4ca7b/src/LikeRegistry.sol#L37)]
'userBalances' is not updated properly. When 'msg.sender' likes '_liked', then [userBalances] += 1, and 1 ETH should be charged from the 'msg.sender'.

Impact

The amount that will be transferred to the common MultiSigWallet will be incorrect, as transactions are not properly handled.

Tools Used

Recommendations

Please update the 'userBalances' and deduct the amount from the 'msg.sender' address accordingly[Here(https://github.com/CodeHawks-Contests/2025-02-datingdapp/blob/878bd34ef6607afe01f280cd5aedf3184fc4ca7b/src/LikeRegistry.sol#L37)]

Updates

Appeal created

n0kto Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_likeUser_no_userBalances_updated

Likelihood: High, always. Impact: High, loss of funds

Support

FAQs

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