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
- Click "Use this template" > "Create a new repository" > "Create repository from template"
- Clone repo (eg.
git clone https://github.com/repo_name
) andcd <repo_name>
- Execute the setup script
sh setup.sh
(installs foundry deps, node deps, copies env files) - Obtain a mnemonic for test accounts.
a. Set mnemonic phrase in
packages/app.env
- Obtain a project id for web3modal.
a. Set web3modal project id in
packages/app/.env
- 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.
- Start local chain:
anvil -m $MNEMONIC
- Start ABI generation in separate window:
pnpm wagmi generate --watch ../contracts/broadcast/
- Deploy the Foo contract:
forge script Deploy --broadcast --rpc-url $ANVIL
- Start app:
pnpm -F app dev
This will automatically deploy previews on branches as well.
- Sign up for fleek and connect GitHub repo
- Copy all
packages/app/.env
into Fleek project - Enable preview deploys
anvil -m "$MNEMONIC"
cast block-number
Note: some L2s require a
--legacy
flag if EIP-1559 is not yet supported.
forge script Deploy --broadcast --rpc-url "$SEPOLIA"
pnpm wagmi generate --watch ../contracts/broadcast/
Example insalling openzeppelin:
forge install OpenZeppelin/openzeppelin-contracts
Regenerate remappings importing in the contracts (from the project root):
forge remappings > remappings.txt
- Reset account on Metamask
- Clear all browser storage
- Disconnect account and re-connect