Skip to content

nonceblox/maiv-token

Repository files navigation

Maiv Smart Contracts

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.

Features

  • 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.

Pre Requisites

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.

Usage

Installation

  1. Clone the Repository: Start by cloning this repository to your local machine.
git clone https://github.com/nonceblox/maiv-token
  1. Navigate to the project directory
cd maiv-token
  1. setup environment: create .env and copy from .env.example
PRIVATE_KEY=
ETHERSCAN_API_KEY=
SEPOLIA_RPC_URL=
  1. Forge dependencies Install
forge install
  1. Node dependencies Install: Install Solhint, Prettier, and other Node.js deps
bun install

or

npm install

Compile

to build or compile

forge build

Test

to run all the tests

forge test

Coverage

forge coverage

Solhint

npm run lint:sol

Deploy

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

Clear

to clear build files

forge clean

Format

forge fmt

Gas Snapshots

forge snapshot

Help

forge --help
anvil --help
cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published