The fee calculation mechanism in matchRewards
incorrectly uses an uninitialized storage variable userBalances
, leading to improper fee distribution. As a result, fees are never collected, breaking the protocol’s expected revenue model.
The function matchRewards
attempts to compute fees using the userBalances
mapping, but this mapping is never updated elsewhere in the contract. Consequently, when the function executes:
matchUserOne = userBalances[from]
and matchUserTwo = userBalances[to]
always evaluate to 0
.
totalRewards = matchUserOne + matchUserTwo = 0 + 0 = 0
.
The calculated matchingFees = (totalRewards * FIXEDFEE) / 100 = (0 * 10) / 100 = 0
.
No actual fees are collected despite the protocol’s requirement to charge a 10% fee.
The multisig wallet meant to receive the remaining rewards is deployed but receives 0 ETH
, making the contract non-functional.
Severity: High
The protocol fails to collect its intended 10% fee, leading to revenue loss.
totalFees
becomes an inaccurate reflection of collected fees, breaking treasury tracking.
Matches generate no actual rewards, potentially discouraging user engagement.
The core fee distribution mechanism is completely ineffective, affecting protocol sustainability.
Since each "like" incurs a 1 ETH fee, and a match consists of two likes, the correct calculation should be:
Total match amount: 2 ETH
Protocol fee (10%): 0.2 ETH
Remaining amount for matched users' multisig: 1.8 ETH
Introduce explicit constants for these values:
matchRewards
FunctionThe new version ensures that fees are correctly accounted for and funds are sent properly:
Manual Code Review
Foundry Testing
Likelihood: High, always. Impact: High, loss of funds
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.