This is a smart contract written in Solidity that implements a time-limited auction system for non-fungible tokens (NFTs) or other digital assets. The contract follows the typical auction guidelines, ensuring that only the highest bidder wins the auction and receives the item, while the seller receives payment in return.
- Time-Based Auction: The auction has a predetermined start and end time, and bids can only be placed within this timeframe.
- Highest Bidder Wins: The contract keeps track of the highest bid and the corresponding highest bidder. At the end of the auction, the highest bidder wins and receives the auctioned item.
- Seller Receives Payment: The seller receives the payment from the highest bidder in exchange for the auctioned item.
- Minimum Bidder Requirement (Optional): The contract can be configured to require a minimum number of bidders before the auction can end. This condition can be enabled or disabled as needed.
To deploy and interact with this contract, you'll need:
- A compatible Ethereum development environment (e.g., Remix, Hardhat)
- An Ethereum client or node to connect to (e.g., Ganache, Geth, Infura)
- Basic understanding of Solidity and smart contract development
- Clone this repository or download the contract source code.
- Set up your Ethereum development environment and connect to an Ethereum client or node.
- Compile the contract using your development environment's compiler.
- Deploy the contract to the desired Ethereum network or local testnet.
- Once the contract is deployed, note the contract address and the auction start and end times.
- Interact with the contract using your development environment's interface or a compatible Ethereum wallet.
- Place bids by calling the
placeBidfunction and providing the desired bid amount in Wei. - Monitor the auction progress by checking the current highest bid and the number of bidders (if the minimum bidder requirement is enabled).
- After the auction ends, the highest bidder can claim the auctioned item by calling the
claimItemfunction. - The seller can withdraw the received payment by calling the
withdrawPaymentfunction.
The contract includes several configurable parameters that can be adjusted before deployment:
auctionStartTime: The timestamp when the auction starts, allowing bids to be placed.auctionEndTime: The timestamp when the auction ends, and no further bids are accepted.minimumBidderCount(optional): The minimum number of bidders required for the auction to end. Set to 0 to disable this requirement.
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.