LikeRegistry::likeUser Does Not Update userBalances, Leading to User Funds Being Locked
The likeUser
function in the LikeRegistry
contract does not update the userBalances
mapping. As a result, when two users like each other, the matchRewards
function creates a MultiSigWallet
with a 0 balance. Additionally, the withdrawFees
function only withdraws the amount stored in totalFees
, which remains 0. Consequently, there is no mechanism to retrieve the funds deposited by users, leading to a permanent lock of user funds within the LikeRegistry
contract.
Users' funds become permanently locked in the contract.
The matchRewards
function creates empty MultiSigWallet
contracts.
The withdrawFees
function remains ineffective, as totalFees
is never updated.
Add a testLikeRegistry.t.sol
file under the test
folder. And add the following code.
Run
This test demonstrates that after a user sends 1 ether via likeUser, the userBalances mapping for both users remain unchanged.
N/A
Modify the likeUser function to correctly update the userBalances mapping when a user sends funds
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.