The contract LikeRegistry.sol requires at least that users send 1 ETH when calling the likeUser
function, however, it doesn't update the userBalances
mapping with the deposited ammount. Because of this, all the ETH sent by the users is not properly recorded, which leads to mismanaged funds and has the potential of locking the deposited funds within the contract.
In the likeUser
function, users must send a minimum of 1 ETH to perform a like, but the contract doesn't add the sent value to the userBalances
mapping. The matchRewards
function later on tries to calculate rewards based on the balances of the matched users by reading userBalances[from]
and userBalances[to]
. Since these balances are never updated, they remain at 0, which results in a reward calculation of 0
Basically the failure to update user balances ends up with a situation where funds are permanently locked in the contract which causes a loss to the users
First of all and most importantly I would modify likeUser
function to update the userBalances
mapping with the deposited ETH.
Like so:
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.