Skip to content

Commit

Permalink
back to private variables for better encapsulations
Browse files Browse the repository at this point in the history
  • Loading branch information
ggonzalez94 committed Dec 15, 2024
1 parent 9fc4d79 commit 019e507
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/DutchAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract contract DutchAuction is ReentrancyGuard {
uint256 internal immutable floorPrice;

/// @notice The number of identical items available for sale
uint256 internal inventory;
uint256 private inventory;

event AuctionStarted(
address indexed seller,
Expand Down
16 changes: 8 additions & 8 deletions src/EnglishAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ abstract contract EnglishAuction {
address internal immutable seller;

/// @dev Timestamp (in seconds) at which the auction ends
uint256 internal endTime;
uint256 private endTime;

/// @dev The current highest bid amount
/// This is set to the reserve price at constuction time
uint256 internal highestBid;
uint256 private highestBid;

/// @dev The address of the highest bidder
address internal highestBidder;
address private highestBidder;

/// @dev Indicates if the auction has been finalized
bool internal finalized;
bool private finalized;

/// @dev Mapping of addresses to refunds they can withdraw (due to being outbid).
mapping(address bidder => uint256 amount) internal refunds;
mapping(address bidder => uint256 amount) private refunds;

// -------------------------
// Anti-Sniping Variables (https://en.wikipedia.org/wiki/Auction_sniping)
Expand All @@ -52,11 +52,11 @@ abstract contract EnglishAuction {
/// the auction endTime is extended by `extensionPeriod` seconds.
/// If you don't want to extend the auction in the case of a last minute bid, set this to 0.
/// But it is highly recommended to have some extension period, as it will discourage last minute sniping.
uint256 internal immutable extensionThreshold;
uint256 internal immutable extensionPeriod;
uint256 private immutable extensionThreshold;
uint256 private immutable extensionPeriod;

/// @dev Accumulated proceeds for the seller to withdraw after finalization.
uint256 internal sellerProceeds;
uint256 private sellerProceeds;

/// @notice Emitted when the auction starts.
/// @param seller The address of the seller.
Expand Down

0 comments on commit 019e507

Please sign in to comment.