- 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
Now you're 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 -F app wagmi-generate
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
- try reset account metamask
- try clearing all browser storage
- try disconnecting account and re-connecting