Skip to content

Commit

Permalink
Update MULTICALL constant and use it in useMulticall hook
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Feb 18, 2024
1 parent 170bf4a commit 057d370
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/constants/contracts.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const MULTICALL: string = "0xcA11bde05977b3631167028862bE2a173976CA11"; // https://github.com/mds1/multicall, https://www.multicall3.com/
export const MULTICALL_CONTRACT: string =
"0xcA11bde05977b3631167028862bE2a173976CA11"; // https://github.com/mds1/multicall, https://www.multicall3.com/
6 changes: 2 additions & 4 deletions frontend/hooks/useMulticall.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MULTICALL } from "@/constants/contracts";
import { MULTICALL_CONTRACT } from "@/constants/contracts";
import { BigNumber, ethers } from "ethers";
import { Contract, Provider } from "ethers-multicall";
import { multicall3Abi } from "@/abi/multicall3Abi";
Expand All @@ -11,11 +11,9 @@ export const useMulticall = () => {
const provider = new ethers.providers.JsonRpcProvider(rpc);
const multicallProvider = new Provider(provider, 100);

const multicallContract = new Contract(MULTICALL, multicall3Abi);
const multicallContract = new Contract(MULTICALL_CONTRACT, multicall3Abi);

const callData = addresses.map((address) => {
console.log(address);
console.log(multicallContract.getEthBalance(address));
return multicallContract.getEthBalance(address);
});

Expand Down

0 comments on commit 057d370

Please sign in to comment.