DatingDapp

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

Missing ETH Deposit Tracking in likeUser Function

Vulnerability Details

The likeUser function fails to update the userBalances mapping after receiving ETH payments. While the function requires a 1 ETH payment, it doesn't record this deposit to the sender's balance, causing protocol economics to fail.

Vulnerable Code:

function likeUser(address liked) external payable {
require(msg.value >= 1 ether, "Must send at least 1 ETH");
// ... other checks ...
// ❌ Missing balance tracking
// userBalances[msg.sender] += msg.value;
likes[msg.sender][liked] = true;
// ... rest of function ...
}

Impact

Consequences:

  1. All ETH sent to contract becomes permanently stuck

  2. Match rewards calculations use zero balances (0 + 0 = 0 ETH)

  3. Multisig wallets receive 0 ETH despite user payments

  4. Protocol fees (totalFees) never accumulate

  5. Renders core matching functionality non-functional

Tools Used

Manual Code review

Recommendations

function likeUser(address liked) external payable {
require(msg.value >= 1 ether, "Must send at least 1 ETH");
// ... other checks ...
// ✅ Add balance tracking
userBalances[msg.sender] += msg.value;
likes[msg.sender][liked] = true;
// ... rest of function ...
}
Updates

Appeal created

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