{"id":31767705,"url":"https://github.com/chimmykk/fhevm-dice-dapp-cdn","last_synced_at":"2026-05-15T13:05:11.546Z","repository":{"id":317762361,"uuid":"1063297138","full_name":"chimmykk/fhevm-dice-dapp-cdn","owner":"chimmykk","description":"fhevm-dice-dapp","archived":false,"fork":false,"pushed_at":"2025-10-05T23:03:40.000Z","size":1388,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T01:19:59.678Z","etag":null,"topics":["fhevm","solidity-language"],"latest_commit_sha":null,"homepage":"https://hello-fhevm-game.vercel.app/","language":"JavaScript","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/chimmykk.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T12:39:05.000Z","updated_at":"2025-10-05T23:03:43.000Z","dependencies_parsed_at":"2025-10-02T22:29:21.946Z","dependency_job_id":"75311949-29d4-443a-a7e4-b21f356c8af0","html_url":"https://github.com/chimmykk/fhevm-dice-dapp-cdn","commit_stats":null,"previous_names":["chimmykk/fhevm-dice-dapp-cdn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chimmykk/fhevm-dice-dapp-cdn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimmykk%2Ffhevm-dice-dapp-cdn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimmykk%2Ffhevm-dice-dapp-cdn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimmykk%2Ffhevm-dice-dapp-cdn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimmykk%2Ffhevm-dice-dapp-cdn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chimmykk","download_url":"https://codeload.github.com/chimmykk/fhevm-dice-dapp-cdn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chimmykk%2Ffhevm-dice-dapp-cdn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fhevm","solidity-language"],"created_at":"2025-10-10T01:19:16.162Z","updated_at":"2026-05-15T13:05:11.541Z","avatar_url":"https://github.com/chimmykk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zama React Template using UMD CDN\n\nA template for building privacy-preserving applications using Zama's FHEVM technology. This implementation demonstrates confidential computing through a fully homomorphic encrypted dice game, showcasing best practices for integrating FHEVM with React applications via UMD CDN distribution.\n\n## Architecture Overview\n\nThis template implements a complete stack for confidential smart contract applications:\n\n- **Smart Contract Layer**: Solidity contracts leveraging FHEVM for encrypted computation\n- **Frontend Layer**: React application with UMD CDN integration for FHEVM SDK\n- **Development Environment**: Hardhat-based toolchain with TypeScript support\n- **Deployment Pipeline**: Automated deployment scripts for multiple networks\n\n## Core Features\n\n- **Confidential Computing**: All game logic operates on encrypted data using FHEVM\n- **Privacy-Preserving Architecture**: Game state remains encrypted throughout execution\n- **Cryptographic Verification**: Input validation through zero-knowledge proofs\n- **Modern Frontend**: React 19 with hooks-based architecture\n- **CDN Distribution**: UMD-based FHEVM SDK integration for simplified deployment\n- **Type Safety**: Full TypeScript implementation across the stack\n- **Production Ready**: Comprehensive testing and deployment tooling\n\n## Project Structure\n\n```\nfhevm-dice-dapp-cdn/\n├── contracts/                 # Solidity smart contracts\n│   └── FHEDiceGame.sol       # FHE-enabled dice game contract\n├── frontend/                  # React application\n│   ├── src/\n│   │   ├── components/        # Reusable UI components\n│   │   ├── hooks/            # Custom React hooks for FHEVM integration\n│   │   └── App.js            # Application entry point\n│   ├── public/\n│   │   └── index.html        # HTML with UMD CDN integration\n│   └── package.json          # Frontend dependencies\n├── deploy/                   # Hardhat deployment scripts\n├── test/                     # Comprehensive test suite\n├── hardhat.config.ts         # Hardhat configuration\n└── package.json              # Root project dependencies\n```\n\n## Prerequisites\n\n- Node.js \u003e= 20.0.0\n- npm \u003e= 7.0.0\n- Git \u003e= 2.30.0\n\n## Installation\n\n1. **Repository Setup**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd fhevm-dice-dapp-cdn\n   ```\n\n2. **Dependency Installation**\n   ```bash\n   # Install root dependencies\n   npm install\n   \n   # Install frontend dependencies\n   cd frontend \u0026\u0026 npm install \u0026\u0026 cd ..\n   ```\n\n3. **Environment Configuration**\n   ```bash\n   # Configure Hardhat environment variables\n   npx hardhat vars setup\n   ```\n\n4. **Contract Compilation**\n   ```bash\n   npm run compile\n   ```\n\n5. **Development Server**\n   ```bash\n   cd frontend \u0026\u0026 npm start\n   ```\n\n## Development Workflow\n\n### Smart Contract Development\n\nThe project utilizes Hardhat for comprehensive smart contract development:\n\n```bash\n# Compile contracts with TypeScript support\nnpm run compile\n\n# Execute test suite\nnpm test\n\n# Local development network\nnpx hardhat node\nnpx hardhat deploy --network localhost\n\n# Testnet deployment\nnpx hardhat deploy --network sepolia\n```\n\n### Frontend Development\n\nReact application development workflow:\n\n```bash\ncd frontend\n\n# Development server with hot reload\nnpm start\n\n# Production build\nnpm run build\n\n# Test execution\nnpm test\n```\n\n## UMD CDN Integration Strategy\n\nThe template implements FHEVM SDK integration through UMD CDN distribution:\n\n```html\n\u003c!-- CDN Integration in public/index.html --\u003e\n\u003cscript src=\"https://cdn.zama.ai/relayer-sdk-js/0.2.0/relayer-sdk-js.umd.cjs\" \n        type=\"text/javascript\" \n        crossorigin=\"anonymous\"\u003e\n\u003c/script\u003e\n```\n\n**Technical Benefits:**\n- **Zero Build Dependencies**: Eliminates FHEVM SDK from build pipeline\n- **Version Pinning**: Ensures consistent SDK version across deployments\n- **CDN Optimization**: Leverages global CDN for improved performance\n- **CORS Compliance**: Proper cross-origin resource sharing configuration\n\n## Application Architecture\n\n### Confidential Game Flow\n\n1. **Wallet Integration**: MetaMask or compatible wallet connection\n2. **Encrypted Input Generation**: Client-side encryption of game inputs\n3. **FHEVM Processing**: On-chain homomorphic computation\n4. **Encrypted State Management**: Persistent encrypted game state\n5. **Result Verification**: Cryptographic proof validation\n6. **Selective Decryption**: Player-controlled result revelation\n\n### Smart Contract Implementation\n\nThe `FHEDiceGame` contract implements:\n\n- **Encrypted State Storage**: All game data encrypted using FHEVM\n- **Homomorphic Operations**: Dice roll generation and comparison on encrypted data\n- **Access Control**: Secure decryption permission management\n- **Gas Optimization**: Efficient FHE operations with minimal gas consumption\n\n## Security Implementation\n\n- **FHEVM Integration**: Fully homomorphic encryption for computation privacy\n- **Encrypted State Management**: On-chain data remains encrypted at rest\n- **Proof Verification**: Cryptographic validation of input authenticity\n- **Permission-Based Decryption**: Controlled access to encrypted results\n\n## Dependencies\n\n### Smart Contract Stack\n- `@fhevm/solidity`: FHEVM Solidity library for encrypted operations\n- `@zama-fhe/oracle-solidity`: Zama FHE oracle contract integration\n- `hardhat`: Ethereum development framework with plugin ecosystem\n\n### Frontend Stack\n- `react`: Component-based UI framework\n- `ethers`: Ethereum JavaScript library\n- `@zama-fhe/relayer-sdk`: FHEVM Relayer SDK (UMD CDN distribution)\n\n## Deployment Configuration\n\n### Smart Contract Deployment\n\n1. **Network Configuration**\n   Update `hardhat.config.ts` with target network parameters\n\n2. **Environment Variables**\n   ```bash\n   export MNEMONIC=\"your-deployment-mnemonic\"\n   export INFURA_API_KEY=\"your-infura-api-key\"\n   ```\n\n3. **Contract Deployment**\n   ```bash\n   npx hardhat deploy --network sepolia\n   ```\n\n### Frontend Deployment\n\n1. **Contract Address Configuration**\n   Update contract address in `frontend/src/App.js`:\n   ```javascript\n   const contractAddress = \"0xDeployedContractAddress\";\n   ```\n\n2. **Production Build**\n   ```bash\n   cd frontend\n   npm run build\n   # Deploy build/ directory to hosting service\n   ```\n\n## Testing Strategy\n\n### Smart Contract Testing\n```bash\n# Execute full test suite\nnpm test\n\n# Targeted test execution\nnpx hardhat test test/FHEDiceGame.ts\n\n# Gas reporting\nREPORT_GAS=true npm test\n```\n\n### Frontend Testing\n```bash\ncd frontend\nnpm test\n```\n\n## Documentation References\n\n- [FHEVM Documentation](https://docs.zama.ai/fhevm)\n- [Zama FHEVM Repository](https://github.com/zama-ai/fhevm)\n- [React Documentation](https://reactjs.org/docs)\n- [Ethers.js Documentation](https://docs.ethers.org)\n\n## Contributing Guidelines\n\n1. Fork the repository\n2. Create feature branch: `git checkout -b feature/implementation-name`\n3. Implement changes with comprehensive tests\n4. Commit with descriptive messages: `git commit -m 'feat: implement feature'`\n5. Push to branch: `git push origin feature/implementation-name`\n6. Submit pull request with detailed description\n\n## Acknowledgments\n\n- [Zama](https://zama.ai) for FHEVM technology and development support\n- [FHEVM Community](https://github.com/zama-ai/fhevm) for ongoing contributions\n- [Hardhat](https://hardhat.org) for comprehensive development framework\n- [React](https://reactjs.org) for modern frontend development platform\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimmykk%2Ffhevm-dice-dapp-cdn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchimmykk%2Ffhevm-dice-dapp-cdn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimmykk%2Ffhevm-dice-dapp-cdn/lists"}