The LikeRegistry contract’s likeUser function may cause funds to be locked indefinitely. Once a user (Alice) sends 1 or more Ether via likeUser to another user (Bob), there is no built-in mechanism to recover the deposited funds unless Bob successfully calls likeUser back. This creates a potential risk where the sender's funds may get trapped if the recipient becomes unable or unwilling to interact with the contract further.
When Alice calls LikeRegistry::likeUser and sends Ether to like Bob, the Ether is stored in the contract with no path for retrieval unless Bob, the recipient, later calls LikeRegistry::likeUser. However, if Bob's account becomes blocked, burned, or otherwise unable to execute functions (for example, due to administrative actions like profile blocking via the SoulboundProfileNFT contract), then Bob may not be able to call likeUser. As a result, Alice’s Ether remains locked in the contract indefinitely.
Alice’s Ether will be permanently locked in the LikeRegistry portion of the contract with no way of retrieving it.
This can lead to user dissatisfaction and loss of funds, negatively impacting the trust in the system.
In cases where a user is unable to perform the unlocking action due to account restrictions (blocked or burned accounts), funds deposited as likes become irrecoverable.
Foundry (for testing and POC demonstration)
Implement a mechanism that allows users to withdraw their Ether if the counterparty (the recipient) is unable or unwilling to unlock the funds. For example, consider adding:
A timeout feature enabling a refund if no reciprocal like action is performed within a set period.
A dedicated withdrawal function that allows the original sender to retrieve their funds after specific conditions are met (e.g., if the recipient has been blocked or has remained inactive for a defined duration).
By incorporating a safe withdrawal or refund mechanism, the contract can mitigate the risk of funds becoming locked and improve the overall user experience and security of the system.
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.