The LikeRegistry::matchRewards
function incorrectly deducts the entire balance of users when a mutual match occurs, instead of deducting 1 ETH per match. This causes a user’s ETH to be fully drained on their first match, leaving no funds for subsequent matches.
Root Cause:
When a mutual like occurs (e.g., User A likes User B, and User B likes User A), the matchRewards
function calculates rewards using the total balance of both users (userBalances[from]
and userBalances[to]
), then resets their balances to zero.
This design flaw causes all of a user’s ETH to be sent to the first multisig wallet created for their earliest match, even if they have multiple matches.
Example Scenario:
User A sends 3 ETH to like three different users (B, C, D).
B, C, and D later like A back, creating three mutual matches.
On the first match (A ↔ B), the matchRewards
function:
Takes A’s entire balance (3 ETH) and B’s balance (1 ETH).
Sends 3.6 ETH (4 ETH total - 10% fee) to the A-B multisig wallet.
Resets both A and B’s balances to zero.
Subsequent matches (A ↔ C, A ↔ D) receive zero ETH because A’s balance is already drained.
Loss of User Funds: Users lose ETH intended for multiple matches (e.g., 3 ETH sent for 3 matches is consumed by the first match).
Broken Matching Logic: Only the first match receives ETH, rendering the protocol unusable for users with multiple matches.
Protocol Reputation Risk: Users will lose trust in the platform due to fund mismanagement.
Manual code review.
Modify the matchRewards
function to deduct 1 ETH per match instead of the entire balance:
Likelihood: Medium, if anyone has 2 matches or more before reliking. Impact: Medium, the user won't contribute to the wallet.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.