Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Clean up offer matching code
Browse files Browse the repository at this point in the history
  • Loading branch information
amarinkovic committed Feb 7, 2022
1 parent f0242a1 commit dbe1a57
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions contracts/MarketCoreFacet.sol
Expand Up @@ -295,7 +295,7 @@ contract MarketCoreFacet is EternalStorage, Controller, MarketFacetBase, IDiamon

// there is at least one offer stored for token pair
uint256 bestOfferId = dataUint256[__iaa(0, _buyToken, _sellToken, "bestOfferId")];
if(marketOffer == true) {
if(marketOffer) {
require(bestOfferId != 0, "not enough orders in market");
} else if(bestOfferId == 0) {
break;
Expand Down Expand Up @@ -345,11 +345,6 @@ contract MarketCoreFacet is EternalStorage, Controller, MarketFacetBase, IDiamon
remainingSellAmount_ = remainingSellAmount_.sub(finalSellAmount);
remainingBuyAmount_ = remainingSellAmount_.mul(remainingBuyAmount_).div(sellAmountOld);
}

// if nothing left to sell or buy then we're done
if (remainingSellAmount_ == 0 || (remainingBuyAmount_ == 0 && !marketOffer)) {
break;
}
}
}

Expand Down

0 comments on commit dbe1a57

Please sign in to comment.