Self-stabilizing staking vaults where the price is mathematically proven to always increase. Unstaking fees reward vault creators and long-term stakers.
- Overview
- Features
- Tech Stack
- Architecture
- File Structure
- Setup
- Environment Variables
- Development
- Debugging
- Deployment
- Contributing
- License for Assets
- Create new staking vaults for ERC‑20 tokens (
/createVault) - Explore all vaults across supported chains (
/explorer) - Track your created vaults (
/myVaults) - Save and revisit favorite vaults (
/favorites) - Detailed vault view: balances, fees, price, and manual sync (
/v/[vaultId]) - Wallet connection via RainbowKit/Wagmi with multi-chain support
- Fast UI built with Tailwind and shadcn/ui components
- Local caching using IndexedDB for snappy UX
- Next.js 14 (App Router) + TypeScript
- Tailwind CSS + shadcn/ui (Radix primitives)
- Wagmi + RainbowKit + Reown AppKit
- Ethers v5 and Viem utilities
- TanStack Query
- Lottie animations
- Wallet and chain:
- Wagmi/RainbowKit configuration reads
NEXT_PUBLIC_PROJECT_IDinutils/config.ts:16. - Custom chain definitions under
components/CitreaTestnet.tsxandcomponents/EthereumClassic.tsx.
- Wagmi/RainbowKit configuration reads
- Data access:
- Vault discovery via on-chain factories (
utils/addresses.ts, ABIs underutils/contracts/). - Cached lists and details stored in IndexedDB (
utils/indexedDB.ts).
- Vault discovery via on-chain factories (
- UI pages:
- App Router under
app/with route segments for explorer, favorites, my vaults, vault detail. - Vault detail client handles sync, fees, balances (
app/[vaultId]/InteractionClient.tsx:76,app/[vaultId]/InteractionClient.tsx:311).
- App Router under
- Styling and components:
- Tailwind and shadcn/ui components in
components/ui/. - Reusable feature modules in
components/Vault/,components/Explorer/, etc.
- Tailwind and shadcn/ui components in
app/
[vaultId]/ # Vault detail route
InteractionClient.tsx
page.tsx
createVault/ # Create vault flow
explorer/ # Explore vaults
favorites/ # Favorite vaults
myVaults/ # User-created vaults
layout.tsx # Root layout and providers
page.tsx # Home page
components/
Home/ # Hero + About sections
Explorer/ # Explorer cards and lists
FavoriteVaults/ # Favorites listing
FindVault/ # Vault search dialog
Vault/ # Vault UI: actions, hero, info
hooks/ # UI hooks (matrix effect, token list)
ui/ # shadcn/ui primitives
ChainDropdown.tsx # Chain selector
Header.tsx, Footer.tsx, NavBar.tsx, etc.
contexts/
EthersContext.tsx # Metamask context values
providers/
WalletProvider.tsx # Wagmi/RainbowKit provider
theme-provider.tsx # Theme support
utils/
contracts/ # ABIs for HodlCoin, ERC20, Factory
addresses.ts # Chain factory addresses
chains.ts # Chain name helpers
config.ts # Wagmi/RainbowKit config
favorites.ts # Favorite handling
indexedDB.ts # Caching layer
props.ts # Shared types
lib/
utils.ts # Utility functions
public/
animations/ # Lottie JSON
images/ # Avatars and brand assets
hodlcoin*.svg/png # Logos and license
next.config.mjs # Static export + basePath for GH Pages
tailwind.config.ts # Tailwind config
tsconfig.json # TS strict mode + path aliases
.eslintrc.json # ESLint config
.prettierrc # Prettier config
.env.example # Required env vars
- Node.js 18+
- npm, pnpm, or yarn
- A Web3 wallet (e.g., MetaMask) or WalletConnect-compatible wallet
-
Clone the repository and install dependencies:
npm install # or: yarn, pnpm -
Configure environment variables:
- Copy
.env.exampleto.env - Set
NEXT_PUBLIC_PROJECT_IDwith your Reown Cloud project ID - Optionally set
NEXT_PUBLIC_API_URLif an API is used
- Copy
-
Run the dev server:
npm run dev
Visit
http://localhost:3000
NEXT_PUBLIC_PROJECT_ID: Required for WalletConnect/Reown integration
Used inutils/config.ts:16.NEXT_PUBLIC_API_URL: Optional backend/API base URL (if applicable)
npm run dev: Start development servernpm run build: Build for production (static export toout)npm run start: Start production servernpm run lint: Run Next.js ESLint checks
- TypeScript
- Strict mode enabled in
tsconfig.json:11 - Path alias
@/*to project root intsconfig.json:25
- Strict mode enabled in
- Linting and formatting
- ESLint:
next/core-web-vitals(.eslintrc.json:2) - Prettier config in
.prettierrc
- ESLint:
- UI conventions
- shadcn/ui primitives in
components/ui/ - Tailwind utility-first CSS in
app/globals.cssand components
- shadcn/ui primitives in
- Data and caching
- IndexedDB manager in
utils/indexedDB.tsfor vault lists/details caching
- IndexedDB manager in
- Wallet/project ID issues
- Ensure
NEXT_PUBLIC_PROJECT_IDis set in.envand not empty - Configuration reads this in
utils/config.ts:16
- Ensure
- Chain/client errors
- If
getPublicClientreturns null, verify supported chains and wallet network - Check
components/ChainDropdown.tsxandutils/addresses.tsfor chain mapping
- If
- Stale cache
- Use manual sync in vault detail (
app/[vaultId]/InteractionClient.tsx:311) - Or clear site data via DevTools: Application → Storage → Clear Site Data
- Use manual sync in vault detail (
- Static export routing
next.config.mjs:8usesbasePath: '/hodlCoin-Solidity-WebUI'. Ensure your GitHub Pages repo name matches- When serving under a subpath, all links and asset paths include the base path automatically
- Common local fixes
- Delete
.next/andout/, reinstall dependencies, and retry build/run - Confirm Node 18+ and a working
npm/yarn/pnpminstallation
- Delete
This project is configured for static export:
next.config.mjs:4setsoutput: 'export'anddistDir: 'out'next.config.mjs:8setsbasePath: '/hodlCoin-Solidity-WebUI'for GitHub Pages
Build and publish:
npm run build
npx gh-pages -d outYou can deploy out/ to any static host (GitHub Pages, Vercel static, Netlify, etc.).
app/: Routes and pages (App Router)components/: UI and feature components (e.g., Vault, Explorer, Home)providers/: Wagmi/RainbowKit and theme providersutils/: Chains, addresses, ABIs, config, favorites, cachingpublic/: Static assets and animations
- Open an issue with a clear description and steps to reproduce
- Make focused PRs with clear titles and descriptions
- Run
npm run lintand ensure builds pass before submitting - See
CONTRIBUTING.mdfor detailed guidelines
Logo and brand assets are licensed separately. See public/hodlcoin-logo-license.md.