Skip to content

Commit

Permalink
check balanceOf query (#205)
Browse files Browse the repository at this point in the history
* check balanceOf query

* add multicall address
  • Loading branch information
rodrigoncalves authored Sep 16, 2024
1 parent 10c292a commit 9e14a92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ NEXT_PUBLIC_RIF_ADDRESS=0x2acc95758f8b5f583470ba265eb685a8f45fc9d5
NEXT_PUBLIC_STRIF_ADDRESS=0x7C90F928Ed6318DBD25c46D09e09fcD94634590c
NEXT_PUBLIC_GOVERNOR_ADDRESS=0x87D5ac0A2D5618407E9a968e75a0AaAeF7C728e5
NEXT_PUBLIC_EA_NFT_ADDRESS=0x7cc028755c18f393BebeE968a7F92CED35e46313
NEXT_PUBLIC_MULTICALL_ADDRESS=
NEXT_PUBLIC_MULTICALL_ADDRESS=0xcA11bde05977b3631167028862bE2a173976CA11
NEXT_PUBLIC_GRANTS_BUCKET_ADDRESS=0x48229e5D82a186Aa89a99212D2D59f5674aa5b6C
NEXT_PUBLIC_GRANTS_ACTIVE_BUCKET_ADDRESS=0x9B5123662e44Ca7FB0bDc7545EfbcDBe8882E4E6
NEXT_PUBLIC_GROWTH_BUCKET_ADDRESS=0x267a6073637408b6A1d34d685ff5720A0CbCbD9d
Expand Down
2 changes: 1 addition & 1 deletion src/app/proposals/hooks/useVotingPower.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GovernorAbi } from '@/lib/abis/Governor'
import { StRIFTokenAbi } from '@/lib/abis/StRIFTokenAbi'
import { tokenContracts, GovernorAddress } from '@/lib/contracts'
import { Address, formatUnits } from 'viem'
import { formatUnits } from 'viem'
import { useAccount, useReadContracts } from 'wagmi'

export const useVotingPower = () => {
Expand Down
10 changes: 7 additions & 3 deletions src/app/user/Balances/hooks/useGetAddressTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import { tokenContracts, MulticallAddress } from '@/lib/contracts'
import { ZeroAddress } from 'ethers'
import { AddressToken } from '@/app/user/types'

const getTokenFunction = (tokenAddress: string, userAddress: string, functionName: 'balanceOf' | 'symbol') =>
const getTokenFunction = (
tokenAddress: Address,
userAddress: Address,
functionName: 'balanceOf' | 'symbol',
) =>
({
abi: RIFTokenAbi,
address: tokenAddress as Address,
address: tokenAddress,
functionName,
args: functionName === 'balanceOf' ? ([userAddress as Address] as [Address]) : ([] as []),
args: functionName === 'balanceOf' ? ([userAddress.toLowerCase()] as [Address]) : ([] as []),
}) as const

type TokenData = [{ result: string | bigint }, { result: string | bigint }]
Expand Down

0 comments on commit 9e14a92

Please sign in to comment.