- 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
- Clone the repo that was created by Vercel using
git clone <REPO_NAME>
- Install Foundry dependency because Vercel doesn't clone the submodules:
forge install foundry-rs/forge-std
- Install packages and copy .env.example files:
cd <REPO_NAME> && sh setup.sh
- Set mnemonic phrase in root
.env
for test accounts (generate a bip39 mnemonic) - Set web3modal project id in
packages/app/.env
(obtain a project id for web3modal) - Source environment vars:
source .env && source packages/app/.env
- Clone/fork the repo:
git clone https://github.com/d1onys1us/dapp-slaps.git
- Install packages and copy .env.example files:
cd dapp-slaps && sh setup.sh
- Set mnemonic phrase in root
.env
for test accounts (generate a bip39 mnemonic) - Set web3modal project id in
packages/app/.env
(obtain a project id for web3modal) - Source environment vars:
source .env && source packages/app/.env
- 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 $FOUNDRY
- Start app:
pnpm -F app dev
pnpm -F app dev
pnpm -F app wagmi-generate
pnpm wagmi generate --watch ../contracts/broadcast/
- Start by installing the package (example: openzeppelin-contracts):
forge install OpenZeppelin/openzeppelin-contracts
- Regenerate the remappings for the contract imports (run this from the project root):
forge remappings > remappings.txt
anvil -m $MNEMONIC
Note: some L2s require a
--legacy
flag if EIP-1559 is not yet supported.
forge script Deploy --broadcast --rpc-url $SEPOLIA
- Try resetting account in MetaMask
- Try clearing all browser storage
- Try disconnecting account and reconnecting
- Ensure all env vars are set