### Install Dependencies and Start Development Server (Bash) Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-dapp/README.md This snippet outlines the commands to install project dependencies, set up environment variables, and start the development server for the MeeChain DApp. It assumes the user is in the project's root directory. ```bash cd meechain-dapp npm install cp .env.example .env npm run dev ``` -------------------------------- ### Install Dependencies with npm Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Installs all project dependencies using the npm package manager. Ensure Node.js and npm are installed on your system. ```bash npm install ``` -------------------------------- ### Environment Variable Setup Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Defines environment variables required for contract deployment and operations. The `PRIVATE_KEY` is essential for signing transactions, while API keys can be used for specific services. ```bash # Private key for deployment PRIVATE_KEY=your_private_key_here # API keys (optional) FUSE_API_KEY=your_fuse_api_key REPORT_GAS=false ``` -------------------------------- ### Complete a Quest with QuestManager Contract Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md JavaScript example demonstrating how to interact with the QuestManager contract to complete a quest. Requires an Ethers.js contract instance and signer. ```javascript // JavaScript example const questManager = new ethers.Contract(questManagerAddress, abi, signer); await questManager.completeQuest(0); // Complete quest ID 0 ``` -------------------------------- ### Contract Deployment Output Format Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Example JSON structure representing the addresses of deployed smart contracts on a given network. This is typically generated after a successful deployment process. ```json { "network": "fuse", "contracts": { "MeeToken": "0x...", "MeeBadgeNFT": "0x...", "MembershipNFT": "0x...", "QuestManager": "0x...", "BadgeNFTUpgrade": "0x..." } } ``` -------------------------------- ### Upgrade a Badge with BadgeNFTUpgrade Contract Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md JavaScript example showing how to call the `upgradeBadge` function on the BadgeNFTUpgrade contract. Requires an Ethers.js contract instance and signer. ```javascript // JavaScript example const badgeUpgrade = new ethers.Contract(upgradeAddress, abi, signer); await badgeUpgrade.upgradeBadge(tokenId); // Upgrade badge with tokenId ``` -------------------------------- ### Retrieve User's Badges with MeeBadgeNFT Contract Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md JavaScript example demonstrating how to fetch a user's badges from the MeeBadgeNFT contract. Requires an Ethers.js contract instance and provider. ```javascript // JavaScript example const badgeNFT = new ethers.Contract(badgeAddress, abi, provider); const userBadges = await badgeNFT.getUserBadges(userAddress); ``` -------------------------------- ### Deployment Instructions for Replit (Bash) Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-dapp/README.md Steps for deploying the MeeChain DApp on Replit. This involves setting environment variables in Replit Secrets, building the project, and using Replit's deployment system. ```bash # 1. Set environment variables in Replit Secrets # 2. Build project: npm run build # 3. Deploy via Replit deployment system ``` -------------------------------- ### Development Commands (Bash) Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-dapp/README.md Provides essential commands for developing the MeeChain DApp, including type checking, linting, building for production, and previewing the production build. These commands are typically run from the project's root directory. ```bash npm run type-check npm run lint npm run build npm run preview ``` -------------------------------- ### Project Development Scripts Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md A set of npm scripts to streamline common development tasks like compiling, testing, deploying, verifying, and generating documentation for the smart contracts. ```bash # Compile contracts npm run compile # Run tests npm run test # Deploy to testnet npm run deploy:testnet # Deploy to mainnet npm run deploy:mainnet # Verify contracts npm run verify # Generate documentation npm run docs ``` -------------------------------- ### Compile Smart Contracts with Hardhat Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Compiles the Solidity smart contracts using the Hardhat development environment. This step is necessary before testing or deploying. ```bash npx hardhat compile ``` -------------------------------- ### Run Tests with Gas Reporting and Coverage Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Executes tests with additional reporting features. Gas reporting analyzes transaction costs, while coverage measures the extent to which tests exercise the codebase. ```bash # Run with gas reporting REPORT_GAS=true npx hardhat test # Run with coverage npx hardhat coverage ``` -------------------------------- ### Deploy Contracts to Fuse Network with Hardhat Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Deploys the smart contracts to the specified Fuse Network. Requires a `scripts/deploy.js` file and network configuration in Hardhat. Supports both testnet (Spark) and mainnet. ```bash # Deploy to Fuse Spark Testnet npx hardhat run scripts/deploy.js --network spark # Deploy to Fuse Mainnet npx hardhat run scripts/deploy.js --network fuse ``` -------------------------------- ### Run Specific Test File with Hardhat Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Executes a single test file within the Hardhat testing framework. Useful for focused testing during development. ```bash npx hardhat test test/badge.test.js ``` -------------------------------- ### Run Smart Contract Tests with Hardhat Source: https://github.com/t1adipt4/meechain-dapp/blob/production/meechain-contracts/README.md Executes the test suite for the smart contracts using Hardhat. This is crucial for verifying contract logic and preventing regressions. ```bash npx hardhat test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.