The LikeRegistry contract accumulates ETH sent via the likeUser function but lacks a mechanism to access or distribute it. The withdrawFees function relies on the totalFees state variable, which remains zero due to incorrect fee tracking. As a result, all ETH sent by users becomes permanently locked in the contract, rendering it unusable and causing financial loss.
Contract: LikeRegistry.sol
Functions: likeUser, matchRewards, and withdrawFees
ETH Tracking Failure:
The likeUser function does not update userBalances (as identified in Critical: Incorrect ETH Accounting), so the matchRewards function cannot calculate valid rewards or fees.
The totalFees variable remains zero because matchingFees (derived from userBalances) is always zero.
No Recovery Mechanism:
The contract has no function to recover stuck ETH (e.g., an emergency withdrawal for the owner).
matchRewardswithdrawFees FunctionPermanent Fund Locking: All ETH sent by users is stuck in the contract indefinitely.
Protocol Failure: The core reward/fee mechanism is non-functional, making the contract unusable.
Reputation Damage: Users lose trust in the protocol due to unresponsive funds.
Expected: ETH should be tracked as fees/rewards and accessible via withdrawFees or other functions.
Actual: ETH is permanently locked, and withdrawFees reverts due to zero totalFees.
Resolve the root cause by properly updating userBalances in likeUser (as detailed in Critical: Incorrect ETH Accounting).
Implement a function to recover stuck ETH (e.g., for the owner):
Ensure totalFees is correctly incremented in matchRewards:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.