In the LikeRegistry::likeUser
function, users can like a profile by sending ETH to the contract. However, the contract fails to track individual user balances in the LikeRegistry::userBalances
mapping, which is intended to store the ETH sent by each user. As a result, the mapping remains unupdated, and user balances are always zero.
Loss of Protocol Revenue: The LikeRegistry::totalFees
will always be zero because the matchRewards function calculates fees based on LikeRegistry::userBalances
, which are never updated. This results in the protocol losing all potential revenue from matching fees.
Zero ETH Sent to Multisig Wallet: The LikeRegistry::matchRewards
function sends rewards to the multisig wallet based on LikeRegistry::userBalances
. Since these balances are always zero, no ETH is ever sent to the multisig wallet, rendering the matching feature useless.
Locked User Funds: The ETH sent by users remains locked in the contract indefinitely, as there is no mechanism to track or refund it.
Manual code review.
Foundry for testing (as demonstrated in the PoC).
User A
likes User B
's profile by sending 1 ETH.
The balance of User A
in LikeRegistry::userBalances
is expected to be 1 ETH.
However, due to the current implementation, User A
's balance is never incremented and remains zero.
Add the following test case to confirm this behaviour:
Update user balances when a user likes a profile in LikeRegistry::likeUser
:
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.