A decentralized Ethereum-based Auction platform built with Solidity, Hardhat, and Hardhat Ignition.
Users can create auctions, place bids, end auctions, and manage auction proceeds in a secure and gas-optimized way.
| Folder | Purpose |
|---|---|
/contracts/ |
Smart Contracts (AuctionHouse.sol, AuctionHouseFactory.sol) |
/ignition/modules/ |
Hardhat Ignition deployment modules |
/test/ |
Full test coverage with Hardhat and Chai |
/deploy/ |
(optional) Legacy deploy scripts (if needed) |
- Auction of a specific item.
- Bidding with ETH.
- Refunds on rebid.
- Auction ending with owner withdrawal of highest bid.
- Fully gas optimized (custom errors, CEI pattern, ReentrancyGuard).
- Deploys and tracks multiple AuctionHouse instances.
- Emits
AuctionCreatedevents for easy off-chain indexing.
- Node.js (>= 18.x)
- pnpm (>= 8.x)
- Hardhat (>= 2.23.x)
Install dependencies:
pnpm installpnpm hardhat compilepnpm hardhat testFull coverage: bidding, refunds, withdrawals, factory deployment, view functions, security checks.
Check coverage report:
pnpm hardhat coverageStart a local Hardhat network:
pnpm hardhat nodeIn another terminal, deploy using Hardhat Ignition:
pnpm hardhat ignition deploy ignition/modules/AuctionHouseFactoryModule.ts --network localhostYour AuctionHouseFactory will be deployed locally.
Open Hardhat console:
pnpm hardhat console --network localhostSample interaction:
const factory = await ethers.getContractAt(
"AuctionHouseFactory",
"0xYourFactoryAddress"
);
await factory.createAuction("Excalibur Sword", 3600);
const auctions = await factory.getAllAuctions();
const auction = await ethers.getContractAt("AuctionHouse", auctions[0]);
await auction.bid({ value: ethers.parseEther("1.0") });
await auction.endAuction();
await auction.ownerWithdraw();Configure .env:
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID
SEPOLIA_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEYDeploy to Sepolia:
pnpm hardhat ignition deploy ignition/modules/AuctionHouseFactoryModule.ts --network sepolia- Gas-optimized contracts
- Full test coverage (~95%+)
- Local + Testnet deployable
- Professional Hardhat Ignition support
- Fully decentralized auction flow
MIT License © 2025 Daniel Neris
Pull Requests and Issues are welcome!
Let's build the decentralized future together.