Flowppies is an innovative Web3 gaming platform that combines AI-generated NFT pets with interactive gameplay on the Flow blockchain. Users can create, train, and battle unique digital companions in a gasless environment powered by Flow's native VRF (Verifiable Random Function) and sponsored transaction system.
Live Site Demo Video Evolve Pet Endpoint
- AI Image Creation: Powered by Google's Gemini 2.0 Flash with advanced image generation capabilities
- Custom Art Styles: Choose from multiple styles including Pixel Art, Watercolor, 3D Render, Anime, and more
- Dynamic Backstories: AI-generated lore that evolves with your pet's journey
- Unique Attributes: Each pet has distinctive traits including Happiness, Power, Level, and Multiplier stats
Token Tails uses Flow's Verifiable Random Function (VRF) - a feature exclusive to Flow blockchain.
How It Works:
- Battle Outcomes: 70% pet stats + 30% cryptographic randomness
- Zero Cost: Free randomness (costs $10+ on other chains)
- Instant Results: No waiting for oracles
- Provably Fair: Mathematical proof of fairness
Implementation:
// Get random number from Flow's native VRF
(bool ok, bytes memory data) = cadenceArch.staticcall(
abi.encodeWithSignature("revertibleRandom()")
);
uint64 randomNumber = abi.decode(data, (uint64));
// Calculate fair battle outcome
uint256 pet1Power = pet1Stats + (randomNumber % 1000);
uint256 pet2Power = pet2Stats + ((randomNumber / 1000) % 1000);
- Sponsored Transactions: All gas fees covered by Flow Wallet
- Seamless Onboarding: No need to acquire native tokens for new users
- Ultra-Low Costs: When fees apply, they're minimal on Flow EVM
-
Pet Training: Feed and train pets to increase their stats
-
Battle System: Engage in PvP battles with stake-based rewards
-
Evolution Mechanics: Level up pets to unlock new abilities and appearances
-
Leaderboard: Compete for top rankings based on pet performance
- Framework: Next.js 14 with React 18
- Styling: Tailwind CSS for responsive design
- Web3 Integration: RainbowKit with wagmi for wallet connectivity
- UI Components: Custom components with Framer Motion animations
- Network: Flow Testnet & Mainnet
- Smart Contracts: Solidity-based ERC721 implementation with custom battle mechanics
- VRF Integration: Flow's native randomness beacon for fair randomness
- Gas Sponsorship: Flow Wallet's automatic fee coverage
- Decentralized Storage: Irys Network for NFT metadata and images
- AI Generation: Google Gemini 2.0 Flash for image and backstory creation
- Metadata Standards: ERC721-compliant with evolving attributes
| Category | Component | Details |
|---|---|---|
| Frontend Stack | Framework | Next.js 14 with React 18 |
| Frontend Stack | Styling | Tailwind CSS for responsive design |
| Frontend Stack | Web3 Integration | RainbowKit with wagmi for wallet connectivity |
| Frontend Stack | UI Components | Custom components with Framer Motion animations |
| Blockchain Infrastructure | Network | Flow Testnet & Mainnet |
| Blockchain Infrastructure | Smart Contracts | Solidity-based ERC721 implementation with custom battle mechanics |
| Blockchain Infrastructure | VRF Integration | Flow's native randomness beacon for fair battle outcomes |
| Blockchain Infrastructure | Gas Sponsorship | Flow Wallet's automatic fee coverage |
| Storage & AI | Decentralized Storage | Irys Network for NFT metadata and images |
| Storage & AI | AI Generation | Google Gemini 2.0 Flash for image and backstory creation |
| Storage & AI | Metadata Standards | ERC721-compliant with evolving attributes |
- Install Flow Wallet extension
- Connect to the application
- All transaction fees are automatically sponsored!
-
Navigate to the Generate page
-
Describe your desired pet
-
Choose an art style
-
Let AI generate your unique companion
-
Feed your pet to increase Happiness (+5) and Power (+1)
-
Train your pet for enhanced Power (+5) and Happiness (+1)
-
Watch your pet's multiplier grow with each interaction
- Create battles between any two pets
- Stake Flow tokens on your favorite
- Outcomes determined by 70% stats + 30% Flow VRF randomness
- Winners receive rewards distributed automatically
- Level up pets when they reach sufficient points
- Unlock new backstory chapters
- Enhance visual appearance and abilities
flowppies/
โโโ app/ # Next.js app directory
โ โโโ api/ # API routes
โ โ โโโ generate-backstory/ # AI backstory generation
โ โ โโโ image/ # Gemini image generation
โ โ โโโ irys/ # Decentralized storage
โ โโโ components/ # React components
โ โโโ battle/ # Battle interface
โ โโโ generate/ # Pet creation
โ โโโ showcase/ # NFT gallery
โ โโโ leaderboard/ # Rankings
โโโ contract/ # Smart contracts
โ โโโ DynamicNFT.sol # Main NFT contract
โโโ utils/ # Utilities and configs
โโโ lib/ # Shared libraries
- ERC721 Standard: Full NFT compliance with metadata storage
- Dynamic Attributes: Stats that change based on interactions
- Mutable Metadata: Evolving backstories and characteristics
- Ownership Tracking: Secure pet ownership and transfer
- Battle Creation: Any user can create battles between pets
- Stake Management: Users can stake Flow tokens on battle outcomes
- VRF Resolution: Cryptographically fair battle resolution
- Reward Distribution: Automatic payout to winners (60% to stakers, 30% to creator, 10% to platform)
- Efficient Minting: Optimized contract deployment and execution
- Batch Operations: Support for multiple actions in single transactions
- Event Logging: Comprehensive event emission for frontend tracking
- Application: Deployed on Vercel
- Smart Contract: Flow Testnet Explorer
- Zero Gas Fees: All transactions sponsored by Flow Wallet
- Instant Randomness: No oracle delays for battle resolution
- Scalable: Flow's architecture supports high-throughput gaming
- Decentralized Storage: All metadata stored on Irys/IPFS
- Verifiable Randomness: Cryptographically secure battle outcomes
- Immutable Ownership: Blockchain-secured pet ownership
- Decentralized Metadata: No single point of failure for pet data
- Audited Libraries: Built on OpenZeppelin's secure contracts
- Native VRF: Built-in randomness without external oracles
- Gas Sponsorship: Eliminate user friction with sponsored transactions
- High Performance: Designed for mainstream adoption and gaming
- EVM Compatibility: Deploy Solidity contracts seamlessly
- No Gas Worries: Play without managing native tokens
- Instant Transactions: Fast block times and finality
- Fair Gameplay: Provably random battle outcomes
- True Ownership: Decentralized NFT storage and metadata
- Web3 Gamers: Users seeking engaging blockchain-based gaming experiences
- NFT Collectors: Collectors interested in unique, evolving digital assets
- AI Enthusiasts: Users fascinated by AI-generated content and narratives
Before setting up Flowppies, ensure you have the following installed on your system:
- Node.js (v18.0.0 or higher)
- npm or yarn package manager
- Git
- Flow Wallet browser extension
git clone https://github.com/anushkasomani/flowppies.git
cd flowppiesChoose your preferred package manager:
npm installyarn installCreate a .env file in the root directory and add the following environment variables:
# Required: Google Gemini AI API Key
GEMINI_API_KEY=your_gemini_api_key_here
# Required: Private key for contract deployment and Irys uploads
PRIVATE_KEY=your_private_key_for_contract_deployment
# Optional: Project name (defaults to "Flowppies")
NEXT_PUBLIC_PROJECT_NAME=project_name
Start the development server:
npm run dev
# or
yarn dev
