A fork from merkle-airdrop-starter and merkle-distributor, but with snapshots!
# Install dependencies
npm install
Install Foundry for contract development and deployment.
To take snapshots from POAPs and token contracts, please config scripts/snapshots/config.json
.
# `./data/the-space-initial-airdrop` is the output directory
npm run snapshot -- ./data/the-space-initial-airdrop
Distribute amount of tokens to POAP owners.
We use POAP subgraph of The Graph as the source.
Note: Limits on 1000 addresses, needs support for pagination.
npm run snapshot:poapOwners -- ./data/the-space-initial-airdrop
Distribute amount of tokens to token owners.
We use Alchemy Transfers API and getNFTsForCollection as the source.
npm run snapshot:collectionOwners -- ./data/the-space-initial-airdrop
We use getOwnersForToken as the source.
npm run snapshot:tokenOwners -- ./data/the-space-initial-airdrop
Distribute amount of tokens based on transfer count.
npm run snapshot:transfers -- ./data/the-space-initial-airdrop
After snapshots are taken, we can generate merkle root (outputs to data/the-space-initial-airdrop/merkle.json
).
Note: You can also put owner addresses (JSON file) to data/the-space-initial-airdrop
folder as from different sources and update data/the-space-initial-airdrop/config
manually.
# `./data/the-space-initial-airdrop` is the inputs (owner addresses) and outputs (proofs)
npm run generate:merkle -- ./data/the-space-initial-airdrop
Now we can update the merkle root to .env.*
file, and deploy the contract to desired network.
cp .env.polygon-mumbai.example .env.polygon-mumbai
make deploy NETWORK=polygon-mumbai
cp .env.polygon-mumbai.example .env.polygon-mumbai
make test NETWORK=polygon-mumbai
https://book.getfoundry.sh/config/static-analyzers.html#static-analyzers
pip3 install slither-analyzer
pip3 install solc-select
solc-select install 0.8.13
solc-select use 0.8.13
slither contracts/Airdrop.sol