On-chain raffle platform on Starknet, built with the Starkzap SDK.
Live Demo: https://raffle-app-one.vercel.app
RafflePunk lets anyone create and participate in fully on-chain raffles on Starknet Sepolia. All raffle data — creation, ticket purchases, winner selection, and prize payouts — lives on a deployed Cairo smart contract. Wallet interactions are powered by the Starkzap SDK with Cartridge Controller for social login (Google, email, etc.).
- Create raffles — set a title, ticket price (in STRK), max tickets, and end time
- Buy tickets — STRK is transferred on-chain via ERC20 approve + contract call
- Draw winners — raffle creator draws a winner after the end time (on-chain randomness)
- Claim prizes — winner claims the entire STRK prize pool
- Share raffles — copy a deep link to share with others
- Social login — connect via Cartridge Controller (Google, email, etc.)
| Layer | Tech |
|---|---|
| Frontend | Plain HTML + TypeScript + Vite |
| Wallet SDK | Starkzap |
| Wallet | Cartridge Controller |
| Smart Contract | Cairo (Starknet) |
| Token | STRK on Sepolia testnet |
| Contract Framework | Starknet Foundry |
- Network: Starknet Sepolia
- Contract Address:
0x00a598e4d0a74221b821fbf5501f8a07462b63c5de3fcd5cb30eefc90d04822c - Class Hash:
0x2066512f5df84c4c460d5536b9e36ff96474fec044b9efeca1f840156a0d6e7
- Node.js 18+
- The Starkzap SDK cloned as a sibling directory (
../starkzap)
npm install
npm run devOpen https://localhost:5173 in your browser (HTTPS is required for Cartridge Controller).
Chrome will show a certificate warning for the self-signed cert — type
thisisunsafeon the warning page to proceed.
Visit the Starknet Faucet to get test STRK tokens on Sepolia.
├── index.html # Single-page UI (embedded CSS)
├── main.ts # App logic: wallet, views, transactions
├── raffle.ts # Contract ABI, read/write helpers, types
├── vite.config.ts # Vite config with HTTPS + SDK aliases
├── tsconfig.json # TypeScript config
├── package.json # Dependencies
└── contract/
├── src/lib.cairo # Cairo smart contract
├── Scarb.toml # Scarb package config
└── snfoundry.toml # Starknet Foundry deployment config
- Connect — User logs in via Cartridge Controller (social login through Starkzap SDK)
- Browse — Raffles are fetched from the on-chain contract via RPC
- Create —
wallet.execute()callscreate_raffleon the contract - Buy ticket —
wallet.execute()batches an ERC20approve+buy_ticketin a single transaction - Draw winner — Creator calls
draw_winnerafter end time (uses block timestamp + number for randomness) - Claim prize — Winner calls
claim_prizeto receive the full STRK pool
MIT