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.

视频

描述

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: 545
RPC URL: https://testnet.evm.nodes.onflow.org
Block Explorer: https://evm-testnet.flowscan.io
Symbol: 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

  • Migration from Aptos Move to Solidity

  • ECDSA-based commit-reveal system

  • Flow RPC and MetaMask integration

  • Room creation and joining logic

  • Reward distribution contract testing

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

本次黑客松进展

During the hackathon, the team successfully built 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 Implementation Built a responsive and interactive frontend using Next.js, React, and TypeScript. Integrated wagmi and RainbowKit for seamless EVM wallet connectivity. Created custom React hooks to manage contract interactions, player state, and real-time updates. Testing and Deployment Conducted extensive unit and integration testing across smart contracts and backend APIs. Developed automated deployment scripts for consistent Flow EVM releases. Ensured system stability, low-latency communication, and smooth user experience across all modules. Pepasur now runs fully on the Flow EVM Testnet, demonstrating a complete, on-chain gaming experience built for performance, transparency, and scalability.

技术栈

React
Next
Ethers
Web3
Node
Solidity

融资状态

We are seeking funding to scale and launch Pepasur natively on the Flow network. Designed as a “killer dApp” within the Flow ecosystem, Pepasur delivers a highly engaging and competitive on-chain gaming experience that leverages Flow’s scalability, low fees, and developer-friendly infrastructure. The game’s staking model, transparent smart contract logic, and real-time multiplayer experience make it an ideal showcase of Flow’s capabilities for Web3 gaming. With the right funding, we plan to enhance gameplay mechanics, optimize performance, expand our player base, and establish Pepasur as one of the most engaging and community-driven games built entirely on Flow EVM.

队长
MMouli Chakraborty
赛道
GamingDeFiOther