MartenitsaMarketplace::buyMartenitsa
function with a msg.value
amount that is higher than the listing.price
.Description: The MartenitsaMarketplace::buyMartenitsa
function requires msg.value >= listing.price
. If Chasy lists one item with a price of 1 Wei, and Bob wants to buy the item, but he accidentaly sends 5 Wei instead of 1, the transaction will not revert. Chasy will sell the item and she will receive 1 Wei, Bob will pay 5 Wei instead of 1, and the MartenitsaMarketplace
contract will receive the extra 4.
Impact: Users can accidentally lose funds because the transaction will not revert if they call the MartenitsaMarketplace::buyMartenitsa
with a msg.value
amount that is > listing.price
.
Proof of Concepts: Paste this test inside MartenitsaMarketplace.t.sol
file.
Test output
Recommended mitigation: To prevent this from happening, the require
statement inside the MartenitsaMarketplace::buyMartenitsa
function should be changed to strict equality.
Tools used: Manual review
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.