The MartenitsaMarketplace::buyMartenitsa
function transfers the sales price to the seller using the seller.call{value: salePrice}("")
low-level call. If the seller's smart contract wallet does not have a fallback
or receive
function to receive the ETH sent by the marketplace contract, the call will revert, preventing the buyer from purchasing the martenitsaToken.
If the seller's smart contract wallet does not have a fallback
or receive
function to receive the ETH sent by the marketplace contract, the call to seller.call{value: salePrice}("")
will revert, preventing the buyer from purchasing the martenitsaToken. This can lead to a poor user experience and may result in failed transactions.
Proof of Concept:
A seller contract is created without a fallback
or receive
function.
The seller contract lists a martenitsaToken for sale on the marketplace.
A buyer attempts to purchase the martenitsaToken from the marketplace.
The seller.call{value: salePrice}("")
call reverts due to the lack of a fallback
or receive
function in the seller contract.
The transaction fails, and the buyer is unable to purchase the martenitsaToken.
Here is the contract as well
Here is the foundry output
Ensure that the seller's smart contract wallet includes a fallback
or receive
function to receive ETH sent by the marketplace contract. This function should handle the ETH transfer and any additional logic required by the seller contract.
Provide clear documentation and guidance to users on the requirements for listing tokens for sale on the marketplace, including the need to implement a fallback
or receive
function in the seller contract.
Implement checks in the MartenitsaMarketplace
contract to detect whether the seller contract has a fallback
or receive
function and provide appropriate feedback to the user if the function is missing.
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.