The LikeRegistry::likeUser
function accepts ether
via msg.value
to facilitate the funds to the MultiSigWallet
contract (corresponding to the match) when a match is being created. However, it lacks the check in case if the user sends more ether
than required (i.e., 1 ether
).
When a user sends a higher value of ether
than what is necessary for the transaction (i.e., 1 ether
) while executing the LikeRegistry::likeUser
function, the contract processes the transaction without returning the excess ether
to the user. This results in the user losing the excess ether
, which is never refunded or handled by the contract.
User executes the LikeRegistry::likeUser
function passing the address of the liked
user and attaching excessive ether
amount.
The excess ether
remains stuck in the contract with no way to withdraw or refund it.
Create a test file named as DatingDappTest.t.sol
inside the test
folder with the following content:
You could implement a check in the LikeRegistry::likeUser
function to refund in case of overpayment:
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.