Skip to content

Commit

Permalink
Fix/claim-calc-rounding (#133)
Browse files Browse the repository at this point in the history
* Fix rounding bug causing claims to fail

* Log commit hash
  • Loading branch information
gpxl-dev committed Nov 10, 2023
1 parent d89ea78 commit 26852f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/claims/hooks/useClaimCalculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const useClaimCalculations = (
alwaysUseDefault: false,
});
const _points = BigInt(
new BigNumber(points).multipliedBy(10 ** 4).toFixed(0),
new BigNumber(points)
.multipliedBy(10 ** 4)
.toFixed(0, BigNumber.ROUND_FLOOR),
);

const fetch = async () => {
Expand All @@ -29,7 +31,6 @@ export const useClaimCalculations = (
args: [_points, tokenAddress],
})),
});

// return just the results
return multicallResponse.map((response) => response.result || 0n);
};
Expand Down
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
</QueryClientProvider>
</React.StrictMode>,
);

console.log("Build commit hash: " + process.env.COMMIT_HASH);

0 comments on commit 26852f0

Please sign in to comment.