|
1 | | -# poh-circle |
2 | | -Integration of Circle UBI |
| 1 | +# Proof of Humanity Circles Proxy |
| 2 | + |
| 3 | +A proxy contract that bridges Proof of Humanity verification with Circles UBI, allowing verified humans to register in the Circles ecosystem and manage trust relationships automatically. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This contract enables Proof of Humanity users to: |
| 8 | +- Register their verified humanity in the Circles Group |
| 9 | +- Link multiple humanity IDs to a single Circles account |
| 10 | +- Maintain trust relationships based on PoH verification status |
| 11 | +- Batch process trust re-evaluations for efficiency |
| 12 | + |
| 13 | +## Environment Setup |
| 14 | + |
| 15 | +### Prerequisites |
| 16 | +- Node.js (v22+ recommended) |
| 17 | +- npm package manager |
| 18 | +- Git |
| 19 | + |
| 20 | +### Installation |
| 21 | + |
| 22 | +1. Clone the repository and install dependencies: |
| 23 | +```bash |
| 24 | +git clone https://github.com/Proof-Of-Humanity/poh-circle |
| 25 | +cd poh-circle |
| 26 | +npm install |
| 27 | +``` |
| 28 | + |
| 29 | +2. Set up your environment file: |
| 30 | +```bash |
| 31 | +cp .env.example .env |
| 32 | +``` |
| 33 | + |
| 34 | +3. Edit the `.env` file with your actual values: |
| 35 | +```bash |
| 36 | +# Required for testnet/mainnet deployment |
| 37 | +PRIVATE_KEY=your_private_key_here |
| 38 | + |
| 39 | +# Optional: Custom RPC URLs (defaults provided) |
| 40 | +CHIADO_RPC_URL=https://rpc.chiado.gnosis.gateway.fm |
| 41 | +GNOSIS_RPC_URL=https://rpc.gnosischain.com |
| 42 | + |
| 43 | +# Optional: For contract verification on Blockscout |
| 44 | +BLOCKSCOUT_API_KEY=your_blockscout_api_key |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | +### Configuration Files |
| 49 | + |
| 50 | +The project uses JSON configuration files in the `config/` directory: |
| 51 | +- `poh-test-circles.json` - Configuration for test circles deployment on Gnosis Chain |
| 52 | +- `poh-test-rings.json` - Configuration for test rings deployment on Gnosis Chain |
| 53 | +- `poh-chiado-mocks.json` - Configuration for mock contracts deployment on Chiado testnet |
| 54 | + |
| 55 | +Each config file must contain: |
| 56 | +```json |
| 57 | +{ |
| 58 | + "proofOfHumanity": "0x...", |
| 59 | + "crossChainProofOfHumanity": "0x...", |
| 60 | + "circlesHub": "0x...", |
| 61 | + "baseGroup": "0x...", |
| 62 | + "maximumBatchSize": 30 |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +### Available Commands |
| 67 | + |
| 68 | +```bash |
| 69 | +# Compile contracts and generate TypeChain types |
| 70 | +npm run compile |
| 71 | + |
| 72 | +# Run comprehensive test suite |
| 73 | +npm test |
| 74 | + |
| 75 | +# Clean build artifacts |
| 76 | +npm run clean |
| 77 | + |
| 78 | +# Deploy to Gnosis Chain (test circles config) |
| 79 | +npm run deploy:poh-test-circles |
| 80 | + |
| 81 | +# Deploy to Gnosis Chain (test rings config) |
| 82 | +npm run deploy:poh-test-rings |
| 83 | + |
| 84 | +# Deploy to Chiado testnet (mock contracts) |
| 85 | +npm run deploy:chiado |
| 86 | +``` |
| 87 | + |
| 88 | +### Development |
| 89 | + |
| 90 | +The project includes: |
| 91 | +- **Hardhat** for development and testing |
| 92 | +- **TypeScript** support with strict type checking |
| 93 | +- **TypeChain** for type-safe contract interactions |
| 94 | +- **Mock contracts** for isolated testing |
| 95 | + |
| 96 | +### Network Configuration |
| 97 | + |
| 98 | +Supported networks: |
| 99 | +- **Hardhat Local**: `hardhat` (Chain ID: 31337) |
| 100 | +- **Localhost**: `localhost` (http://127.0.0.1:8545) |
| 101 | +- **Chiado Testnet**: `chiado` (Chain ID: 10200) |
| 102 | +- **Gnosis Chain**: `gnosis` (Chain ID: 100) |
| 103 | + |
| 104 | +### Testing |
| 105 | + |
| 106 | +The test suite covers: |
| 107 | +- Contract deployment and initialization |
| 108 | +- Governance functions and access control |
| 109 | +- Registration and trust management |
| 110 | +- Batch processing and re-evaluation |
| 111 | +- Cross-chain humanity verification |
| 112 | +- Edge cases and error conditions |
| 113 | + |
| 114 | +Run tests with coverage: |
| 115 | +```bash |
| 116 | +npm test |
| 117 | +``` |
| 118 | + |
| 119 | +### Contract Verification |
| 120 | + |
| 121 | +Contracts are automatically verifiable on Blockscout for both Gnosis Chain and Chiado testnet. The configuration supports custom API endpoints for verification. |
0 commit comments