Description:
In the LikeRegistry
contract, when users like another user through the likeUser()
function, their ETH is stored in userBalances
but can only be retrieved if they receive a mutual like. If a user never receives a mutual like, their ETH becomes permanently locked in the contract with no mechanism to withdraw it.
Impact:
This has several concerning impacts:
Users who don't receive mutual likes have their ETH permanently locked
No refund mechanism exists for unmatched users
Could lead to significant loss of user funds
Creates poor user experience and potential trust issues
Test demonstrating ETH getting locked for unmatched users:
To prevent ETH from being permanently locked, we can implement a time-based withdrawal mechanism that allows users to retrieve their funds if they don't receive a match within a certain period.
LikeRegistry::lockPeriods
add this line of code to contract state variables:
LikeRegistry::likeUser
add this line of code to track when users deposit funds:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood 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.