Skip to content

divyangchauhan/0xFable

 
 

Repository files navigation

0xFable

See also the README files of the various subpackages:

Installation

Tooling required:

  • 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

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 59.4%
  • TypeScript 30.5%
  • Circom 3.8%
  • Makefile 3.2%
  • JavaScript 3.1%