Skip to content

Conversation

@PranavPipariya
Copy link

@PranavPipariya PranavPipariya commented Oct 26, 2025

Pyth Examples Contribution

Type of Contribution

  • New Example Project (Adding a new example to demonstrate Pyth integration)
  • Hackathon Submission (Submitting a project from a hackathon)

Project Information

Project/Example Name: Entropy Arcade

Pyth Product Used:

  • Pyth Entropy

Blockchain/Platform:

  • Ethereum/EVM (Base Sepolia testnet)

Description

What does this contribution do?

Adds Entropy Arcade, an on-chain arcade that demonstrates Pyth Entropy integration for provably fair randomness in blockchain games. Try our signature game Plinko, which is the most optimized and responsive example since it runs on the PlinkoEntropy.sol contract.
Other games currently share the same randomness logic and can sometimes take a little longer to respond. A dedicated contract — EntropyArcadeV1.sol (see EntropyArcadeV1.json) — is already implemented and will soon handle game-specific entropy for improved performance.

How does it integrate with Pyth?

Each game contract uses requestWithCallback() from the official Pyth Entropy contract. Once the randomness is received, the callback finalizes the outcome and emits events that update the frontend in real time.

What problem does it solve or demonstrate?

Shows how developers can build transparent, verifiable, and tamper-proof on-chain games using Pyth Entropy.
It’s a simple end-to-end reference — from requesting randomness to displaying results on-chain and in the frontend.

Directory Structure (for new examples)

entropy-arcade/
├── contracts/ # Solidity contracts (PlinkoEntropy.sol, EntropyArcadeV1.sol)
├── scripts/ # Hardhat deploy and fund scripts
├── src/ # Next.js + Tailwind frontend (Wagmi + Viem)
├── public/ # Static assets
├── README.md # Project documentation
└── .gitignore


Testing & Verification

How to Test This Contribution

Prerequisites

  • Node.js version: 18 or higher
  • pnpm version: 9 or higher
  • Base Sepolia test ETH

Setup & Run Instructions

bash
git clone https://github.com/PranavPipariya/pyth-examples.git
cd entropy-arcade
pnpm install
-- if you wanna deploy the contract yourself aswell:
pnpm hardhat compile
pnpm hardhat run scripts/deploy.ts --network baseSepolia
(this will display you an address and replace the address with the current address by doing a simple search across the project)
pnpm dev

Open http://localhost:3000

Deployment Information

Network: Base Sepolia
Contract Address(es): 0xA14eC31d36C5ba64307e3eDd5a7B7497a02BB8fB


Checklist

Code Quality

  • Code follows existing patterns in the repository
  • Proper error handling implemented
  • No hardcoded secrets; .env variables used and ignored

Testing

  • Tested locally and works as expected
  • Verified entropy callbacks on Base Sepolia
  • No breaking changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant