Skip to content

Commit

Permalink
adds multicall3 address to custom-defined networks (#828)
Browse files Browse the repository at this point in the history
* adds multicall3 address to custom-defined networks

* use viem helper function to convert address to correct format
  • Loading branch information
0xDEnYO authored Oct 10, 2024
1 parent 0e1a59e commit fb93afc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script/utils/viemScriptHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chain, defineChain } from 'viem'
import { Chain, defineChain, getAddress } from 'viem'
import * as chains from 'viem/chains'
import networksConfig from '../../config/networks.json'

Expand All @@ -12,7 +12,7 @@ export type Networks = {
status: string
type: string
rpcUrl: string
explorerType: string
verificationType: string
explorerUrl: string
explorerApiUrl: string
multicallAddress: string
Expand Down Expand Up @@ -44,6 +44,9 @@ export const getViemChainForNetworkName = (networkName: string): Chain => {
http: [network.rpcUrl],
},
},
contracts: {
multicall3: { address: getAddress(network.multicallAddress) },
},
})
return chain
}

0 comments on commit fb93afc

Please sign in to comment.