Skip to content

Commit

Permalink
fix: address map
Browse files Browse the repository at this point in the history
  • Loading branch information
adamazad authored and auryn-macmillan committed Apr 25, 2024
1 parent d796f8f commit b53ae0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions claim-gui/src/hooks/useAllocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ function computeProof(
distribution: Map,
address: string,
): AllocationEntry | null {
if (!distribution[address]) {
const addressLowerCase = address.toLowerCase();

if (!distribution[addressLowerCase]) {
console.log(`Address (${addressLowerCase}) not found in distribution`);
return null;
}

const leaves = Object.keys(distribution).map((address) => [
address,
BigNumber.from(distribution[address]),
BigNumber.from(distribution[addressLowerCase]),
]);

const index = leaves.findIndex(([_address]) => _address === address);
const index = leaves.findIndex(([_address]) => _address === addressLowerCase);
const tree = StandardMerkleTree.of(leaves, ["address", "uint256"]);
return {
amount: leaves[index][1] as BigNumber,
Expand Down

0 comments on commit b53ae0d

Please sign in to comment.