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

Royal Flush

Draw, meld, redeem & yield.

source Source on GitHub; demo video on Vimeo checked 2026-10-13 [1]

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. [3]
  • Meld: trade base cards (plus an optional wildcard) and $CARD for a fresh draw. [3]
  • Redeem five base cards of one suit, wildcards allowed, for a yield card. [4]
  • Claim a yield card's yield by burning a base card of its suit. [4]
  • Level up: two yield cards of the same suit and level become one card a level higher, up to level 10. [4]
  • Open packs, and buy or sell on a marketplace where one listing can bundle base cards and yield cards. [5]
What it is
Card-game dApp: six Solidity contracts and a Vue 3 front end
Stack
contracts Solidity ^0.8 · OpenZeppelin · Hardhat [6]
client Vue 3 · Vite · Vuex · Vue Router · ethers.js 5 · Bootstrap 5 · Sass · MetaMask onboarding [8]
networks Hardhat local node · BNB Smart Chain testnet [7]
Tags
  • TypeScript
  • Solidity
  • EVM
  • Web3
  • Game
  1. Base cards are one ERC-1155 collection of 21 ids: ten through ace in four suits, plus a wildcard. [2]

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

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

  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. [3]

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

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

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

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

Languages, as GitHub reports them

by bytes [10]
  • 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 [12]
  2. Source published to GitHub [11]

Every marked line above points at one of these. Public repositories, registries and screenshots only; nothing is inferred past what they show.

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