The first No-Loss, fully decentralized lottery application on Ethena Network powered by Conduit VRF for verifiable randomness.
- Transparent and fair lottery system using Conduit VRF
- User-friendly interface with real-time updates
- Secure wallet integration with Wagmi
- USDe token-based entry system
- Solidity ^0.8.19
- Foundry (for development and testing)
- OpenZeppelin Contracts
- Conduit VRF for randomness
- React + TypeScript
- Vite
- Wagmi (for Web3 interactions)
- Framer Motion (for animations)
- TailwindCSS
- React Router
- Node.js >= 16
- Foundry
- Git
- Clone the repository
bash
git clone https://github.com/SkyYap/EnaLottery
cd EnaLottery
- Install contract dependencies
bash
cd contract
forge install
- Install frontend dependencies
bash
cd frontend
npm install
Deploy the lottery contract using Forge:
bash
cd contract
forge create src/Lottery.sol:Lottery \
--rpc-url <your_rpc_url> \
--private-key <your_private_key> \
--constructor-args \
<vrf_coordinator_address> \
<usde_token_address> \
$(date +%s) \
1800 \ (round duration in seconds)
- Create a
.env
file in the frontend directory and add your configuration - Run the development server:
bash
cd frontend
npm run dev
- Connect your wallet using the "Connect Wallet" button
- Ensure you have USDe tokens in your wallet
- Approve the lottery contract to spend your USDe tokens
- Enter the lottery by:
- Choosing a number between 0000-9999
- Specifying the amount of USDe to enter with
- Wait for the round to complete
- Winners are automatically selected using Conduit VRF
Lottery.sol
: Main lottery contract handling entries and prize distributionConduitVRFConsumerBase.sol
: Base contract for VRF functionality
IConduitVRFCoordinator.sol
: Interface for VRF coordinationIConduitVRFConsumer.sol
: Interface for VRF consumption
- Randomness provided by Conduit VRF
- Smart contracts built with OpenZeppelin's secure implementations
- Entry validation and overflow protection
- Round-based timing system
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details
- Ethena Labs for USDe integration
- Conduit for providing VRF services
- OpenZeppelin for secure contract implementations
- Wagmi for Web3 React hooks
For support, please open an issue in the GitHub repository or reach out to the team on Discord.