mirror of
https://github.com/luxfhe/example-dapps.git
synced 2026-10-30 18:13:32 +00:00
A rebrand renamed third-party names it did not own. @luxfhe-fhe/relayer-sdk and @luxfhe-fhe/oracle-solidity were never published, and @fhevm/solidity ships config/ZamaConfig.sol, not LuxConfig.sol, so nothing installed and no contract compiled. The overrides now say what the lockfile already resolved (@zama-fhe/relayer-sdk ^0.3.0-8, @zama-fhe/oracle-solidity ^0.2.0), and the relayer bundle loads from cdn.zama.org, the host that serves it. Co-authored-by: Hanzo Dev <[email protected]>
FHEVM Hardhat Template
A Hardhat-based template for developing Fully Homomorphic Encryption (FHE) enabled Solidity smart contracts using the FHEVM protocol by LuxFHE.
Quick Start
For detailed instructions see: FHEVM Hardhat Quick Start Tutorial
Prerequisites
- Node.js: Version 20 or higher
- npm or yarn/pnpm: Package manager
Installation
-
Install dependencies
npm install -
Set up environment variables
npx hardhat vars set MNEMONIC # Set your Infura API key for network access npx hardhat vars set INFURA_API_KEY # Optional: Set Etherscan API key for contract verification npx hardhat vars set ETHERSCAN_API_KEY -
Compile and test
npm run compile npm run test -
Deploy to local network
# Start a local FHEVM-ready node npx hardhat node # Deploy to local network npx hardhat deploy --network localhost -
Deploy to Sepolia Testnet
# Deploy to Sepolia npx hardhat deploy --network sepolia # Verify contract on Etherscan npx hardhat verify --network sepolia <CONTRACT_ADDRESS> -
Test on Sepolia Testnet
# Once deployed, you can run a simple test on Sepolia. npx hardhat test --network sepolia
📁 Project Structure
fhevm-hardhat-template/
├── contracts/ # Smart contract source files
│ └── FHECounter.sol # Example FHE counter contract
├── deploy/ # Deployment scripts
├── tasks/ # Hardhat custom tasks
├── test/ # Test files
├── hardhat.config.ts # Hardhat configuration
└── package.json # Dependencies and scripts
📜 Available Scripts
| Script | Description |
|---|---|
npm run compile |
Compile all contracts |
npm run test |
Run all tests |
npm run coverage |
Generate coverage report |
npm run lint |
Run linting checks |
npm run clean |
Clean build artifacts |
📚 Documentation
📄 License
This project is licensed under the BSD-3-Clause-Clear License. See the LICENSE file for details.
🆘 Support
- GitHub Issues: Report bugs or request features
- Documentation: FHEVM Docs
- Community: LuxFHE Discord
Built with ❤️ by the LuxFHE team