diff --git a/packages/cli/src/viem.ts b/packages/cli/src/viem.ts index 1e1b73252..4e2d9bb32 100644 --- a/packages/cli/src/viem.ts +++ b/packages/cli/src/viem.ts @@ -1,19 +1,12 @@ import { Command } from '@oclif/core' import { createPublicClient, extractChain, http, HttpTransport, PublicClient } from 'viem' import { celo, celoAlfajores } from 'viem/chains' -import { ContractAddressResolver, ViemAddressResolver } from './packages-to-be/address-resolver' -import { L2Resolver, ViemL2Resolver } from './packages-to-be/l2-resolver' import { getNodeUrl } from './utils/config' export abstract class ViemCommand extends Command { protected requireSynced = true - // Indicates if celocli running in L2 context - private cel2: boolean | null = null - private publicClient?: PublicClient - private addressResolver?: ContractAddressResolver - private l2Resolver?: L2Resolver protected async getPublicClient(): Promise> { if (!this.publicClient) { @@ -37,43 +30,13 @@ export abstract class ViemCommand extends Command { return this.publicClient } - protected async getAddressResolver(): Promise { - if (!this.addressResolver) { - this.addressResolver = new ViemAddressResolver(await this.getPublicClient()) - } - - return this.addressResolver - } - - protected async getL2Resolver(): Promise { - if (!this.l2Resolver) { - this.l2Resolver = new ViemL2Resolver(await this.getPublicClient()) - } - - return this.l2Resolver - } - protected async checkIfSynced(): Promise { return true } - protected async checkIfL2(): Promise { - const l2Resolver = await this.getL2Resolver() - - return l2Resolver.resolve() - } - protected async getNodeUrl(): Promise { const res = await this.parse() return (res.flags && res.flags.node) || getNodeUrl(this.config.configDir) } - - protected async isCel2(): Promise { - if (this.cel2 === null) { - this.cel2 = await this.checkIfL2() - } - - return !!this.cel2 - } }