How daulathussain/multi-currency-ico-dapp-starter-file works
Project type and purpose
• This is a full-stack Web3 DApp comprising:
• A React/Next.js frontend (UI, pages, components, context and state management)
• Solidity smart contracts managed with Hardhat (ICO, staking, referral)
• Web3 integration via Wagmi, React context and custom hooks
• External services (Alchemy RPC, Pinata IPFS, Formspree, WalletConnect)
File structure
• Top-level “components”, “context”, “provider”, “pages” and “styles” folders → Next.js frontend
• Next.config.js, postcss.config.js, tailwind.config.js → build & styling config for Next.js
• “web3” subfolder → Hardhat project: contracts, artifacts, build-info, deploy scripts, config
• Env files (.env.local, web3/.env, .env.local.main) → keys for RPC, IPFS, API services
• package.json in root and web3 → separate dependencies for frontend vs smart-contracts
• provider/hooks.js & wagmiConfigs.js → centralized configuration for Web3 client
README for insights
• Purpose: Multi-Currency ICO, staking and referral DApp on EVM
• Tech stack: Next.js, Solidity, Wagmi, Hardhat, Tailwind CSS
• Key features: multi-token ICO smart contract, staking mechanism, referral rewards, wallet connect
Main components and interactions
a. Frontend Presentation Layer
• Next.js pages (index.js, dashboard.js, _app.js)
• React components (UI modules under components/*)
• Global context (ToastContext, Utility, Web3Provider)
b. Web3 Client Layer
• wagmi client (provider/wagmiConfigs.js)
• custom hooks (provider/hooks.js)
• WalletConnect UI component
c. Smart Contract Layer
• Solidity contracts (web3/contracts)
• Deployment scripts (web3/scripts/deploy.js)
• Hardhat config (web3/hardhat.config.js)
• Artifacts & ABIs (web3/artifacts)
d. Blockchain Infrastructure
• EVM network (e.g., Ethereum testnet/mainnet via Alchemy or other RPC)
• Hardhat local node (for development)
e. External Services
• Alchemy (RPC provider)
• Pinata (IPFS for whitepaper, metadata)
• Formspree (contact forms)
• WalletConnect or Reown relay
Architectural patterns and design principles
• Layered architecture: Presentation → Web3 Client → Smart Contracts → Blockchain
• Component-based UI (modular React components)
• Context API for cross-cutting state (toasts, utility functions, Web3 provider)
• Wagmi for declarative Web3 hooks and provider management
• Hardhat for contract compilation, testing, and deployment