WRMB Dapp. A modern, responsive decentralized application (DApp) for WRMB, built with Vue 3, TypeScript, and Web3 technologies.
- π Wallet Integration: Connect with MetaMask, WalletConnect, and other popular wallets
- π° Savings Module: Deposit and withdraw tokens in the savings vault
- π Wrap/Unwrap: Convert between sRMB and sWRMB tokens
- π Bonds: Subscribe to and manage bond investments
- π Portfolio: Track your investments and performance
- π Dark Mode: Toggle between light and dark themes
- π Multi-language: Support for English and Chinese
- π± Responsive: Optimized for desktop and mobile devices
- β‘ Fast: Built with Vite for lightning-fast development and builds
- Frontend: Vue 3, TypeScript, Vite
- UI Framework: Element Plus, Tailwind CSS
- Web3: ethers.js
- State Management: Pinia
- Routing: Vue Router
- Internationalization: Vue I18n
- Build Tool: Vite
- Package Manager: npm/yarn/pnpm
- Node.js 16+
- npm/yarn/pnpm
- A Web3 wallet (MetaMask recommended)
-
Clone the repository
git clone <repository-url> cd wrmb-user-dapp
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Environment Configuration
cp .env.example .env
Edit
.envfile and configure the following variables:# Application Configuration VITE_APP_NAME=WRMB DApp VITE_DEFAULT_CHAIN_ID=1 # Contract Addresses (replace with actual addresses) VITE_SAVINGS_VAULT_ADDRESS_ETHEREUM=0x... VITE_WRAP_MANAGER_ADDRESS_ETHEREUM=0x... VITE_BOND_POOL_ADDRESS_ETHEREUM=0x... VITE_WRMB_ADDRESS_ETHEREUM=0x... VITE_SWRMB_ADDRESS_ETHEREUM=0x... VITE_SRMB_ADDRESS_ETHEREUM=0x... # RPC Providers VITE_INFURA_PROJECT_ID=your_infura_project_id VITE_ALCHEMY_API_KEY=your_alchemy_api_key # WalletConnect VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id
-
Start development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to
http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run type-check- Run TypeScript type checkingnpm run lint- Run ESLintnpm run format- Format code with Prettier
src/
βββ components/ # Reusable Vue components
β βββ common/ # Common components (modals, buttons, etc.)
β βββ layout/ # Layout components (header, footer, etc.)
βββ views/ # Page components
βββ stores/ # Pinia stores for state management
βββ router/ # Vue Router configuration
βββ services/ # API and contract services
βββ utils/ # Utility functions
βββ constants/ # Application constants
βββ locales/ # Internationalization files
βββ i18n/ # i18n configuration
βββ assets/ # Static assets
The app supports multiple networks. Configure them in src/constants/index.ts:
export const NETWORKS = {
ETHEREUM: {
chainId: 1,
name: 'Ethereum Mainnet',
rpcUrl: 'https://mainnet.infura.io/v3/',
blockExplorer: 'https://etherscan.io'
},
// Add more networks...
}Update contract addresses in your .env file or src/constants/index.ts:
export const CONTRACTS = {
SAVINGS_VAULT: {
[NETWORKS.ETHEREUM.chainId]: process.env.VITE_SAVINGS_VAULT_ADDRESS_ETHEREUM
},
// Add more contracts...
}Supported wallets are configured in src/constants/index.ts:
export const SUPPORTED_WALLETS = {
METAMASK: {
name: 'MetaMask',
connector: 'injected'
},
WALLET_CONNECT: {
name: 'WalletConnect',
connector: 'walletconnect'
}
}- Click "Connect Wallet" in the header
- Select your preferred wallet
- Approve the connection in your wallet
- Your wallet address and balance will be displayed
- Navigate to the Savings page
- Enter the amount you want to deposit
- Approve the token spending (if first time)
- Confirm the deposit transaction
- Your sWRMB balance will be updated
- Go to the Wrap page
- Choose between Wrap (sRMB β sWRMB) or Unwrap (sWRMB β sRMB)
- Enter the amount
- Confirm the transaction
- Visit the Bonds page
- Review available bond terms
- Enter subscription amount
- Confirm the bond subscription
- Track your bonds in the "My Bonds" section
- Access the Portfolio page to view:
- Total portfolio value
- Asset allocation
- Performance charts
- Transaction history
-
Wallet not connecting
- Ensure your wallet extension is installed and unlocked
- Check if you're on the correct network
- Try refreshing the page
-
Transaction failing
- Check if you have sufficient balance
- Ensure you've approved token spending
- Verify gas settings
-
Contract not found
- Verify contract addresses in
.env - Ensure you're connected to the correct network
- Verify contract addresses in
-
Build errors
- Clear node_modules and reinstall dependencies
- Check TypeScript errors with
npm run type-check - Ensure all environment variables are set
- Hot Reload: The development server supports hot reload for fast development
- TypeScript: Use TypeScript for better development experience
- ESLint: Follow the configured linting rules
- Console Logs: Check browser console for detailed error messages
| Variable | Description | Required |
|---|---|---|
VITE_APP_NAME |
Application name | No |
VITE_DEFAULT_CHAIN_ID |
Default blockchain network | Yes |
VITE_INFURA_PROJECT_ID |
Infura project ID for RPC | Yes |
VITE_WALLETCONNECT_PROJECT_ID |
WalletConnect project ID | Yes |
VITE_SAVINGS_VAULT_ADDRESS_* |
Savings vault contract address | Yes |
VITE_WRAP_MANAGER_ADDRESS_* |
Wrap manager contract address | Yes |
VITE_BOND_POOL_ADDRESS_* |
Bond pool contract address | Yes |
VITE_*_ADDRESS_* |
Token contract addresses | Yes |
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes
- Run tests and linting:
npm run lint && npm run type-check - Commit your changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
- Never commit private keys or sensitive information
- Always verify contract addresses before transactions
- Use hardware wallets for large amounts
- Keep your dependencies updated
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- π§ Email: support@wrmb.finance
- π¬ Discord: WRMB Community
- π¦ Twitter: @wrmb_finance
- π Documentation: docs.wrmb.finance
- Initial release
- Wallet connection support
- Savings module
- Wrap/Unwrap functionality
- Bonds management
- Portfolio tracking
- Multi-language support
- Dark mode
- Responsive design