Skip to content

TheTechJumbo/SkillStake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkillStake - 1v1 Skill Challenge dApp on Flare

SkillStake is a minimal 1v1 wagering dApp where two players stake native C2FLR on Flare Coston2 and a referee settles the match on-chain.

Built on Flare

  • Network: Flare Coston2 (Chain ID 114)
  • Integrations: Native C2FLR staking on Flare; EIP-712 signed results; Wagmi/Viem/RainbowKit (frontend); Foundry (contracts); off-chain referee uses Tracker Network API
  • Demo: TODO (add live demo or walkthrough video link)
  • Setup: See Quickstart below
  • Track: Use data protocols on Flare blockchain in an innovative and world changing way

Track Alignment

This submission targets the Flare track by deploying to Flare Coston2 and using native C2FLR for on-chain staking and settlement, with planned integration of Flare data protocols to bring verifiable off-chain match data on-chain.

Flare Protocol Usage

  • Current: Native C2FLR staking + settlement on Flare Coston2.
  • Planned (not integrated yet): FDC (match attestations), FTSO (price feeds), Secure Random (tie-breakers), FAssets/Smart Accounts (XRPL onboarding).

Overview

  • Create a challenge with an opponent, stake amount, win condition, and expiry.
  • Opponent joins or rejects.
  • Referee submits results using EIP-712 signed data and pays the winner.

Quickstart

  1. Install dependencies
npm install
  1. Install Foundry deps
cd contracts
forge install OpenZeppelin/openzeppelin-contracts forge-std
cd ..
  1. Deploy contracts (optional for local demo)
# Requires DEPLOYER_PRIVATE_KEY and REFEREE_SIGNER
npm run deploy
  1. Configure referee
cp referee/.env.example referee/.env

Fill in REFEREE_PRIVATE_KEY, TRN_API_KEY, and (optionally) CONTRACT_ADDRESS.

  1. Configure frontend
cp frontend/.env.example frontend/.env.local

Set NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID if you want WalletConnect QR.

  1. Run
npm run dev

Smart Contracts

Environment Variables

  • referee/.env.example
  • frontend/.env.example

Flare Track Reference (Key Protocols & Products)

Key Protocols:

  • The Flare Data Connector (FDC): Achieves consensus on external blockchain and internet data so it can be securely used by Flare smart contracts.

FDC TL;DR

FDC lets contracts verify that off-chain input data is authentic. Data providers reach consensus on responses, a Merkle root is published on-chain, and the contract verifies a response + Merkle proof before using the data. In practice this allows us to verify user's inputs such as their match status, providing us with accurate and up to date game data.

License

MIT

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published