Skip to content

Latest commit

 

History

History

merkleDistributor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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);