This repository provides a comprehensive development environment tailored for the Maiv Smart Contracts, leveraging Foundry and a suite of development tools to facilitate a smooth development, testing, and deployment process.
- Foundry: compile, run, test and deploy smart contracts
- Solhint: to enforce code quality and conformity to Solidity best practices.
- Prettier Plugin Solidity: Adopts Prettier with Solidity plugin for consistent code formatting, improving readability and maintainability.
- Test Coverage: Utilize solidity-coverage to measure the coverage of your tests, ensuring comprehensive testing of contract functionalities.
- Contract Sizing: Includes tools to analyze and report the size of compiled smart contracts, aiding in optimization and gas usage estimation.
Before diving into development, ensure you have the following tools and configurations set up:
- Node.js and npm or bun: Ensure you have Node.js and npm or bun installed to manage project dependencies.
- Foundry: Familiarize yourself with Foundry's workflow and commands for a smooth development experience.
- Ethereum Wallet: Have an Ethereum wallet setup, preferably with testnet Ether for deployment and testing.
- Solidity Knowledge: A good understanding of Solidity and smart contract development is essential.
- Clone the Repository: Start by cloning this repository to your local machine.
git clone https://github.com/nonceblox/maiv-token
- Navigate to the project directory
cd maiv-token
- setup environment: create .env and copy from .env.example
PRIVATE_KEY=
ETHERSCAN_API_KEY=
SEPOLIA_RPC_URL=
- Forge dependencies Install
forge install
- Node dependencies Install: Install Solhint, Prettier, and other Node.js deps
bun install
or
npm install
to build or compile
forge build
to run all the tests
forge test
forge coverage
npm run lint:sol
Before running the deployment script, ensure that all parameter values are assigned in the deployment script folder.
- MaivToken.s.sol: ownerAddress, initialHolderAddress, admin1, admin2, admin3
Deploy MaivToken.sol
forge script script/MaivToken.s.sol:MaivTokenScript --rpc-url <your_rpc_url> --broadcast
to clear build files
forge clean
forge fmt
forge snapshot
forge --help
anvil --help
cast --help