Skip to content

Commit

Permalink
rm: generateMerkleTree from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavaparoksham committed May 16, 2024
1 parent c6a9339 commit 6ba9fba
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions packages/round-manager/src/features/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,42 +316,6 @@ export const getTxExplorerForContract = (
return `https://arbiscan.io/address/${contractAddress}`;
}
};
/**
* Generate merkle tree
*
* To get merkle Proof: tree.getProof(distributions[0]);
* @param matchingResults MatchingStatsData[]
* @returns
*/
export const generateMerkleTree = (
matchingResults: MatchingStatsData[]
): {
distribution: [number, string, BigNumber, string][];
tree: StandardMerkleTree<[number, string, BigNumber, string]>;
matchingResults: MatchingStatsData[];
} => {
const distribution: [number, string, BigNumber, string][] = [];

matchingResults.forEach((matchingResult, index) => {
matchingResults[index].index = index;

distribution.push([
index,
matchingResult.projectPayoutAddress,
matchingResult.matchAmountInToken, // TODO: FIX
matchingResult.projectId,
]);
});

const tree = StandardMerkleTree.of(distribution, [
"uint256",
"address",
"uint256",
"bytes32",
]);

return { distribution, tree, matchingResults };
};

export const formatCurrency = (
value: BigNumber,
Expand Down

0 comments on commit 6ba9fba

Please sign in to comment.