A modern React template for building decentralized applications (dApps) with Fully Homomorphic Encryption (FHE) capabilities using fhevmjs.
- fhevmjs: Fully Homomorphic Encryption for Ethereum Virtual Machine
- React: Modern UI framework for building interactive interfaces
- Vite: Next-generation frontend build tool
- Wagmi: React hooks for Ethereum
- Tailwind: Utility-first CSS framework for rapid UI development
- @reown/appkit: Comprehensive toolkit for Web3 authentication including social logins and multi-wallet support
- @radix-ui: Unstyled, accessible UI components for building high-quality design systems and web apps
- Node.js (v20 or higher)
- npm, yarn, or pnpm package manager
- MetaMask or another Ethereum wallet
-
Fork the following repository: https://github.com/zama-ai/fhevm-react-template
-
Clone your repository:
git clone https://github.com/your-username/fhevm-react-template
cd fhevm-react-template
- Install dependencies:
npm install
# or
yarn install
pnpm install
- Configure environment variables:
cp .env.example .env
Update .env
with your specific configuration:
VITE_ACL_ADDRESS
: fhevm specificVITE_KMS_ADDRESS
: fhevm specificVITE_GATEWAY_URL
: fhevm specificVITE_PROJECT_ID
: Obtain your project ID by signing up at reown.com. This enables social login and multi-wallet support.VITE_CONF_TOKEN_ADDRESS
: The address of your deployed confidential ERC20 token contract on Sepolia testnet. You'll get this after deploying the smart contract.
Start the development server:
npm run dev
# or
yarn dev
pnpm dev
Visit http://localhost:5173/ to view your application.
Create a production-ready build:
npm run build
# or
yarn build
pnpm build
For faster development without testnet tokens, you can use a mocked fhevm:
- Check out the
ConfidentialERC20
example in themockedFrontend
branch - Follow the branch-specific README for setup instructions
- Develop and test your dApp locally before deploying to Sepolia
For testing with real network conditions, deploy your dApp to Sepolia testnet:
- Ensure you have Sepolia testnet ETH
- Configure your
.env
with Sepolia network details - Deploy and test your contracts
For questions and support:
This project is licensed under the MIT License - see the LICENSE file for details.