Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: medium
Invalid

`DeliveryPlace::settleAskMaker` can't be called twice, which might lead to unnecessary problems

Summary

when a seller want to provide the points, and finish the deal, he calls:

/**
* @notice Settle ask maker
* @dev caller must be offer authority
* @dev offer status must be Virgin or Canceled
* @dev market place status must be AskSettling
* @param _offer offer address
* @param _settledPoints settled points
*/
function settleAskMaker(address _offer, uint256 _settledPoints) external

if the _settledPoints are not the entire points he should provide, he will not be able to call this function again, even if he has the points and can settle the deal properly.

Vulnerability Details

the settleAskMaker calls PreMarkets::settledAskOffer at the end, which set:

offerInfo.offerStatus = OfferStatus.Settled;

therefore, if the points the seller provided, are lower than the points he should provide, he won't be able to call settleAskMaker again, since it has the following check:

if (offerInfo.offerStatus != OfferStatus.Virgin && offerInfo.offerStatus != OfferStatus.Canceled) {
revert InvalidOfferStatus();
}

Impact

In a situation where a seller mistakenly calls settleAskMaker with wrong _settledPoints parameter, or if the points are being distributed in more than 1 stage, and he called the settleAskMaker function, he won't be able to settle the deal, even though he has the abillity.
as a result, the seller lose some of his collateral and the buyer won't be able to receive their points.

Tools Used

manual review

Recommendations

change the logic of DeliveryPlace::settleAskMaker to make sure that seller can call this function as long as he didn't provide all the points he should provide.

Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.