{"id":24516060,"url":"https://github.com/donguillotine/decentralized-auction-contract","last_synced_at":"2026-05-13T07:41:58.466Z","repository":{"id":258183592,"uuid":"867658318","full_name":"DonGuillotine/decentralized-auction-contract","owner":"DonGuillotine","description":"A decentralized auction platform that allows users to create time-bound auctions, place bids, and automatically manages the auction lifecycle including bid placement, auction closing, and fund distribution.","archived":false,"fork":false,"pushed_at":"2024-10-16T10:12:43.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T01:22:43.472Z","etag":null,"topics":["auction","blockchain","chai","decentralized-application","ethereum","ethersjs","hardhat","lisk","openzeppelin","smart-contracts","solidity"],"latest_commit_sha":null,"homepage":"https://sepolia-blockscout.lisk.com/address/0x635C0C9231efE6b2e85aFc6Cd7F26aEDC3b99044?tab=write_contract","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DonGuillotine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-04T13:28:55.000Z","updated_at":"2024-10-20T19:45:09.000Z","dependencies_parsed_at":"2024-10-17T23:44:32.287Z","dependency_job_id":"2e977476-4340-425e-98cc-90791ef00b5d","html_url":"https://github.com/DonGuillotine/decentralized-auction-contract","commit_stats":null,"previous_names":["donguillotine/decentralized-auction-contract"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonGuillotine%2Fdecentralized-auction-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonGuillotine%2Fdecentralized-auction-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonGuillotine%2Fdecentralized-auction-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonGuillotine%2Fdecentralized-auction-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DonGuillotine","download_url":"https://codeload.github.com/DonGuillotine/decentralized-auction-contract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719372,"owners_count":20336596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auction","blockchain","chai","decentralized-application","ethereum","ethersjs","hardhat","lisk","openzeppelin","smart-contracts","solidity"],"created_at":"2025-01-22T01:20:53.113Z","updated_at":"2026-05-13T07:41:53.447Z","avatar_url":"https://github.com/DonGuillotine.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AuctionSystem Smart Contract\n\nAuctionSystem is a decentralized auction platform built on Ethereum. It allows users to create time-bound auctions, place bids, and automatically manages the auction lifecycle including bid placement, auction closing, and fund distribution.\n\n## Features\n\n- Create time-bound auctions with specified start and end times\n- Place bids on active auctions\n- Automatic handling of highest bid updates\n- Secure withdrawal mechanism for non-winning bidders\n- Automatic transfer of winning bid to the seller upon auction completion\n- Comprehensive event logging for frontend integration\n- Gas-optimized operations using modern Solidity patterns\n\n## Technology Stack\n\n- Solidity 0.8.24\n- Hardhat Development Environment\n- OpenZeppelin Contracts 5.0.0\n- Ethers.js 6.x\n- Chai for testing\n\n## Prerequisites\n\n- Node.js v14.x or later\n- npm 6.x or later\n- An Ethereum wallet with Sepolia testnet ETH for deployment\n\n## Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/DonGuillotine/decentralized-auction-contract.git\n   cd decentralized-auction-contract\n   ```\n\n2. Install dependencies:\n   ```\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory with the following content:\n   ```\n   LISK_SEPOLIA_RPC_URL=your_rpc.sepolia-api_key\n   PRIVATE_KEY=your_ethereum_private_key\n   ETHERSCAN_API_KEY=your_etherscan_api_key\n   ```\n\n## Usage\n\n### Compile Contracts\n\n```\nnpx hardhat compile\n```\n\n### Run Tests\n\n```\nnpx hardhat test\n```\n#### All Tests Passed\n\n![alt text](image.png)\n\n### Deploy to Sepolia Testnet\n\n```\nnpx hardhat run scripts/deploy.js --network lisk-sepolia\n```\n\nThis script will deploy the contract and automatically verify it on Etherscan.\n\n## Contract Interface\n\n### Functions\n\n1. `createAuction(uint256 _startTime, uint256 _endTime)`: Create a new auction\n2. `placeBid(uint256 _auctionId)`: Place a bid on an active auction\n3. `endAuction(uint256 _auctionId)`: End an auction after its end time\n4. `withdrawBid(uint256 _auctionId)`: Withdraw a non-winning bid\n5. `getAuctionDetails(uint256 _auctionId)`: Get details of a specific auction\n\n### Events\n\n1. `AuctionCreated(uint256 indexed auctionId, address indexed seller, uint256 startTime, uint256 endTime)`\n2. `BidPlaced(uint256 indexed auctionId, address indexed bidder, uint256 amount)`\n3. `AuctionEnded(uint256 indexed auctionId, address winner, uint256 amount)`\n4. `WithdrawalMade(uint256 indexed auctionId, address indexed bidder, uint256 amount)`\n\n## Security Considerations\n\n- The contract uses OpenZeppelin's `ReentrancyGuard` to prevent reentrancy attacks\n- Time-based operations use `block.timestamp`, which can be slightly manipulated by miners (maximum of a few seconds)\n- The contract has been thoroughly tested, but we recommend a professional audit before mainnet deployment\n\n## Gas Optimization\n\n- Utilizes mappings for efficient data storage and retrieval\n- Implements checks-effects-interactions pattern to prevent reentrancy\n- Uses custom errors for gas-efficient error handling\n\n## Testing\n\nThe contract includes a comprehensive test suite covering various scenarios including:\n- Auction creation\n- Bidding mechanics\n- Auction ending\n- Bid withdrawals\n- Edge cases and error conditions\n\nRun the tests using the command mentioned in the Usage section.\n\n## Deployment\n\nThe deployment script (`scripts/deploy.js`) handles:\n1. Contract deployment to the Sepolia testnet\n2. Waiting for block confirmations\n3. Automatic contract verification on Etherscan\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Contact\n\nFor any queries or support, please open an issue in the GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonguillotine%2Fdecentralized-auction-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonguillotine%2Fdecentralized-auction-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonguillotine%2Fdecentralized-auction-contract/lists"}