Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Apr 11, 2024
1 parent ccad9f7 commit 57cde3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/providers/App/useReadOnlyValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const useReadOnlyValues = ({ node, governance }: Fractal, _account?: stri
await Promise.all(
azoriusGovernance.erc721Tokens.map(async ({ address, votingWeight }) => {
const tokenContract = ERC721__factory.connect(address, signerOrProvider);
const userBalance = await tokenContract.balanceOf(_account);
return BigInt(userBalance.toString()) * votingWeight;
const userBalance = (await tokenContract.balanceOf(_account)).toBigInt();
return userBalance * votingWeight;
}),
)
).reduce((prev, curr) => prev + curr, 0n);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/numberFormats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const formatCoinUnits = (
decimals?: number,
symbol?: string,
): number => {
if (!rawBalance) rawBalance = '0';
if (!rawBalance) rawBalance = 0n;
return symbol && decimals
? parseFloat(formatUnits(BigInt(rawBalance), decimals))
: parseFloat(formatEther(BigInt(rawBalance)));
Expand Down

0 comments on commit 57cde3e

Please sign in to comment.