Initially, because the values for userBalances[from]
and userBalances[to]
are not set, they default to 0. As a result, the reward calculation always returns 0, and no one receives any rewards.
Within the likeUser()
function, a user deposits 1 ether into the contract, but since the userBalances
are never updated, they always remain at 0. Consequently, during matching, the reward calculation always results in 0 ether being transferred.
Due to the absence of balance updates, rewards are lost
Update the balance when a user deposits 1 ether.
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.