Skip to content

Commit

Permalink
ah: revert custom paused bool
Browse files Browse the repository at this point in the history
it's not bit-packed when placed after the auction struct
and for now we prefer to not force it into the auction struct

esp. since bigger gas savings are coming from descriptor storage read optimizations
  • Loading branch information
eladmallel committed Oct 11, 2023
1 parent a1d52a2 commit 0edf915
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ contract NounsAuctionHousePreV2Migration is PausableUpgradeable, ReentrancyGuard
uint56 timeBuffer;
uint8 minBidIncrementPercentage;
INounsAuctionHouseV2.AuctionV2 auction;
bool paused;
}

uint256 private startSlot;
Expand Down Expand Up @@ -70,7 +69,6 @@ contract NounsAuctionHousePreV2Migration is PausableUpgradeable, ReentrancyGuard
bidder: oldLayoutCache.auction.bidder,
settled: oldLayoutCache.auction.settled
});
newLayout.paused = paused();
}

function _oldLayout() internal pure returns (OldLayout storage layout) {
Expand Down
17 changes: 2 additions & 15 deletions packages/nouns-contracts/contracts/NounsAuctionHouseV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ contract NounsAuctionHouseV2 is
/// @notice The active auction
INounsAuctionHouseV2.AuctionV2 public auctionStorage;

/// @notice Whether this contract is paused or not
/// @dev Replaces the state variable from PausableUpgradeable, to bit pack this bool with `auction` and save gas
bool public __paused;

/// @notice The Nouns price feed state
mapping(uint256 => SettlementState) settlementHistory;

Expand Down Expand Up @@ -176,8 +172,7 @@ contract NounsAuctionHouseV2 is
* anyone can settle an ongoing auction.
*/
function pause() external override onlyOwner {
__paused = true;
emit Paused(_msgSender());
_pause();
}

/**
Expand All @@ -186,21 +181,13 @@ contract NounsAuctionHouseV2 is
* contract is paused. If required, this function will start a new auction.
*/
function unpause() external override onlyOwner {
__paused = false;
emit Unpaused(_msgSender());
_unpause();

if (auctionStorage.startTime == 0 || auctionStorage.settled) {
_createAuction();
}
}

/**
* @dev Get whether this contract is paused or not.
*/
function paused() public view override returns (bool) {
return __paused;
}

/**
* @notice Set the auction time buffer.
* @dev Only callable by the owner.
Expand Down

0 comments on commit 0edf915

Please sign in to comment.