Giter Site home page Giter Site logo

taiko's Introduction

What's included ⚡

  • SvelteKit app
    • Auto-generated and fully-typed ABIs using wagmi-generate
    • Web3modal connect button using wagmi-core
  • Foundry contracts
    • Configured for easy multi-chain deployments

Create your dapp with one-click deploy button (recommended)

  1. Deploy with Vercel
  2. Clone and cd the repo that was created by Vercel using git clone <REPO_NAME> && cd <REPO_NAME>
  3. Install Foundry dependency because Vercel doesn't clone the submodules: forge install foundry-rs/forge-std
  4. Install pnpm
  5. Install packages and copy .env.example files: sh setup.sh
  6. Set mnemonic phrase in root .env for test accounts (generate a bip39 mnemonic)
  7. Set web3modal project id in packages/app/.env (obtain a project id for web3modal)

Create your dapp manually

  1. Clone/fork the repo: git clone https://github.com/d1onys1us/dapp-slaps.git
  2. Install packages and copy .env.example files: cd dapp-slaps && sh setup.sh
  3. Set mnemonic phrase in root .env for test accounts (generate a bip39 mnemonic)
  4. Set web3modal project id in packages/app/.env (obtain a project id for web3modal)
  5. Source environment vars: source .env && source packages/app/.env

Start the development environment

You will have three development windows, start them all and source all .env files with source .env && source packages/app/.env.

  1. Start local chain: anvil -m $MNEMONIC
  2. Deploy the Foo contract: forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi
  3. Start app: pnpm -F app dev

Faucet links

Sepolia

Taiko

Common app commands

Start the app locally

pnpm -F app dev

Generate typed ABIs from Foundry contracts

pnpm -F app wagmi

Common Foundry commands

Install a Foundry package

  1. Start by installing the package (example: openzeppelin-contracts):
forge install OpenZeppelin/openzeppelin-contracts
  1. Regenerate the remappings for the contract imports (run this from the project root):
forge remappings > remappings.txt

Start local anvil chain from mnemonic

anvil -m $MNEMONIC

Deploy contracts to some chain and generate types

Note: some L2s require a --legacy flag if EIP-1559 is not yet supported.

forge script Deploy --broadcast --rpc-url $FOUNDRY && pnpm -F app wagmi

Troubleshooting

  • Try resetting account in MetaMask
  • Try clearing all browser storage
  • Try disconnecting account and reconnecting
  • Ensure all env vars are set

Acknowledgements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.