This smart contract implements a simple auction mechanism where users can place ETH bids.
If a new bid is placed within the final 10 minutes of the auction, the end time is automatically extended by another 10 minutes.
Losing bidders may withdraw their funds with a 2% fee.
Only the highest bidder wins, and the owner can claim the winning bid after the auction ends.
- Minimum bid increase: 5%
- Auto-extension window: 10 minutes
- Fee on refunds: 2%
- Reentrancy protection via OpenZeppelin's
ReentrancyGuard
- Custom modifiers for access and auction state checks
- Events for external indexing:
NewBid
,AuctionEnded
,Withdrawal
The contract is deployed by calling the constructor with the auction duration in seconds.
Example:
new Auction(3600); // 1-hour auction