Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 948 Bytes

README.md

File metadata and controls

30 lines (24 loc) · 948 Bytes

Merkle Distributor

This package contains the logic for managing Merkle trees: create leafs, generate Merkle trees and proofs. Also, MerkleDistributor is a wrapper around the Merkle tree which is used for managing the recipients of the ACX token airdrop.

Usage

See tests for more documentation: MerkleDistributor

import * as across from "@across-protocol/sdk";

const { MerkleDistributor, MerkleTree, DistributionRecipient } = across.merkleDistributor;

const windowIndex = 0;
const recipients: DistributionRecipient[] = [
  {
    account: "0x00b591bc2b682a0b30dd72bac9406bfa13e5d3cd",
    accountIndex: 0,
    amount: "1000000000000000000",
    metadata: {
      amountBreakdown: {
        name: "5000000000000000",
      },
    },
  },
// ...other recipients data
];
const { merkleRoot, recipientsWithProofs } = MerkleDistributor.createMerkleDistributionProofs(recipients, windowIndex);