🚀This project is a Solana-based lottery system developed in Rust. Participants can purchase golden tickets for 0.05 SOL, with 0.01 SOL from each ticket allocated to a community treasury.
Last updated Jun 26, 2026
10
Stars
6
Forks
0
Issues
0
Stars/day
Attention Score
5
Language breakdown
No language data available.
▸ Files
click to expand
README
HoneyPotDAO
This is one kind of Lottery system. Here's how it works:- Players pay an entry fee of 0.05 $SOL for a golden ticket.
- 0.01 $SOL is taken from this fee and deposited into the community treasury
- Players stake their golden ticket for the duration of the Pot.
- When the Pot ends, the wallet containing the winning ticket receives the contents of the pot.
- 10% of every pot is deposited into the community treasury. There are daily, weekly, and monthly pots.
- Over time, we will add pots with different ticket prices, time limits, and rules for entry
Install Dependencies
- Install
nodeandyarn - Install
ts-nodeas global command - Confirm the solana wallet preparation:
/home/fury/.config/solana/id.jsonin test case
Usage
- Main script source for all functionality is here:
/cli/script.ts - Program account types are declared here:
/cli/types.ts - Idl to make the JS binding easy is here:
/cli/honey_pot.json
- Change commands properly in the main functions of the
script.tsfile to call the other functions - Confirm the
ANCHOR_WALLETenvironment variable of thets-nodescript inpackage.json - Run
yarn ts-node
Features
As a Smart Contract Owner
For the first time use, the Smart Contract Owner shouldinitialize the Smart Contract for global account allocation.
initProject
As a user
All users can buy tickets by calling the functionsfn buytickets(ctx: Context<BuyTickets>, vaultbump: u8, amount: u64) -> ProgramResult
with amount of tickets.
After the lottery ends, they can reveal the winner by calling function
pub fn reveal_winner(ctx: Context<RevealWinner>) -> ProgramResult.
Then, the winner can claim reward from the reward pool by calling funciton
pub fn claim(ctx: Context<Claim>, vault_bump: u8) -> ProgramResult.
Above 3 functions are implemented for 3 pots- daily, weekly, and monthly pots.
🔗 More in this category