Skip to content

Commit

Permalink
fix: Correct scripts contract resolution utility
Browse files Browse the repository at this point in the history
Was recently broken during a refactor.
  • Loading branch information
pxrl committed Sep 10, 2023
1 parent 3061e41 commit 4f0cf53
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ export function resolveHubChainId(spokeChainId: number): number {
* @returns ethers Contract instance.
*/
export async function getContract(chainId: number, contractName: string): Promise<Contract> {
const hubPoolChainId = resolveHubChainId(chainId);

const contract = getDeployedContract(contractName, hubPoolChainId);
const contract = getDeployedContract(contractName, chainId);
const provider = new ethers.providers.StaticJsonRpcProvider(getProviderUrl(chainId));
return contract.connect(provider);
}
Expand All @@ -129,7 +127,8 @@ export async function getContract(chainId: number, contractName: string): Promis
* @returns SpokePool contract instance.
*/
export async function getSpokePoolContract(chainId: number): Promise<Contract> {
const hubPool = await getContract(chainId, "HubPool");
const hubChainId = resolveHubChainId(chainId);
const hubPool = await getContract(hubChainId, "HubPool");
const spokePoolAddr = (await hubPool.crossChainContracts(chainId))[1];

const contract = new Contract(spokePoolAddr, contracts.SpokePool__factory.abi);
Expand Down

0 comments on commit 4f0cf53

Please sign in to comment.