Skip to content

Commit

Permalink
docs: update README to reflect Merkle Airdrop system features and usa…
Browse files Browse the repository at this point in the history
…ge instructions
  • Loading branch information
sumit03guha committed Jan 9, 2025
1 parent 25140cc commit ce02067
Showing 1 changed file with 36 additions and 42 deletions.
78 changes: 36 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,60 @@
## Foundry
# Merkle Airdrop System

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
The Merkle Airdrop system enables the distribution of tokens via airdrops in a secure and gas-efficient manner using Merkle proofs to verify claims. This repository contains the smart contracts, testing suite, and deployment scripts necessary for setting up and managing a Merkle Airdrop.

Foundry consists of:
## Features

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
- **Secure Token Distribution**: Uses Merkle proofs to ensure that airdrops are claimed only by eligible addresses.
- **Gas Efficiency**: Reduces the gas cost by allowing users to prove their token claim without the need for on-chain storage of all possible claimants.
- **EIP712 Signing**: Implements EIP712 for secure and verifiable signatures.
- **Comprehensive Tests**: Includes a full suite of tests to ensure functionality and robustness.
- **Script Automation**: Scripts to generate airdrop input data and Merkle proofs for deployment.

## Documentation
## Prerequisites

https://book.getfoundry.sh/
Before you begin, ensure you have the following installed:

## Usage

### Build
- [Foundry](https://book.getfoundry.sh/getting-started/installation.html) for Solidity testing and deployment

```shell
$ forge build
```
## Installation

### Test
Clone the repository and install dependencies:

```shell
$ forge test
```bash
git clone https://your-repository-url.git
cd merkle-airdrop-system
forge install
```

### Format
## Usage

```shell
$ forge fmt
```
### Generating Merkle Proofs

### Gas Snapshots
Generate input data and Merkle proofs by running:

```shell
$ forge snapshot
```bash
forge script script/GenerateInput.s.sol
forge script script/MakeMerkle.s.sol
```

### Anvil
### Running Tests

```shell
$ anvil
Execute the tests with Foundry:

```bash
forge test
```

### Deploy
## Smart Contracts

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```
- **MerkleAirdrop.sol**: Main contract for handling the airdrop.
- **MockToken.sol**: Mock ERC20 token for testing purposes.

### Cast
## Scripts

```shell
$ cast <subcommand>
```
- **GenerateInput.s.sol**: Generates the input data for the Merkle tree.
- **MakeMerkle.s.sol**: Generates the Merkle tree root and proofs from the input data.

### Help
## License

```shell
$ forge --help
$ anvil --help
$ cast --help
```
Distributed under the MIT License. See `LICENSE` for more information.

0 comments on commit ce02067

Please sign in to comment.