From 5eadd445b21f4db4ea60b5ee3978cfb547959e0c Mon Sep 17 00:00:00 2001 From: Christophe Date: Fri, 30 Aug 2024 12:52:33 +0000 Subject: [PATCH] Fix ABI --- src/actions/getAllChainOwners.ts | 9 ++++----- src/actions/getInfraFeeAccount.ts | 9 ++++----- src/actions/getNetworkFeeAccount.ts | 9 ++++----- src/actions/getScheduledUpgrade.ts | 9 ++++----- src/actions/isChainOwner.ts | 12 +++++++----- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/actions/getAllChainOwners.ts b/src/actions/getAllChainOwners.ts index 41c69dd0..194d0a54 100644 --- a/src/actions/getAllChainOwners.ts +++ b/src/actions/getAllChainOwners.ts @@ -1,11 +1,10 @@ import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; -import { arbOwnerPublic } from '../contracts'; +import { arbOwnerPublicABI, arbOwnerPublicAddress } from '../contracts/ArbOwnerPublic'; -type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; export type GetAllChainOwnersParameters = void; export type GetAllChainOwnersReturnType = ReadContractReturnType< - ArbOwnerPublicABI, + typeof arbOwnerPublicABI, 'getAllChainOwners' >; @@ -13,8 +12,8 @@ export async function getAllChainOwners( client: PublicClient, ): Promise { return client.readContract({ - abi: arbOwnerPublic.abi, + abi: arbOwnerPublicABI, functionName: 'getAllChainOwners', - address: arbOwnerPublic.address, + address: arbOwnerPublicAddress, }); } diff --git a/src/actions/getInfraFeeAccount.ts b/src/actions/getInfraFeeAccount.ts index bdd7bd13..ae01803d 100644 --- a/src/actions/getInfraFeeAccount.ts +++ b/src/actions/getInfraFeeAccount.ts @@ -1,11 +1,10 @@ import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; -import { arbOwnerPublic } from '../contracts'; +import { arbOwnerPublicABI, arbOwnerPublicAddress } from '../contracts/ArbOwnerPublic'; -type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; export type GetInfraFeeAccountParameters = void; export type GetInfraFeeAccountReturnType = ReadContractReturnType< - ArbOwnerPublicABI, + typeof arbOwnerPublicABI, 'getInfraFeeAccount' >; @@ -13,8 +12,8 @@ export async function getInfraFeeAccount( client: PublicClient, ): Promise { return client.readContract({ - abi: arbOwnerPublic.abi, + abi: arbOwnerPublicABI, functionName: 'getInfraFeeAccount', - address: arbOwnerPublic.address, + address: arbOwnerPublicAddress, }); } diff --git a/src/actions/getNetworkFeeAccount.ts b/src/actions/getNetworkFeeAccount.ts index 334e93ff..f6c68d56 100644 --- a/src/actions/getNetworkFeeAccount.ts +++ b/src/actions/getNetworkFeeAccount.ts @@ -1,11 +1,10 @@ import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; -import { arbOwnerPublic } from '../contracts'; +import { arbOwnerPublicABI, arbOwnerPublicAddress } from '../contracts/ArbOwnerPublic'; -type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; export type GetNetworkFeeAccountParameters = void; export type GetNetworkFeeAccountReturnType = ReadContractReturnType< - ArbOwnerPublicABI, + typeof arbOwnerPublicABI, 'getNetworkFeeAccount' >; @@ -13,8 +12,8 @@ export async function getNetworkFeeAccount( client: PublicClient, ): Promise { return client.readContract({ - abi: arbOwnerPublic.abi, + abi: arbOwnerPublicABI, functionName: 'getNetworkFeeAccount', - address: arbOwnerPublic.address, + address: arbOwnerPublicAddress, }); } diff --git a/src/actions/getScheduledUpgrade.ts b/src/actions/getScheduledUpgrade.ts index 6d634fc4..7caf7740 100644 --- a/src/actions/getScheduledUpgrade.ts +++ b/src/actions/getScheduledUpgrade.ts @@ -1,11 +1,10 @@ import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; -import { arbOwnerPublic } from '../contracts'; +import { arbOwnerPublicABI, arbOwnerPublicAddress } from '../contracts/ArbOwnerPublic'; -type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; export type GetScheduledUpgradeParameters = void; type GetScheduledUpgradeRawReturnType = ReadContractReturnType< - ArbOwnerPublicABI, + typeof arbOwnerPublicABI, 'getScheduledUpgrade' >; export type GetScheduledUpgradeReturnType = { @@ -17,9 +16,9 @@ export async function getScheduledUpgrade( client: PublicClient, ): Promise { const [arbosVersion, scheduledForTimestamp] = await client.readContract({ - abi: arbOwnerPublic.abi, + abi: arbOwnerPublicABI, functionName: 'getScheduledUpgrade', - address: arbOwnerPublic.address, + address: arbOwnerPublicAddress, }); return { arbosVersion, diff --git a/src/actions/isChainOwner.ts b/src/actions/isChainOwner.ts index aebaeadc..ea118301 100644 --- a/src/actions/isChainOwner.ts +++ b/src/actions/isChainOwner.ts @@ -1,21 +1,23 @@ import { Address, Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; -import { arbOwnerPublic } from '../contracts'; +import { arbOwnerPublicABI, arbOwnerPublicAddress } from '../contracts/ArbOwnerPublic'; -type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; export type IsChainOwnerParameters = { address: Address; }; -export type IsChainOwnerReturnType = ReadContractReturnType; +export type IsChainOwnerReturnType = ReadContractReturnType< + typeof arbOwnerPublicABI, + 'isChainOwner' +>; export async function isChainOwner( client: PublicClient, args: IsChainOwnerParameters, ): Promise { return client.readContract({ - abi: arbOwnerPublic.abi, + abi: arbOwnerPublicABI, functionName: 'isChainOwner', - address: arbOwnerPublic.address, + address: arbOwnerPublicAddress, args: [args.address], }); }