In the case when there's no dispute between the buyer & seller, the buyer pays the agreed upon price to the seller by calling the confirmReceipt()
& the whole amount in the contract is transferred because the safetransfer
uses the i_tokenContract.balanceOf(address(this))
parameter when paying the seller.
But in case of a price change in the market value of the deposited tokens, either the buyer or the seller incurs a loss according to the increase or decrease in price respectively.
Lets take the scenario when there is no dispute between the buyer & seller.
Here, two scenarios play out.
First,
The market price of the token decreases. In this case, the seller is paid less than the agreed upon price & as a result suffers a loss.
Second,
The market price of the token increases. In this case, the seller gets paid more than the agreed upon price & as a result the buyer suffers a loss in this situation.
Market volatility can lead to uneven payout to the seller causing either the seller or the buyer loss of funds.
Manual Review
Put in measures to handle market volatility.
Deploy the contract with a little extra balance. Instead of paying the seller using the contract's balance
, use a fixed price
variable. Add a withdraw
function to be accessible only by the buyer to withdraw the extra funds otherwise they maybe locked into the contract.
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.