Skip to content

Conversation

@drescher-christoph
Copy link

Pyth Examples Contribution

Type of Contribution

  • New Example Project (Adding a new example to demonstrate Pyth integration)
  • Bug Fix (Fixing an issue in existing examples)
  • Documentation Update (Improving README, comments, or guides)
  • Enhancement (Improving existing functionality or adding features)
  • Hackathon Submission (Submitting a project from a hackathon)

Project Information

Project/Example Name:

Pyth Product Used:

  • Pyth Price Feeds
  • Pyth Entropy
  • Multiple Products
  • Other: ___________

Blockchain/Platform:

  • Ethereum/EVM
  • Solana
  • Aptos
  • Sui
  • Fuel
  • Starknet
  • TON
  • Other: ___________

Description

What does this contribution do?

This project implements a crash game smart contract using Pyth Entropy for fair and verifiable random numbers. The game allows players to place bets and “cash out” at the right time before the multiplier crashes.

How does it integrate with Pyth?

The project uses the Pyth Entropy Service for cryptographically secure random numbers to determine the crash point. The smart contract integrates Pyth's IEntropyV2 interface.

What problem does it solve or demonstrate?

It demonstrates:

  • Integration of Pyth Entropy into smart contracts
  • Fair and provably random numbers for games of chance
  • Fully on-chain gameplay mechanics

Directory Structure (for new examples)

crash-dapp/
├── contracts-foundry/     # Smart Contract Implementation
│   ├── src/              # Core contract code
│   ├── test/             # Contract tests
│   └── script/           # Deployment scripts
└── moonshot-frontend/    # React/Next.js Frontend
    ├── src/              # Frontend application code
    └── public/           # Static assets

Testing & Verification

How to Test This Contribution

Prerequisites

  • Node.js version: 18+
  • Foundry
  • Git

Setup & Run Instructions

# Smart Contracts
cd contracts-foundry
forge install
forge test

# Frontend
cd moonshot-frontend
npm install
npm run dev

Prerequisites

  • Node.js version: v22.18.0
  • Other dependencies: Foundry

Setup & Run Instructions

# Add your setup and run commands here
cd moonshot-crash-game
npm install
# ... other commands

Deployment Information (if applicable)

Network: Base Sepolia

Contract Address(es): 0x4bE9d0294e475e0493d22D5699DF1f844970Fc0D

Demo URL:

Checklist

Code Quality

  • Code follows existing patterns in the repository
  • Proper error handling implemented
  • No hardcoded values (use environment variables where appropriate)

Testing

  • Tested locally and works as expected
  • All existing functionality still works (no breaking changes)

Additional Context

Related Issues

Fixes #

Screenshots/Demo (if applicable)

Notes for Reviewers


Thank you for contributing to Pyth Examples!

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