Skip to content

Commit

Permalink
Fix rounding problems when batch approving (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks authored Jul 2, 2024
1 parent 2fb633a commit 7230af2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/nextjs/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ const AdminPage = () => {
});
const builders = selectedGrantsWithMetaData.map(grant => grant.builder);
const buildersAmount = selectedGrantsWithMetaData.map(grant => parseEther((grant.askAmount / 2).toString()));
const totalAmount = selectedGrantsWithMetaData.reduce((acc, grant) => acc + grant.askAmount, 0);
const totalAmount = selectedGrantsWithMetaData.reduce(
(acc, grant) => acc + parseEther(grant.askAmount.toString()),
BigInt(0),
);

const value = totalAmount / BigInt(2);

const value = parseEther((totalAmount / 2).toString());
const hash = await splitEqualETH({
args: [builders, buildersAmount],
value: value,
Expand Down

0 comments on commit 7230af2

Please sign in to comment.