|
1 |
| -# 🏗 Scaffold-ETH 2 |
| 1 | +# ZKonnect: Decentralized Event Management and Ticketing powered by Zero Knowledge. |
2 | 2 |
|
3 |
| -<h4 align="center"> |
4 |
| - <a href="https://docs.scaffoldeth.io">Documentation</a> | |
5 |
| - <a href="https://scaffoldeth.io">Website</a> |
6 |
| -</h4> |
| 3 | +<p align="center"> |
| 4 | + <img src="https://github.com/user-attachments/assets/aa342c7e-8ca2-4d95-a2f1-598c32d79cad" alt="Sublime's custom image"/> |
| 5 | +</p> |
7 | 6 |
|
8 |
| -🧪 An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts. |
| 7 | +ZKonnect is a blockchain-based event management and ticketing platform that leverages decentralized technologies to enhance transparency, security, and fairness in ticketing systems. Designed for organizers and attendees, ZKonnect eliminates ticket fraud, prevents black-market reselling, and enables seamless event management with role-based access control. |
9 | 8 |
|
10 |
| -⚙️ Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript. |
| 9 | +## **Features** |
11 | 10 |
|
12 |
| -- ✅ **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it. |
13 |
| -- 🪝 **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks wrapper around [wagmi](https://wagmi.sh/) to simplify interactions with smart contracts with typescript autocompletion. |
14 |
| -- 🧱 [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend. |
15 |
| -- 🔥 **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet. |
16 |
| -- 🔐 **Integration with Wallet Providers**: Connect to different wallet providers and interact with the Ethereum network. |
| 11 | +### For Organizers: |
| 12 | + |
17 | 13 |
|
18 |
| - |
| 14 | +- **Event Creation**: Organizers can create events by specifying details like event name, image, maximum attendees, and a secret staking ID. |
| 15 | +- **Editable Event Details**: Organizers can modify event details as needed, stored securely on-chain or via decentralized storage. |
| 16 | +- **Secure Ticket Validation**: Attendees are validated on the day of the event using Zero-Knowledge Proofs (zkProofs). |
19 | 17 |
|
20 |
| -## Requirements |
| 18 | +### For Buyers: |
| 19 | + |
21 | 20 |
|
22 |
| -Before you begin, you need to install the following tools: |
| 21 | +- **Role-Based Access Control**: Buyers and organizers have separate views, authenticated using MetaMask/Coinbase wallet addresses. |
| 22 | +- **Seamless Ticket Purchase**: Buyers stake a secret ID, verify using zkProofs, and pay via cryptocurrency. |
| 23 | +- **NFT Ticketing**: After purchasing, buyers receive a minted NFT containing event details and a zkProof-generated hash as a secure ticket. |
23 | 24 |
|
24 |
| -- [Node (>= v18.18)](https://nodejs.org/en/download/) |
25 |
| -- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install)) |
26 |
| -- [Git](https://git-scm.com/downloads) |
| 25 | +--- |
27 | 26 |
|
28 |
| -## Quickstart |
| 27 | +## **Setup Instructions** |
29 | 28 |
|
30 |
| -To get started with Scaffold-ETH 2, follow the steps below: |
| 29 | +### **Prerequisites** |
| 30 | +- Node.js (v16 or higher) |
| 31 | +- Yarn or npm |
| 32 | +- Hardhat (for smart contract deployment) |
| 33 | +- MetaMask wallet extension |
| 34 | +- Polygon zkEVM/Amoy testnet configuration |
31 | 35 |
|
32 |
| -1. Install dependencies if it was skipped in CLI: |
33 |
| - |
34 |
| -``` |
35 |
| -cd my-dapp-example |
36 |
| -yarn install |
| 36 | +### **1. Clone the Repository** |
| 37 | +```bash |
| 38 | +git clone https://github.com/your-username/ETH24Submission.git |
| 39 | +cd ETH24Submission |
37 | 40 | ```
|
38 | 41 |
|
39 |
| -2. Run a local network in the first terminal: |
40 |
| - |
| 42 | +### **2. Install Dependencies** |
| 43 | +#### For Scaffold-ETH2 Setup |
| 44 | +- Install required tools: |
| 45 | + ```bash |
| 46 | + yarn install |
| 47 | + ``` |
| 48 | + |
| 49 | +### **3. Smart Contract Deployment** |
| 50 | +#### Scaffold-ETH2 |
| 51 | +1. Run a local Ethereum network in the first terminal: |
| 52 | + ```bash |
| 53 | + yarn chain |
| 54 | + ``` |
| 55 | + |
| 56 | +2. Deploy the test contract on a second terminal: |
| 57 | + ```bash |
| 58 | + yarn deploy |
| 59 | + ``` |
| 60 | + |
| 61 | +#### ZKonnect |
| 62 | +1. Navigate to the backend directory: |
| 63 | + ```bash |
| 64 | + cd packages/hardhat |
| 65 | + ``` |
| 66 | +2. Configure the deployment network in `hardhat.config.js` (e.g., Polygon zkEVM/Amoy testnet or local network). |
| 67 | +3. Compile the contracts: |
| 68 | + ```bash |
| 69 | + npx hardhat compile |
| 70 | + ``` |
| 71 | +4. Deploy the smart contracts: |
| 72 | + ```bash |
| 73 | + npx hardhat deploy --network polygonZkEvm |
| 74 | + ``` |
| 75 | +5. Copy the deployed contract address and update the frontend configuration file (`frontend/src/config.js`). |
| 76 | + |
| 77 | +### **4. Run the Backend** |
| 78 | +Start the backend server: |
| 79 | +```bash |
| 80 | +npm start |
41 | 81 | ```
|
42 |
| -yarn chain |
43 |
| -``` |
44 |
| - |
45 |
| -This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `packages/hardhat/hardhat.config.ts`. |
46 |
| - |
47 |
| -3. On a second terminal, deploy the test contract: |
48 | 82 |
|
| 83 | +### **5. Run the Frontend** |
| 84 | +#### Scaffold-ETH2 |
| 85 | +Start the Next.js app: |
| 86 | +```bash |
| 87 | +yarn start |
49 | 88 | ```
|
50 |
| -yarn deploy |
51 |
| -``` |
52 |
| - |
53 |
| -This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. |
| 89 | +Visit the app at `http://localhost:3000`. |
54 | 90 |
|
55 |
| -4. On a third terminal, start your NextJS app: |
| 91 | +#### ZKonnect |
| 92 | +1. Navigate to the frontend directory: |
| 93 | + ```bash |
| 94 | + cd ../nextjs |
| 95 | + ``` |
| 96 | +2. Start the development server: |
| 97 | + ```bash |
| 98 | + yarn start |
| 99 | + ``` |
| 100 | +3. Open the app in your browser at `http://localhost:3000`. |
56 | 101 |
|
57 |
| -``` |
58 |
| -yarn start |
59 |
| -``` |
| 102 | +--- |
60 | 103 |
|
61 |
| -Visit your app on: `http://localhost:3000`. You can interact with your smart contract using the `Debug Contracts` page. You can tweak the app config in `packages/nextjs/scaffold.config.ts`. |
| 104 | +## **How It Works** |
62 | 105 |
|
63 |
| -Run smart contract test with `yarn hardhat:test` |
| 106 | +### **Organizer Workflow**: |
| 107 | +1. Login with MetaMask or Coinbase Wallet. |
| 108 | +2. Create an event by filling in event details and uploading images. |
| 109 | +3. Manage and edit event details stored securely on Polygon zkEVM. |
64 | 110 |
|
65 |
| -- Edit your smart contracts in `packages/hardhat/contracts` |
66 |
| -- Edit your frontend homepage at `packages/nextjs/app/page.tsx`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation. |
67 |
| -- Edit your deployment scripts in `packages/hardhat/deploy` |
| 111 | +### **Buyer Workflow**: |
| 112 | +1. Login with MetaMask or Coinbase Wallet. |
| 113 | +2. Browse events and select an event. |
| 114 | +3. Enter the secret staking ID and pay using cryptocurrency. |
| 115 | +4. Receive an NFT ticket as proof of purchase. Wait for the event :) |
68 | 116 |
|
| 117 | +### **Event Verification**: |
| 118 | +- On the event day, buyers provide their zkProof-generated hash, which the organizer verifies to grant entry, and all of this is automated via QR codes. |
| 119 | +[](https://www.youtube.com/watch?v=fGA3MQ0U6fA) |
| 120 | +--- |
69 | 121 |
|
70 |
| -## Documentation |
| 122 | +## **Technologies Used** |
71 | 123 |
|
72 |
| -Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2. |
| 124 | +### **Blockchain and smart contracts**: |
| 125 | + |
| 126 | + |
| 127 | + |
73 | 128 |
|
74 |
| -To know more about its features, check out our [website](https://scaffoldeth.io). |
| 129 | +### **Authentication**: |
| 130 | + |
| 131 | + |
75 | 132 |
|
76 |
| -## Contributing to Scaffold-ETH 2 |
77 | 133 |
|
78 |
| -We welcome contributions to Scaffold-ETH 2! |
| 134 | +### **Proof Generation**: |
| 135 | +- **Circom and Snark.js**: For generating and validating zkProofs to secure sensitive data. |
79 | 136 |
|
80 |
| -Please see [CONTRIBUTING.MD](https://github.com/scaffold-eth/scaffold-eth-2/blob/main/CONTRIBUTING.md) for more information and guidelines for contributing to Scaffold-ETH 2. |
| 137 | +### **Frontend**: |
| 138 | +- **Next.js**: For a modern, responsive, and performant frontend. |
| 139 | +- **Scaffold-ETH2**: For integrating Ethereum and bootstrapping frontend components. |
0 commit comments