spencermcw.com
[ << ] back to work
case file 06 / 16 · 2021–2022

Royal Flush

Draw, meld, redeem & yield.

live Live at royalflush.spencermcw.com; source on GitHub; demo video on Vimeo checked 2026-10-20 [1]

see it in action 5:38 visit site (opens in a new tab)

A yield-bearing card game on the EVM: draw base cards, meld them, redeem a royal flush, level up, open packs, and trade on an in-game marketplace, all against a $CARD token.

what it does

  • Draw base cards from an on-chain deck, 5 to 100 at a time. [4]
  • Meld: trade base cards (plus an optional wildcard) and $CARD for a fresh draw. [4]
  • Redeem five base cards of one suit, wildcards allowed, for a yield card. [5]
  • Claim a yield card's yield by burning a base card of its suit. [5]
  • Level up: two yield cards of the same suit and level become one card a level higher, up to level 10. [5]
  • Open packs, and buy or sell on a marketplace where one listing can bundle base cards and yield cards. [6]
What it is
Card-game dApp: six Solidity contracts and a Vue 3 front end
Stack
contracts Solidity ^0.8 · OpenZeppelin · Hardhat [7]
client Vue 3 · Vite · Vuex · Vue Router · ethers.js 5 · Bootstrap 5 · Sass · MetaMask onboarding [9]
networks Hardhat local node · BNB Smart Chain testnet [8]
Tags
  • TypeScript
  • Solidity
  • EVM
  • Web3
  • Game

demo video

open on vimeo (opens in a new tab)
  1. Base cards are one ERC-1155 collection of 21 ids: ten through ace in four suits, plus a wildcard. [3]

  2. Yield cards are ERC-721 (Enumerable) tokens that each carry a suit and a level. [5]

  3. $CARD is an OpenZeppelin ERC-20 with AccessControl roles and a pause switch. [3]

  4. Until 25,000 cards have been drawn, draws are paid in the chain's native coin at a presale price; after that they cost $CARD. [4]

  5. Marketplace sales split 95% to the seller and 5% commission, held in escrow until the seller calls collect() (pull, not push). [6]

  6. All six contracts are pausable; five are also reentrancy-guarded. [3]

  7. The front end ships 28 sound cues and 21 card animations: five per suit, plus a wildcard reveal. [10]

  8. Hardhat deploys to a local node or to BNB Smart Chain testnet (chain id 97). [8]

Languages, as GitHub reports them

by bytes [11]
  • SCSS 53.7% 92% of the SCSS bytes are a vendored copy of Bootstrap's Sass source
  • Vue 24.6%
  • JavaScript 14.1%
  • Solidity 7.5%
  • HTML 0.1%
$ git log --reverse
  1. Build bV1.2 shown in a 5:38 sneak-peek video [13]
  2. Source published to GitHub [12]

Every marked line above points at one of these: repositories and their docs, registries, live sites and screenshots. Nothing is inferred past what they show.

  1. [1] royalflush.spencermcw.com (answers 200) royalflush.spencermcw.com 2026-10-20
  2. [2] spencermcw/RoyalFlush on GitHub github.com 2026-10-13
  3. [3] ethereum/contracts github.com 2026-10-13
  4. [4] ethereum/contracts/RoyalFlush/Deck.sol github.com 2026-10-13
  5. [5] ethereum/contracts/RoyalFlush/YieldCards.sol github.com 2026-10-13
  6. [6] ethereum/contracts/RoyalFlush/Marketplace.sol github.com 2026-10-13
  7. [7] ethereum/package.json github.com 2026-10-13
  8. [8] ethereum/hardhat.config.js github.com 2026-10-13
  9. [9] dApp/package.json github.com 2026-10-13
  10. [10] dApp/ (tabs, sounds, animations) github.com 2026-10-13
  11. [11] GitHub languages API api.github.com 2026-10-13
  12. [12] Commit history github.com 2026-10-13
  13. [13] Vimeo: "Royal Flush dApp Sneak Peek - bV1.2" vimeo.com 2026-10-13