Skip to content

Commit

Permalink
chore: exploit fix prevented auctions be settled if there was no bidd…
Browse files Browse the repository at this point in the history
…er (#30)
  • Loading branch information
charlescrain authored Aug 31, 2023
1 parent 2e80cb5 commit a423de7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auctionhouse/SuperRareAuctionHouse.sol
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ contract SuperRareAuctionHouse is

if (currBid.bidder == address(0)) {
erc721.transferFrom(address(this), auction.auctionCreator, _tokenId);
require(erc721.ownerOf(_tokenId) == auction.auctionCreator , "settleAuction::Failed to return token to auction creator");
} else {
erc721.transferFrom(address(this), currBid.bidder, _tokenId);

Expand All @@ -351,9 +352,9 @@ contract SuperRareAuctionHouse is
);

marketplaceSettings.markERC721Token(_originContract, _tokenId, true);
require(erc721.ownerOf(_tokenId) == currBid.bidder , "settleAuction::Failed to transfer to auction winner");
}

require(erc721.ownerOf(_tokenId) == currBid.bidder, "sending failed");

emit AuctionSettled(
_originContract,
Expand Down

0 comments on commit a423de7

Please sign in to comment.