Skip to content

A fully on-chain trading card game. There will be elves, wizards & shit. Drama and broken friendships also.

License

Notifications You must be signed in to change notification settings

kevincharm/0xFable

 
 

Repository files navigation

0xFable

See also the README files of the various subpackages:

Installation

  1. Install pre-requisite tooling:
    • Make
    • Foundry
      • Last foundryup: 16 May 2023
    • Node.js & PNPM (npm install -g pnpm)
      • Tested with Node v20.1.0
      • The appropriate pnpm version is listed under the "packageManager key in package.json
      • If you have any issues while installing dependencies with pnpm you can try to use corepack to make sure you use correct version of pnpm.
        • corepack enable
        • corepack pnpm install
    • Circom
      • Needed to build circuits package
      • Tested with version 2.1.4
  2. Run make setup
  3. Run contract tests for basic sanity testing:
    • (cd packages/contracts && make test)

IDEs

If you're using Visual Studio Code, the contract remappings will only be picked up if you set the root of the project to the contracts package. Otherwise, you'll add to manually add the remappings (from remappings.txt) to the Solidity plugin configuration.

Running

To deploy and try out the app locally:

make dev

This will do the following from a single terminal (using run-pty):

  • Run anvil (local EVM node) at localhost:8545 with chain ID 1337 (this chain comes preconfigured in Metamask and other wallets as "Localhost")
  • Run the NextJS dev command (web server live reload)
  • Deploy the contracts to the local node
  • Build the zk circuits (this make take a while, especially the first time when you'll need to download the 300MB trusted setup file). Make sure you have circom installed.

After that, you can visit the app at http://localhost:3000/ (if that port is already occupied, NextJS might affect another one).

If your shell doesn't support run-pty, you can run the commands manually in different terminals:

make anvil
make webdev
make deploy
make circuits

Note: at least for me, Metamask has a bug that doesn't let the app initiate chain switching when the target is "Localhost" (other targets work fine). If the same thing happens to you, you'll need to switch to the Localhost chain manually within the wallet.

Commands

See the Makefile for a description of all top-level make commands.

About

A fully on-chain trading card game. There will be elves, wizards & shit. Drama and broken friendships also.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 45.7%
  • TypeScript 43.6%
  • Circom 4.0%
  • Makefile 3.4%
  • JavaScript 3.2%
  • CSS 0.1%