Git Product home page Git Product logo

dapp-slaps's Introduction

What's included

A monorepo with:

  • Svelte frontend
    • Auto-generated and fully-typed ABI's from wagmi-generate and Foundry plugin
    • Web3modal connect button using wagmi core
  • Foundry backend
    • Configurations for easy multi-chain deployments
  • Automated Fleek (IPFS) deployments

Quickstart

  1. Click "Use this template" > "Create a new repository" > "Create repository from template"
  2. Clone repo (eg. git clone https://github.com/repo_name) and cd <repo_name>
  3. Execute the setup script sh setup.sh (installs foundry deps, node deps, copies env files)
  4. Obtain a mnemonic for test accounts. a. Set mnemonic phrase in packages/app.env
  5. Obtain a project id for web3modal. a. Set web3modal project id in packages/app/.env
  6. Load environment files: source .env && source packages/app/.env

Your environment is ready to go! Use these commands to get started deploying a contract and start buidling.

  1. Start local chain: anvil -m $MNEMONIC
  2. Start ABI generation in separate window: pnpm wagmi generate --watch ../contracts/broadcast/
  3. Deploy the Foo contract: forge script Deploy --broadcast --rpc-url $ANVIL
  4. Start app: pnpm -F app dev

Deploy to Fleek

This will automatically deploy previews on branches as well.

  1. Sign up for fleek and connect GitHub repo
  2. Copy all packages/app/.env into Fleek project
  3. Enable preview deploys

Common commands

Start local anvil chain

anvil -m "$MNEMONIC"

Get current block number with cast

cast block-number

Deploy contracts to some chain

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

forge script Deploy --broadcast --rpc-url "$SEPOLIA"

Automatically generate ABIs from contract deployments

pnpm wagmi generate --watch ../contracts/broadcast/

Install a foundry package

Example insalling openzeppelin:

forge install OpenZeppelin/openzeppelin-contracts

Regenerate remappings importing in the contracts (from the project root):

forge remappings > remappings.txt

Troubleshooting

  • Reset account on Metamask
  • Clear all browser storage
  • Disconnect account and re-connect

dapp-slaps's People

Contributors

d1onys1us avatar

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.