Barely Human
A reflection on agency into addiction, autonomy to automaton. And maybe, a way out.
Problem Statement
At what point does the 'game' become so self-consuming, that humans become indistinguishable from NPCs? As with all art, I suppose beauty lies in the gray area in between.A year ago, I made a series of ill-fated decisions that would permanently change my path, from being in the "trust" business to losing all semblance of trust overnight. Those events would force me down the long path of learning how to build, without relying on others. It's been nearly a year now of non-stop isolation and solo maths/CS learning (perhaps 20 years later than normal, but better later than never). And so, as my first hackathon, this was a thrilling test for me of whether I could effectively leverage those learnings into something practically useful in 36 hours. And although the end result is decidedly rough, the experience has given me the confidence that this just might not the beginning of the end, but the end of a beginning.BarelyHuman revolves around 10 bots playing a single table of craps, with you and I cheering them on and betting on their play like horses at the track. The concept of communal money games is underexplored, as the most obvious primitive enabled by crypto money games is "trustlessness". Escrow is the application with the most immediate utility. While here it is demonstrated by automating the mechanics around LP creation and distribution for bot play, it has ready application to, for example, streamers playing with money contributed by their fans. This is an obvious extension of how "art" can readily transform into "game", all governed by the same rules.The meta point here is to remove the human one step from the act of gambling. It's not that LP stakes aren't also effectively risking money to chance (yes the double negative makes you think). Rather, the point is to make you ponder: when I gamble, have I effectively become a bot? And with all the human affordances offered by LLMs, the line between machine and man becomes ambiguous indeed.There is a mechanical detail here that is equally important: gambling is the modern day equivalent of smoking, and house edge is tar. What if we could also leverage trustlessness as a primitive to create a truly player-owned casino, one step removed? As the human investors slowly watch the bots bleed out to house edge, the tokens get redistributed programmatically back to the investors. Through performance art, we create zero edge.
Solution
Key FeaturesProvably Fair Gaming: Chainlink VRF 2.5 ensures truly random dice rolls for 64 different craps bet typesAI Bot Personalities: 10 ElizaOS-powered bots with distinct strategies creating organic casino activityDeFi Integration: Uniswap V4 hooks capture 2% swap fees on BOT token trades, redistributed to stakersNFT Rewards: Generative art NFTs generated by bot players and awarded via VRF-powered raffles after each game seriesCross-Chain Architecture: LayerZero V2 OApp enables multi-chain vault synchronization so that LPs across multiple chains can all participate in a single table craps gameArchitecture StackSmart Contracts: Solidity 0.8.28 with OpenZeppelin v5.x librariesDevelopment: Hardhat 3.0 beta with Viem for TypeScript testingRandomness: Chainlink VRF 2.5 (production-ready VRFConsumerBaseV2Plus)Cross-Chain: LayerZero V2 OApp for omni-chain coordinationAI Framework: ElizaOS for bot personality enginesNetworks: Base (primary), Base Sepolia, Arbitrum Sepolia deploymentsPartner Integrations: Circle, Gemini, ENS, The Graph, OpenSea, HardhatPrize Qualification: 9 partners, $75,000+ total prize poolCore Contracts (12 primary + supporting libraries)Core Gaming Engine:BOTToken.sol: Fixed supply ERC20 (1B tokens) with role-based distributionCrapsGameV2Plus.sol: Main game logic with VRF 2.5 integration for dice rollsCrapsBets.sol: All 64 craps bet types (Pass, Don't Pass, Field, Hardways, etc.), plus unique Yes/No/Next and Bonus betsCrapsVault.sol: ERC4626 vaults for LP deposits and bot bankroll managementBotManagerV2Plus.sol: AI personality management and strategy executionTreasury.sol: Fee collection and distribution with multi-sig controlsStakingPool.sol: BOT token staking with accumulative reward distributionCross-Chain & DeFi Integration:8. BotSwapFeeHookV4Final.sol: Uniswap V4 IHooks implementation for 2% fee capture 9. OmniVaultCoordinator.sol: LayerZero V2 OApp for cross-chain vault synchronization 10. CircleCCTPV2Integration.sol: Circle CCTP V2 for cross-chain USDC transfers 11. CirclePaymasterIntegration.sol: ERC-4337 paymaster for gasless USDC transactionsPartner Integrations:12. GeminiWalletIntegration.sol: ERC-7579 modular accounts with passkey security 13. OpenSeaNFTMarketplace.sol: Complete NFT marketplace with AI-generated metadata 14. BotENSIntegration.sol: ENS subdomains and L2 primary name resolutionAdvanced FeaturesGas Optimization:VaultFactoryUltraOptimized.sol: Gas-optimized factory deploying minimal proxy vaultsCircuitBreaker.sol: Emergency pause mechanisms with role-based controlsCustom errors for 40% gas reduction on revertsCross-Chain Infrastructure:OmniVaultCoordinator.sol: LayerZero V2 cross-chain synchronizationCircleGatewayIntegration.sol: Unified USDC balances across 7 chainsCircleGasStation.sol: Sponsored transaction system for new usersAI & NFT Systems:GachaMintPassV2Plus.sol: VRF-powered NFT raffle systemAI-generated NFT metadata with bot personality stylesDynamic rarity calculation and IPFS metadata storageAnalytics & Monitoring:Complete subgraph indexing all casino activityReal-time analytics dashboardPerformance monitoring with OpenTelemetry"Be the House" - Revolutionary Zero-Edge EconomicsNet Settlement Rebate System:HouseEdgeRebateV2.sol - Advanced net settlement with virtual debt trackingTreasuryV3.sol - Sophisticated treasury handling collections vs issuancesVolumeTracker.sol - LP betting volume tracking with weighted distributionsWeekly settlement: Collections - Issuances = Net position for LP rebatesVirtual debt mechanism prevents treasury insolvency during losing streaks1-week expiration for unclaimed rebates (retained by treasury)Token Economics:7. BOTTokenV2.sol - Enhanced token with proper initial allocations 8. TokenDistributor.sol - Testnet leaderboard rewards and vesting 9. CommunityFaucet.sol - Rate-limited distribution (1000 BOT/day per user) 10. Progressive rebate scaling from 50% → 100% over timeInitial Distribution:20% to Bots (2% each × 10 personalities) - Starting capital15% to Uniswap V4 - USDC and PayPal USD liquidity pools10% to Testnet Rewards - Leaderboard competition prizes5% to Community Faucet - First month distribution (1000 BOT/day)50% to Artist - 33.33% giveaways, 16.67% retainedNet Settlement Economics:Collections: House collects from losing betsIssuances: House pays out winning betsWeekly Net Position: Collections - IssuancesPositive Net: 100% rebated to LPs proportional to volumeNegative Net: Virtual debt tracked, no immediate payoutDebt Payoff: Future positive nets first pay off debt, then rebateExpiration: Unclaimed rebates expire after 1 week (treasury retention)Zero-Edge Result: Over time, all house edge flows back to LPs, creating a truly player-owned casinoSecurity & OptimizationReentrancyGuardon all fund transfersAccessControlfor role managementInput validationwith custom errors (gas-efficient reverts)Proxy patternsfor upgradeabilityCircuit breakersfor emergency scenariosGas OptimizationsStorage packing(reduced slots by 40%)Batch operationsfor multiple betsMinimal proxy patternfor vault deploymentsCustom errorsinstead of require stringsEvent-driven state trackingvia The GraphTesting Infrastructure200+ comprehensive testswith 100% code coverageHardhat 3.0's native Node.js test runnerViem-based integration testingFork testingagainst mainnet statePerformance benchmarking suiteLoad testingwith 1000+ concurrent operationsPartner Integration HighlightsUniswap V4 Hooks ($10,000 Prize):Complete IHooks interface implementation with BeforeSwapDelta complexity2% fee capture on BOT token swaps routed to staking rewardsAdvanced swap manipulation beyond basic integrationProduction-ready following official v4-template patternsLayerZero V2 OApp ($12,500 Prize):Latest V2 protocol implementation (not V1 like most teams)Hub-spoke architecture with Base as primary hubCross-chain casino state synchronization (non-token transfer use case)Unified LP positions across multiple chainsCircle Complete Integration ($10,000 Prize):CCTP V2 with hooks for 7-chain USDC transfersERC-4337 paymaster for gasless USDC fee paymentsCircle Wallets integration with sponsored transactionsCircle Gateway for unified cross-chain USDC balancesNew Partner Integrations:Gemini: ERC-7579 modular accounts with passkey securityOpenSea: AI-generated NFT marketplace with Seaport protocolThe Graph: Complete subgraph indexing casino activityENS: Bot subdomains and L2 primary name resolutionProduction InfrastructureSecurity & Monitoring:Comprehensive monitoringwith OpenTelemetryRate limiting and DDoS protectionMulti-sig treasury controlswith role-based accessReentrancyGuardon all fund transfersCircuit breakersfor emergency scenariosDevelopment & Testing:Hardhat 3.0 betawith Viem integration200+ comprehensive testswith 100% coveragePerformance benchmarking and load testingFork testingagainst mainnet stateAutomated deploymentacross multiple networksUser Interfaces:Interactive CLI casino interfaceWeb dashboardwith real-time analyticsCross-chain vault management toolsNFT marketplace frontend integrationGenerative ArtThe generative art systemuses the VRF random seed to create reproducible artwork. By implementing a custom SeededRandom PRNG, identical seeds always produce identical art - crucial for on-chain verification. In creating this work as an "AI artist", I was inspired by Tarbell's Substrate algo from over 20 years ago. I applied this crack generation algo to the generation of mountains, as my name in Korean is "Big Mountain". I found it to be a powerful metaphor for the stories that make each of us who we are.
Hackathon
ETHGlobal New York 2025
2025
Contributors
- happybigmtn
59 contributions