Desales is a decentralized auctions marketplace project built with Hardhat and Next.js.
Desales aims to provide a decentralized platform for conducting auctions. Users can participate in auctions using blockchain technology, ensuring transparency and security.
Contract addresses Auction: 0x695C1De27A868d772263c605eD9d9Cc855511754 DesalesNFT: 0x23DD585F4600cc26744CEE8A3F710cF3546a8967 MockStableCoin: 0x9d9592dF49D8E36b001C0A1AD65EAAadcD0b58b7
Desales is a decentralized auctions marketplace where users can create, bid on, and participate in auctions for unique NFTs. The platform leverages blockchain technology, IPFS storage, and smart contracts to ensure transparency, security, and a seamless auction experience.
-
Auction Configuration:
- Set the start and end times for the auction.
- Choose the stablecoin for pricing the NFT.
- Optionally enable the anti-sniping switch to prevent last-minute bidding overtaking the last bidder.
-
Mint NFT:
- Mint an NFT which will be stored in the associated smart contract.
-
IPFS Storage:
- Details of the auction and the minted NFT are uploaded to IPFS storage for decentralized and tamper-resistant storage.
-
Visit Auction Listing:
- Users can explore the auction listings to find NFTs they are interested in.
-
Place a Bid:
- Users can place a bid on an auction, transferring the selected stablecoin to the smart contract.
-
Refunding Last Bidder:
- If a higher bid is placed before the auction ends, the last bidder is automatically refunded.
-
Sniping Prvention:
- If a bid is placed within last ten minutes of auction, 10 minutes is added to end time of auction.
-
Winning Bidder:
- After the auction ends, the highest bidder can click a button to claim the NFT.
-
NFT Transfer:
- The NFT is transferred from the smart contract to the winner's wallet.
- Claiming Funds:
- The auctioneer can click a button after the auction ends to initiate the transfer of funds from the smart contract to their wallet.
Make sure you have the following prerequisites before getting started:
- Node.js and npm installed
- Obtain NFTStorage API key from NFTStorage
- Obtain Alchemy API key from Alchemy
Set the following environment variables in your project:
NEXT_PUBLIC_NFT_STORAGE_API_KEY: Obtain from nft.storage. PRIVATE_KEY: Your private key. ALCHEMY_API_KEY: Obtain from Alchemy.com. Create a .env.local file inside the /frontend directory and a .env file in the project root. Populate them with the corresponding API keys.
To set up the project locally, follow these steps:
# Install dependencies
npm install
Navigate to the /frontend directory
cd frontend
Install dependencies
npm install
Running Tests
Run tests for contracts
npx hardhat test