DatingDapp

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

H-01. No way to set userBalances

Summary

In LikeRegistry.sol, there is no function to properly increase userBalances. As a result, the reward distribution mechanism in the contract fails, making the intended reward system ineffective.

Vulnerability Details

The key issue lies in the likeUser() and matchRewards() functions:

  • userBalances[msg.sender] is never updated when a user sends ETH.

  • In matchRewards(), the contract attempts to read and reset userBalances for both matched users (from and to), but since userBalances is always zero, no rewards are distributed.

This leads to the core functionality of rewarding users upon a match being completely broken.

Impact

  • No actual rewards are distributed to matched users.

  • The fee collection system (totalFees) becomes non-functional as it always remains zero.

  • The contract fails to meet its intended business logic, which can diminish user trust.

Tools Used

Manual review

Recommendations

Update userBalances in the likeUser() function to record user payments:

userBalances[msg.sender] += msg.value;
Updates

Appeal created

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