|
1 | 1 | # EthPixelWar |
| 2 | + |
| 3 | +EthPixelWar is a decentralized pixel art platform built on Ethereum where users can bid on pixels and create collaborative artwork. Each pixel can be owned by the highest bidder who can then set its color. When outbid, previous owners can withdraw their funds. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Grid-based pixel art canvas (configurable size) |
| 8 | +- Auction mechanism for pixel ownership |
| 9 | +- RGB color customization for owned pixels |
| 10 | +- Withdrawal system for outbid participants |
| 11 | +- Owner-controlled war ending mechanism |
| 12 | + |
| 13 | +## Smart Contract Overview |
| 14 | + |
| 15 | +The main contract `EthPixelWar.sol` implements: |
| 16 | +- Pixel ownership through bidding |
| 17 | +- Color management for owned pixels |
| 18 | +- Fund management for bids and withdrawals |
| 19 | +- Access control for pixel modifications |
| 20 | +- Event emission for frontend integration |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +- [Foundry](https://book.getfoundry.sh/getting-started/installation) |
| 25 | + |
| 26 | +## Installation |
| 27 | + |
| 28 | +1. Clone the repository: |
| 29 | + |
| 30 | +```bash |
| 31 | +git clone https://github.com/yourusername/EthPixelWar.git |
| 32 | +cd EthPixelWar |
| 33 | +``` |
| 34 | + |
| 35 | +2. Install dependencies: |
| 36 | + |
| 37 | +```bash |
| 38 | +forge install |
| 39 | +``` |
| 40 | + |
| 41 | +## Deployment |
| 42 | + |
| 43 | +1. Compile the contract: |
| 44 | + |
| 45 | +```bash |
| 46 | +forge build |
| 47 | +``` |
| 48 | + |
| 49 | +2. Run the local node: |
| 50 | + |
| 51 | +```bash |
| 52 | +anvil |
| 53 | +``` |
| 54 | + |
| 55 | +3. Deploy the contract: |
| 56 | + |
| 57 | +```bash |
| 58 | +forge script script/DeployEthPixelWar.s.sol --rpc-url http://localhost:8545 --broadcast |
| 59 | +``` |
| 60 | + |
| 61 | +## Testing |
| 62 | + |
| 63 | +```bash |
| 64 | +forge test |
| 65 | +``` |
| 66 | + |
| 67 | +## Web Interface |
| 68 | + |
| 69 | +The web interface for EthPixelWar is available in a separate repository: [EthPixelWarUI](https://github.com/mablr/EthPixelWarUI) |
| 70 | + |
| 71 | +Follow the instructions in the UI repository to set up and connect the frontend to your deployed contract. |
| 72 | + |
| 73 | +## Contract Modes |
| 74 | + |
| 75 | +### Standard Mode |
| 76 | +- Full on-chain color storage |
| 77 | +- Higher gas costs for color updates |
| 78 | +- Complete decentralization |
| 79 | + |
| 80 | +### Lite Mode |
| 81 | +- Color data stored off-chain |
| 82 | +- Lower gas costs |
| 83 | +- Relies on event indexing for color state |
| 84 | + |
| 85 | +## Contributing |
| 86 | + |
| 87 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 88 | + |
| 89 | +## License |
| 90 | + |
| 91 | +This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments