Concise AI agent guide for shipping code quickly and safely in the BetVanta monorepo (Solidity contracts, Next.js frontend, Web3 betting platform)
This skill provides AI agents with concise, repo-specific instructions for working in the BetVanta codebase—a Web3 betting platform monorepo with Solidity contracts and a Next.js frontend.
BetVanta is a monorepo containing:
The bet lifecycle is managed in `contracts/core/BetVantaCore.sol`:
**Events:**
**State Flow:**
**Token Integration:**
All frontend commands run from the `frontend/` directory:
```bash
pnpm -w install
pnpm --filter @betvanta/frontend dev
pnpm --filter @betvanta/frontend build
```
Contracts use Hardhat for compilation and testing:
```bash
pnpm hardhat compile
pnpm hardhat test
```
**Note:** Consider moving Hardhat dependencies under the `contracts/` workspace for better organization.
```bash
pnpm --filter @betvanta/shared build
```
**Path Aliases:**
**Web3 Integration:**
- `frontend/src/hooks/useWeb3.ts` — wallet connection and provider setup
- `frontend/src/hooks/useBetting.ts` — betting contract interactions
**Forms:**
**Problem:** Code uses ethers v5 patterns but packages declare v6 dependencies.
**V5 Patterns Found:**
```typescript
ethers.providers.Web3Provider
ethers.utils.parseEther
```
**V6 Equivalents:**
```typescript
BrowserProvider
parseEther (direct import)
```
**Solution:** Either upgrade all hooks to v6 syntax OR pin `ethers@^5.7.0` across all workspaces.
**Problem:** `useBetting.ts` imports `@/abis/BetVantaCore.json` but no `abis/` directory exists at repo root.
**Solution:**
**Problem:** `useBetting.ts` calls `getBets()` but `BetVantaCore.sol` doesn't expose this function.
**Solutions:**
**Problem:** `contracts/core/BetVantaCore.sol` uses `./interfaces/...` imports but interfaces are in `contracts/interfaces/`.
**Solution:** Update imports to `../interfaces/...` for correct relative path resolution.
**Problem:** Running `pnpm run dev` from repo root may fail.
**Solution:** Always run the Next.js dev server from the `frontend/` directory using the workspace filter command.
When working on similar features or debugging, consult these files:
**Forms & UI Components:**
**Web3 Patterns:**
**Contract Design:**
When working in this codebase:
1. **Always verify ethers.js version** before adding Web3 code—check package.json and use consistent syntax
2. **Never modify bet state transitions** without preserving the PENDING → ACCEPTED → SETTLED flow
3. **Always ensure token approval** before requesting bets in any new UI or contract logic
4. **Use workspace-filtered pnpm commands** to avoid dependency resolution issues
5. **Check for existing hooks** before adding Web3 logic—reuse `useWeb3` and `useBetting` patterns
6. **Follow the form validation pattern** from `PlaceBetForm.tsx` for consistency
7. **Add tests** in `contracts/test/` for any contract modifications
8. **Update ABIs** after contract changes and ensure frontend imports remain valid
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/betvanta-development-guide/raw