Skip to content

Commit

Permalink
Fix editListingParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishang Nadgauda committed Dec 2, 2021
1 parent f87ae35 commit b6b05cc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions contracts/v2/MarketWithAuction.sol
Expand Up @@ -198,14 +198,14 @@ contract MarketWithAuction is
targetListing.startTime < block.timestamp,
"Market: cannot edit auction after start."
);

targetListing.reservePricePerToken = _reservePricePerToken;
targetListing.buyoutPricePerToken = _buyoutPricePerToken;

}

// Must validate ownership and approval of the new quantity of tokens for diret listing.
if(targetListing.listingType == ListingType.Direct && targetListing.quantity != _quantityToList) {
if(targetListing.quantity != safeNewQuantity) {

if(targetListing.listingType == ListingType.Auction) {
transferListingTokens(address(this), targetListing.tokenOwner, targetListing.quantity, targetListing);
}
require(
validateOwnershipAndApproval(
targetListing.tokenOwner,
Expand All @@ -220,6 +220,8 @@ contract MarketWithAuction is
targetListing.quantity = safeNewQuantity;
}

targetListing.reservePricePerToken = _reservePricePerToken;
targetListing.buyoutPricePerToken = _buyoutPricePerToken;
targetListing.currency = _currencyToAccept;
targetListing.startTime = _secondsUntilStartTime == 0
? targetListing.startTime
Expand Down Expand Up @@ -596,7 +598,6 @@ contract MarketWithAuction is
)
internal
{
// TODO: check if it is efficient to perform the approval here.
if(_from == address(this)) {
IERC20(_currency).approve(address(this), _amount);
}
Expand Down

0 comments on commit b6b05cc

Please sign in to comment.