An airdrop is an application where a set number of users are able to claim a specific amount of an asset. In today's ecosystem, this is often used to distribute assets to an application's user base that has previously interacted with their project.
In order to verifiably prove that a user has a claim to an airdrop and avoiding the expensive transaction of storing every address on chain, a Merkle Proof is used. By storing the Merkle root, a single b256
hash, the airdrop application can cryptographically prove a user's validity to their claim.
This application implements the Binary Merkle Proof Verification Library.
More information can be found in the specification and interface.
The project consists of two smart contracts.
airdrop
├── airdrop-contract
│ ├── src/main.sw
│ └── tests/harness.rs
├── README.md
└── SPECIFICATION.md
TODO: The user interface does not currently exist.
In order to run the subsequent commands change into the following directory /path/to/airdrop/<here>
.
forc build --locked
Before running the tests the programs must be compiled with the command above.
cargo test --locked