Play for NFTs

Aperta
#196 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
blockchain, typescript

Direzione di ricerca

The repository is described as front-end TypeScript code for tables and lobbies, but no files, tests, or entry points are named. Trace table creation for tournament and SNG flows, then examine how the vault contract and Cosmos wallet plus MetaMask signing would fit. Done means an owner can deposit an NFT as the prize and the winner can redeem it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement epic feature idea fairy sit-and-go

Epic: Play for NFTs — ETH escrow keyed by gameId, validator-signed release

Design doc: ui/docs/designs/play-for-nft.md (committed on the Play-for-NFT design branch).

A Sit & Go creator escrows an ERC-721 NFT on Ethereum as the prize. The poker-chain runs the SNG as normal. When it resolves, the winner pulls the NFT out of escrow by presenting a validator-signed unlock — the same single-validator ECDSA scheme the USDC withdrawal bridge already uses. If the SNG is cancelled before a winner exists, the chain issues a validator-signed refund to the depositor.

Locked decisions
  • Scope: SNG only, winner-takes-all (one prize NFT → 1st place; no place tiers).
  • Prize source: creator escrows the NFT at table creation.
  • Escrow deposit: one transaction via onERC721Received (NFT's own safeTransferFrom(creator, escrow, tokenId, abi.encode(gameId)) — no approve, no separate entrypoint).
  • Unlock auth: reuse the bridge's single-validator signing — EIP-191 keccak256, verified against Vault.isValidator.
  • Release: winner pulls and pays ETH gas; no relayer / gasless path.
  • Refund: chain-signed REFUND to the depositor on cancellation.
  • Winner ETH address: provided at claim; the chain signs only for the recorded winner's cosmos identity.
Why it's mostly reuse

SngWinNFT.claim(...) is already a validator-signed, double-claim-guarded ERC-721 grant verified by IValidator(vault).isValidator(). The escrow is the same pattern with the asset held and released instead of minted. Signing reuses WithdrawalSigningHash / BuildWithdrawalSignature; the whitelist reuses Vault.isValidator. The genuinely new pieces are one contract and a few x/poker messages.

Signed unlock message

EIP-191( keccak256( abi.encodePacked(gameId, recipient, kind, nonce) ) ), kind ∈ {1 WIN, 2 REFUND}. Structurally identical to the withdrawal hash (receiver, amount, nonce).

Work breakdown (child issues)
  • #755 — NFTPrizeEscrow.sol contract + tests
  • #756 — x/poker chain messages + signing helper
  • #757 — Gateway indexer: observe PrizeDeposited / PrizeReleased
  • #758 — UI: escrow-at-creation flow + winner claim flow
End-to-end flow
CREATE   creator → MsgCreateGame → gameId
         creator → ERC721.safeTransferFrom(creator, escrow, tokenId, abi.encode(gameId))  [1 tx]
         gateway observes PrizeDeposited → MsgConfirmNFTPrizeDeposit(gameId)  (SNG start gated on confirmed)
PLAY     normal SNG; engine records winner in GameState.Results
WIN      winner → MsgRequestNFTUnlock(gameId, recipientEth)  (chain verifies caller == winner)
         validators sign → winner → NFTPrizeEscrow.release(gameId, recipientEth, WIN, nonce, sig)  [winner pays gas]
CANCEL   chain marks cancelled → depositor → MsgRequestNFTUnlock(gameId, depositorEth)
         validators sign → depositor → release(gameId, depositorEth, REFUND, nonce, sig)

See the design doc for the full contract sketch, chain state/messages, edge cases, and reuse map.

Lingua principale
TypeScript
Stelle
2
Fork
5
Merge medio
22h 35m
PR unite (30g)
91

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di block52/ui

Tutte le issue di block52/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.