A censorship-resistant NFT auction marketplace that lets anyone upload digital art to IPFS, auction it, and tokenize it as an ERC-721 NFT ($ART) — all without centralized control.
Install all dependencies:
npm install
Required packages:
ipfs-http-client@^49.0.2
Solidity compiler version:
^0.6.3
-
Connect your MetaMask wallet to Rinkeby Testnet
-
Start the development server:
npm run start
This DApp allows users to:
- Upload digital artwork to IPFS
- Start an on-chain auction for the art
- Set custom auction rules (price, increment, duration)
- Once sold, mint the artwork as an ERC-721 NFT (
$ART
)
When starting an auction, the seller must specify:
price
: Minimum starting price_bidIncrement
: Fixed minimum increment for new bids (prevents spam bidding and bots)tokenURI
: IPFS CID hash for the artwork
There are two types of token IDs tracked:
_tokenIds
: Unique IDs for tokenized (minted) images_artItemIds
: Unique IDs for artworks listed for auction (not yet tokenized)
Each artwork's bidding data is mapped as:
mapping(uint256 => mapping(address => uint256)) public fundsByBidder;
struct ArtItem {
address payable seller;
uint256 minbid;
string tokenURI;
bool exists;
uint bidIncrement;
uint time;
uint timePeriod;
bool cancelled;
bool auctionstarted;
}
struct bidding {
uint highestBindingBid;
address payable highestBidder;
}
There are two types of bid amounts tracked:
highestBid
: The max bid submittedhighestBindingBid
: The max bid that counts (based on increment logic)
Action | Value |
---|---|
Starting price | 10 ETH |
Bid increment | 1 ETH |
Bidder A bids | 15 ETH |
highestBid | 15 ETH |
highestBindingBid | 11 ETH |
If Bidder B later bids 12 ETH, Bidder A’s new highestBindingBid
becomes 13 ETH, maintaining a fair lead.
When the auction ends, the NFT is minted for the highestBindingBid, and any excess ETH is refunded to the highest bidder.
- Overbidding oneself is prevented
- Underbidding against the current highestBindingBid is disallowed
- Edge cases for tied bids or late entries are handled
This contract uses the withdrawal pattern to securely allow bidders to withdraw excess funds, reducing the risk of reentrancy attacks:
function withdraw() public {
// safely withdraw user’s available balance
}
- The contract is fully decentralized, with no owner
- Anyone can list, bid, or mint artwork
- All art metadata is stored on IPFS
- Even if the frontend is shut down, the smart contract remains functional and accessible via direct interaction (e.g., Etherscan or scripts)
Run a local development environment (e.g., Ganache):
truffle migrate
truffle test
- Upload → Auction → Mint → Trade — fully decentralized.
- Auction is governed by transparent rules and protected from spam or manipulation.
- IPFS + Ethereum ensures that neither your art nor your marketplace can be taken down.