Work

AlluChain

TypeScript
Angular
Blockchain
Smart Contracts
Full-Stack

A decentralized gaming platform on Arbitrum One featuring provably fair games powered by Chainlink VRF, wACT token payments, Merkle tree-based reward distribution, and a points system that rewards every player.

AlluChain decentralized gaming platform interface

Overview

AlluChain is a decentralized gaming platform built on Arbitrum One that delivers provably fair crypto games without registration. Players connect their Web3 wallet, swap ACT tokens for wACT, and participate in on-chain games with fully transparent, verifiable outcomes powered by Chainlink VRF.

The flagship game, Everybody Win, is a next-generation multiplayer prize pool game with a โ€œwin togetherโ€ mechanic โ€” even non-winners automatically earn 10 points redeemable for prizes, ensuring every participant gets value.

Key Achievement: Delivered a full-stack DApp from smart contract architecture to Angular frontend, with automated event-driven reward distribution and a dual-reward system (wACT + points).

Technical Highlights

๐ŸŽฒ Smart Contract Architecture

  • Upgradeable Contracts: UUPS (Universal Upgradeable Proxy Standard) proxy pattern for future-proof deployment
  • Chainlink VRF Integration: Verifiable Random Function ensuring provably fair, on-chain verifiable outcomes
  • Merkle Tree Rewards: Gas-optimized reward distribution โ€” users claim only their own rewards
  • wACT Token: Custom ERC-20 token swapped 1:1 from ACT, used as the platformโ€™s betting currency
  • Batch Betting: Optimized contract functions supporting multiple bets in a single transaction

๐Ÿ”— Blockchain Integration

  • Network: Arbitrum One (mainnet)
  • viem Library: Type-safe Ethereum interactions with comprehensive ABI support
  • Event Monitoring: Real-time blockchain event listening via Alchemy webhooks
  • Wallet Integration: MetaMask and Web3 wallet connection with session persistence
  • Transaction Management: Robust error handling and retry logic for blockchain operations

๐Ÿ—๏ธ Backend Engineering

Supabase Edge Functions:

  • cal-rewards-gen-merkle: Automated reward calculation and Merkle tree generation on draw completion
  • complete-round: Round finalization and state management
  • Webhook Security: IP whitelisting and HMAC signature verification for Alchemy webhooks
  • PostgreSQL Database: Optimized schema for bet records, Merkle proofs, and user rewards

๐ŸŽจ Frontend Architecture

Angular (Standalone Components):

  • RxJS reactive state management
  • Shopping cart system for batch betting
  • Number picker with preset combinations
  • Responsive design for mobile and desktop

Core Services:

  • BlockchainService: Smart contract interaction
  • PaymentService: wACT payment processing
  • WalletService: Web3 wallet management with session handling
  • SupabaseService: Database operations and Edge Function calls

Core Features

  • โœ… Everybody Win โ€” multiplayer prize pool game with shared win mechanics
  • โœ… No registration โ€” connect wallet and play instantly
  • โœ… Provably fair draws via Chainlink VRF (on-chain verifiable)
  • โœ… wACT token payments (swapped 1:1 from ACT)
  • โœ… Non-winners automatically earn 10 points per round
  • โœ… Points redeemable for prizes alongside wACT
  • โœ… Web3 wallet connection (MetaMask, WalletConnect)
  • โœ… Shopping cart batch betting system
  • โœ… Merkle proof-based reward claiming
  • โœ… Gas-optimized smart contracts on Arbitrum One

Technical Stack

Frontend:

  • Framework: Angular
  • Language: TypeScript
  • Blockchain: viem, web3.js
  • UI/UX: SCSS, RxJS
  • Build: Angular CLI with SSR support

Backend:

  • Database: Supabase (PostgreSQL)
  • Edge Functions: Deno runtime
  • Webhooks: Alchemy Notify integration
  • Authentication: Wallet-based auth

Blockchain:

  • Network: Arbitrum One
  • Smart Contracts: OpenZeppelin Upgradeable
  • VRF: Chainlink Verifiable Random Function
  • Token: ERC-20 wACT (1:1 swap from ACT)

DevOps:

  • Deployment: Cloudflare Pages
  • CI/CD: Wrangler CLI

System Architecture

Data Flow:

  1. User connects Web3 wallet
  2. User swaps ACT โ†’ wACT via โ€œGet wACTโ€
  3. User selects game and places bets (batch supported)
  4. Wallet signs transaction with wACT approval
  5. Smart contract processes bet and emits events
  6. Alchemy webhook triggers Edge Function
  7. Edge Function stores bet record in Supabase
  8. VRF generates verifiable random outcome
  9. DrawCompleted event triggers reward calculation
  10. Edge Function generates Merkle tree and proofs
  11. Winners claim rewards; non-winners auto-receive 10 points

Security Layers:

  • IP whitelisting for webhook endpoints
  • HMAC signature verification for Alchemy requests
  • Smart contract reentrancy protection
  • Wallet signature validation
  • UUPS upgrade authorization control

Development Impact

  • Architected complete DApp from smart contracts to frontend UI
  • Implemented Merkle tree reward distribution significantly reducing gas costs per claim
  • Built automated webhook system processing draw events with zero downtime
  • Designed upgradeable contract architecture supporting future feature additions without redeployment
  • Created dual-reward system (wACT + points) ensuring every player receives value
  • Integrated Chainlink VRF ensuring cryptographically verifiable random draws
  • Deployed on Arbitrum One mainnet with open-source, auditable smart contracts

Key Challenges Solved

1. Gas Optimization:

  • Problem: Direct reward transfers would cost $100+ in gas per draw
  • Solution: Merkle tree distribution allowing users to claim only their rewards (~$2 gas)

2. Randomness Verification:

  • Problem: Need provably fair random number generation
  • Solution: Chainlink VRF integration with on-chain verification

3. Webhook Security:

  • Problem: Edge Functions exposed to public internet
  • Solution: Multi-layer security (IP whitelist, HMAC signature, rate limiting)

4. Contract Upgradeability:

  • Problem: Need to fix bugs and add features post-deployment
  • Solution: UUPS proxy pattern with access control