A decentralized auction application built on Ethereum, deployed on the Sepolia testnet. Nexus Auctions allows anyone to participate in auctions — placing bids, completing purchases, and withdrawing funds — all trustlessly on-chain, with owner-approved auction creation.
Deployed on Sepolia Testnet Contract Address:
0xbb08e8ff7B8668B4039F04e70891BFAC017FE17eView on Sepolia Etherscan
Website: Nexus Auctions Get Ethereum Sepolia: Google Sepolia Faucet
- Database Implementation (PostgreSQL)
- ERC-20 Token Implementation
- UI styling
- Upgradability (Proxy Pattern)
- Owner-approved auctions — only the contract owner can create auctions, assigning a seller per auction
- Open bidding — anyone can place a bid above the current highest bid
- Automatic refunds — outbid participants are not refunded automatically; payment is only sent on
completeTransaction - Winner purchase flow — the highest bidder completes the purchase by sending the exact bid amount after the auction ends
- Seller withdrawal — sellers withdraw their funds after the winner completes the purchase
- Result announcements — anyone can announce results on-chain after an auction ends, emitting a verifiable event
- Auction cancellation — the owner can cancel an active auction at any time
- Role-based UI — the frontend shows different panels depending on whether you are the owner, seller, or winner
Smart Contract
- Solidity
^0.8.26 - Hardhat
- Deployed & verified on Sepolia testnet
Frontend
- React + Vite
- Wagmi v2
- Viem v2
- RainbowKit v2
- TanStack Query
Nexus-Auctions/
├── Auction/ # Hardhat project
│ ├── contracts/
│ │ └── Auction.sol # Main auction smart contract
│ ├── scripts/
│ │ └── deploy.js # Deployment script
│ ├── hardhat.config.js
│ └── package.json
├── src/ # React frontend
│ ├── App.jsx # Main UI component
│ ├── main.jsx # Wagmi + RainbowKit providers
│ └── auction.js # Contract ABI and address
├── public/
├── index.html
└── package.json
The Auction.sol contract supports the following functions:
| Function | Access | Description |
|---|---|---|
createAuction(seller, auctionNumber, startingPrice, duration) |
Owner only | Creates a new auction |
bid(auctionNumber, bidAmount) |
Anyone | Places a bid above the current highest |
cancelAuction(auctionNumber) |
Owner only | Cancels an active auction |
completeTransaction(auctionNumber) |
Winner only | Winner sends ETH to complete the purchase |
sellerWithdrawal(auctionNumber) |
Seller only | Seller withdraws funds after purchase |
announceResults(auctionNumber) |
Anyone | Emits ResultsAnnounced event after auction ends |
checkAuctionActive(auctionNumber) |
View | Returns whether an auction is currently active |
timeLeft(auctionNumber) |
View | Returns seconds remaining in the auction |
checkHighestBidder(auctionNumber) |
View | Returns the current highest bidder address |
checkActiveBidPrice(auctionNumber) |
View | Returns the current highest bid amount |
- Owner creates an auction — specifying the seller address, auction number, starting price, and duration in seconds
- Bidders place bids — any bid must be above the current highest bid (or above starting price for the first bid)
- Auction ends — once the duration expires, no more bids are accepted
- Results announced — anyone can call
announceResultsto emit a verifiable on-chain event - Winner completes purchase — the highest bidder calls
completeTransaction, sending the exact bid amount in ETH - Seller withdraws — after the purchase is complete, the seller calls
sellerWithdrawalto receive the funds
The contract uses custom errors for gas-efficient reverts:
NotOwner— caller is not the contract ownerAuctionAlreadyExists— auction number already in useAuctionDoesNotExist— auction number not foundAuctionNotActive— auction has ended or been cancelledBidTooLow— bid is not above current highest bidLowerThanStartingPrice— first bid is below starting priceYouAreNotTheWinner— only the highest bidder can complete the transactionYouAreNotTheSeller— only the assigned seller can withdrawWrongAmount— ETH sent does not match the winning bidAlreadyPurchased— purchase already completedAlreadyWithdrawn— seller has already withdrawn fundsNoBidders— no bids were placed before auction ended
MIT