hackquest logo

PEPASUR FLOW

Pepasur is an on-chain multiplayer Mafia game on Flow EVM, offering addictive gameplay, real rewards, and seamless blockchain interaction for a truly engaging Web3 gaming experience.

Videos

Tech Stack

React
Next
Ethers
Web3
Node
Solidity

Description

Pepasur

An On-Chain Mafia Game Powered by Flow Blockchain
Built for Flow Hackathon 2025

Overview

Pepasur is a fully on-chain, multiplayer Mafia-style social deduction game deployed on the Flow EVM. Players take on mythological roles: ASUR (Mafia), DEV (Doctor), MANAV (Villager), and RISHI (Detective). They compete through staking, commit-reveal cryptography, and real-time multiplayer gameplay.

Each match requires players to stake FLOW tokens, creating real economic incentives for fair play and strategy. Winners are automatically rewarded via smart contracts, while eliminated players receive partial refunds based on game outcomes.

The game combines pixel-art visuals, Socket.io-based multiplayer, and Flow’s scalable EVM infrastructure to deliver a smooth, decentralized gaming experience.


Core Features

  • On-chain Mafia gameplay powered by Flow EVM smart contracts

  • Real economic incentives through token staking and automated rewards

  • Commit-reveal cryptography for fair and tamper-proof role assignment

  • Real-time multiplayer using Socket.io and WebSockets

  • Transparent, verifiable on-chain rewards

  • Cross-platform support across desktop and mobile

  • Retro pixel-art UI with modern Web3 integration


Technical Stack

  • Blockchain: Flow EVM Testnet

  • Smart Contracts: Solidity (PepAsur.sol)

  • Backend: Node.js, Express.js, Socket.io

  • Frontend: Next.js, React, TypeScript

  • Wallet Integration: RainbowKit, Wagmi (MetaMask, WalletConnect)

  • Game Logic: Commit-reveal cryptography, ECDSA signatures, server-signed settlements


Smart Contract Architecture

Core Contract: PepAsur.sol

  • Game creation with customizable stake amounts

  • Player joining through FLOW token staking

  • Role assignment using commit-reveal cryptography

  • Server-signed settlements for reward distribution

  • Secure withdrawal mechanism for player rewards

Reward Distribution Logic

  • Mafia Wins: Mafia players receive the remaining staked pool

  • Non-Mafia Wins:

    • Eliminated Non-Mafia: Receive 1.75x their stake

    • Survivors: Share the remaining pool

  • House Cut: 2% platform maintenance fee


Example

4-Player Game | 0.1 FLOW Stake Each

  • Total Pool: 0.4 FLOW

  • House Cut: 0.02 FLOW

  • Remaining Pool: 0.38 FLOW

Case 1: Mafia Wins

  • Mafia Players: Share 0.38 FLOW equally

  • Non-Mafia: Receive 0 FLOW

Case 2: Non-Mafia Wins

  • Dead Non-Mafia: 0.175 FLOW each (1.75x stake)

  • Survivors: Share remaining 0.03 FLOW (0.015 FLOW each)


Flow Network Configuration

Flow EVM Testnet

Chain ID: 545RPC URL: https://testnet.evm.nodes.onflow.orgBlock Explorer: https://evm-testnet.flowscan.ioSymbol: FLOW

Security Features

  • Server-signed settlements to prevent tampering

  • Player-controlled withdrawals for transparency

  • Full on-chain transaction visibility

  • Commit-reveal system ensuring fair and random role assignment


Development Status

In Progress

  • Multiplayer synchronization optimization

  • UI performance and animation enhancements

  • Integration testing for smart contracts and backend

Completed

  • Developed and deployed smart contracts using Solidity on Flow EVM Testnet

  • Implemented ECDSA-based commit-reveal system for fair and secure gameplay

  • Integrated Flow RPC and MetaMask for seamless wallet connectivity

  • Built and tested room creation and joining logic for multiplayer sessions

  • Completed reward distribution contract testing with verified on-chain settlements

Upcoming Improvements

  • Mobile UI refinement

  • Advanced analytics for player performance

  • Game performance optimization for low-latency users


Quick Start

Requirements

  • Node.js v18 or higher

  • MetaMask or any EVM-compatible wallet

  • FLOW tokens on Flow EVM Testnet

Steps

  1. Connect wallet to Flow EVM Testnet

  2. Create or join a game room (0.1 FLOW stake per player)

  3. Play through night, day, and task phases

  4. Check game results and claim rewards directly on-chain


Hackathon Submission

  • Track: Gaming and Entertainment

  • Blockchain: Flow EVM

  • Innovation: On-chain social deduction game with staking-based incentives

  • Impact: Showcases Flow’s scalability and real-time capabilities for Web3 gaming


Team

  • Mouli Chakraborty – Project Lead and Developer

  • Jishnu Baruah – CTO

Progress During Hackathon

During the hackathon, the team successfully developed and deployed Pepasur on the Flow EVM Testnet, focusing on ensuring seamless smart contract functionality, backend compatibility, and frontend integration within the Flow ecosystem. Smart Contract Development Designed and implemented the complete Pepasur.sol smart contract using Solidity. Integrated EIP-712-based ECDSA signature verification for secure player interactions. Deployed and rigorously tested the contract on the Flow EVM Testnet to ensure stable gameplay logic and reward distribution. Backend Integration Developed a modular backend architecture using Node.js, Express, and ethers.js. Implemented secure transaction signing, event handling, and state synchronization with Flow EVM nodes. Verified all contract calls, player settlements, and reward events across multiple sessions. Frontend Update Integrated wagmi and RainbowKit for EVM wallet connectivity on the Flow network. Developed custom React hooks for interacting with smart contracts and managing player sessions. Configured Flow EVM provider settings and validated complete end-to-end interaction. Testing and Deployment Conducted extensive unit and integration testing for smart contracts and backend APIs. Created automated deployment scripts for streamlined Flow EVM releases. Ensured system stability, low latency, and consistent performance across all modules.

Fundraising Status

Fundraising Status We are seeking funding to scale and launch Pepasur on the Flow network. This project falls under the “killer dApp” category, offering a highly engaging and addictive gaming experience designed to attract and retain users within the Flow ecosystem. The gameplay mechanics, blockchain integration, and reward structure are crafted to create strong user retention and community-driven growth. With proper funding, we aim to expand development, enhance user experience, and position Pepasur as one of the most engaging games on Flow.
Team Leader
MMouli Chakraborty
Project Link
Sector
GamingDeFiOther