The matchRewards
function in the LikeRegistry
contract attempts to distribute rewards based on userBalances
. However, user balances are never updated, meaning the reward calculation always results in zero rewards and zero fees.
User balances are not tracked; they are only read from storage because they were not initially assigned in the likeUser
function.
Since userBalances[from]
and userBalances[to]
are never updated in the contract, they are always zero.
totalRewards = matchUserOne + matchUserTwo = 0 + 0 = 0
matchingFees = (totalRewards * FIXEDFEE) / 100 = (0 * 10) / 100 = 0
rewards = totalRewards - matchingFees = 0 - 0 = 0
This means no actual ETH is transferred to the MultiSig wallet, and the total fee accumulation remains zero.
Users receive no rewards when they match, making the matching mechanism ineffective.
The contract owner cannot withdraw any fees because totalFees is always zero.
Funds sent to the contract remain untracked and potentially locked if not properly withdrawn.
Manual Code Review
Foundry
Track user deposits by updating userBalances
when users send ETH during the likeUser
function
userBalances[msg.sender] += msg.value;
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.