From b53ae0d3c4bbe1cef3b2f9e2fcc08d3337bfd73c Mon Sep 17 00:00:00 2001 From: Adam Azad Date: Thu, 25 Apr 2024 14:25:09 +0300 Subject: [PATCH] fix: address map --- claim-gui/src/hooks/useAllocation.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/claim-gui/src/hooks/useAllocation.tsx b/claim-gui/src/hooks/useAllocation.tsx index a9e2bc57..fe24b46f 100644 --- a/claim-gui/src/hooks/useAllocation.tsx +++ b/claim-gui/src/hooks/useAllocation.tsx @@ -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,