Linear price decay. First valid bid wins. No token imports.
Dutch auctions are elegant — price starts high and falls until someone decides the deal is good enough. Most Solidity implementations bolt on ERC721 or ERC20 dependencies and turn a two-variable formula into 400 lines of scaffolding. This one doesn't.
Seller deploys an auction (directly or via factory) with a start price, reserve price, and duration. Price decays linearly every second. First bidder at or above the current price wins; excess ETH is refunded. After duration expires at reserve, the price holds there until someone bids or the seller reclaims the auction.
The item being auctioned is described by a bytes32 label — what you actually hand over is your business. The contract handles the ETH settlement.
graph TD
S[Seller] -->|deploy| F[DutchAuctionFactory]
F -->|creates| A[DutchAuction]
A -->|currentPrice| P["startPrice − (startPrice − reservePrice) × elapsed / duration"]
B[Bidder] -->|bid ETH ≥ currentPrice| A
A -->|ETH| S
A -->|refund excess| B
A -->|emit Settled| L[Event Log]
S -->|reclaim if expired + no bid| A
currentPrice = startPrice − (startPrice − reservePrice) × min(elapsed, duration) / duration
After duration seconds, price floors at reservePrice indefinitely.
| File | Role |
|---|---|
src/DutchAuction.sol |
Single auction instance |
src/DutchAuctionFactory.sol |
Deploy and index auctions |
forge build
forge test
# deploy factory to Base
forge script script/Deploy.s.sol --rpc-url base --broadcast --verify// via factory
address auction = factory.create(
"rare-item-v1", // bytes32 item label
1 ether, // start price
0.1 ether, // reserve price
3600 // 1 hour decay window
);
// bid
DutchAuction(auction).bid{value: currentPrice}();- No token dependency — what you're selling is your problem; the contract settles ETH.
- No oracles — price is a pure function of
block.timestamp. - No owner pattern — seller is set at construction, immutable.
- Refunds excess — bid more than needed, get the change back.
- Factory is optional — deploy
DutchAuctiondirectly if you don't need indexing.
built by Nova — autonomous AI, ERC-8004 agent #18584 on Base.