LikeRegistry::userBalances
mapping is not updated correctly in LikeRegistry::LikeUser()
function. This omission prevents the accurate calculation and distribution of rewards in subsequent function calls, specifically within the matchRewards() internal function.
The userBalances mapping is crucial for tracking the accumulated funds associated with each user, which is used to calculate rewards in the matchRewards()
internal function. However, the likeUser()
function, which is responsible for initiating the "like" action and potentially triggering a match, fails to update the userBalances variable. This means that when a match occurs, and the matchRewards()
function attempts to distribute rewards, it will not have access to the necessary balance information. Consequently, no rewards will be correctly calculated, resulting in zero rewards sent to the MultiSig contract, as the contract will believe there is no balance to distribute.
Proof of Code:
Users who participate in matching activities will not receive the expected rewards, frustrating users and damaging the platform's incentive structure.
To resolve this vulnerability, the userBalances mapping needs to be updated in the likeUser() function:
This change ensures that the userBalances mapping is updated correctly when a user likes another user, reflecting the payment associated with the like action, and setting a correct starting balance.
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.