import { Address } from '@hyperlane-xyz/utils'; import { ContractVerifier } from '../deploy/verify/ContractVerifier.js'; import { DerivedTokenFeeConfig, EvmTokenFeeReader } from '../fee/EvmTokenFeeReader.js'; import { CrossCollateralRoutersByDomain } from '../fee/crossCollateralUtils.js'; import { EvmHookReader } from '../hook/EvmHookReader.js'; import { EvmIsmReader } from '../ism/EvmIsmReader.js'; import { MultiProvider } from '../providers/MultiProvider.js'; import { EvmRouterReader } from '../router/EvmRouterReader.js'; import { DestinationGas } from '../router/types.js'; import { ChainName, ChainNameOrId, DeployedOwnableConfig } from '../types.js'; import { NormalizedScale } from '../utils/decimals.js'; import { TokenType } from './config.js'; import { ContractVerificationStatus, DerivedTokenRouterConfig, HypTokenConfig, HypTokenRouterVirtualConfig, OwnerStatus, TokenMetadata, XERC20TokenMetadata } from './types.js'; export declare const TOKEN_FEE_CONTRACT_VERSION = "10.0.0"; export declare const CCTP_PPM_STORAGE_VERSION = "10.2.0"; export declare const CCTP_PPM_PRECISION_VERSION = "11.0.0"; export declare class EvmWarpRouteReader extends EvmRouterReader { protected readonly multiProvider: MultiProvider; protected readonly chain: ChainNameOrId; protected readonly concurrency: number; protected readonly logger: import("pino").pino.Logger; private readonly depositAddressDomainConfigsCache; protected readonly deriveTokenConfigMap: Record Promise) | null>; evmHookReader: EvmHookReader; evmIsmReader: EvmIsmReader; evmTokenFeeReader: EvmTokenFeeReader; contractVerifier: ContractVerifier; constructor(multiProvider: MultiProvider, chain: ChainNameOrId, concurrency?: number, contractVerifier?: ContractVerifier); /** * Derives the configuration for a Hyperlane warp route token router contract at the given address. * * @param warpRouteAddress - The address of the Hyperlane warp route token router contract. * @returns The configuration for the Hyperlane warp route token router. * */ deriveWarpRouteConfig(warpRouteAddress: Address): Promise; /** * Searches the derived hook tree for a PredicateRouterWrapper and, if found, * reads its on-chain config (registry, policyId, owner). * * EvmHookReader.preserveUnredeployable() stores PREDICATE sub-hooks as bare address * strings (to survive normalizeConfig and deploy's string branch). The sync * findPredicateAddressInHook() returns undefined for bare strings, so we fall back to * an on-chain hookType() probe on bare string sub-hooks of aggregation hooks. */ private derivePredicateWrapperConfig; private findPredicateAddressInHook; fetchFeeHook(routerAddress: Address): Promise
; private remoteRoutersToRouterKeys; fetchTokenFee(routerAddress: Address, destinations?: number[], crossCollateralRouters?: CrossCollateralRoutersByDomain): Promise; getContractVerificationStatus(chain: ChainName, address: Address): Promise>; getOwnerStatus(chain: ChainName, address: Address): Promise>; deriveWarpRouteVirtualConfig(chain: ChainName, address: Address): Promise; /** * Fetches the bytecode of the contract's implementation. * Read the EIP-1967 impl slot directly so UUPS proxies (which have * an empty admin slot) are resolved correctly alongside TransparentProxy. * EIP-1167 minimal proxies are resolved from their runtime code. A clone * whose target is itself an EIP-1967 proxy or another clone returns the * target's own code without resolving further, so the selector guard can * read false for a selector the final implementation has. * * Returns '0x' when the address has no code (EOAs / bad addresses) so * selector guards fall through to the probes, and undefined when the * bytecode cannot be determined: a failed RPC read, or a beacon proxy whose * implementation lives behind the beacon. Proxies that route through a * diamond facet table or LSP17 extensions are not resolved; their own * bytecode is returned, which does not contain the routed selectors. */ private fetchImplementationBytecode; private readonly implementationBytecodeCache; private fetchImplementationBytecodeCached; private implementationSelectorStatus; /** * Checks whether the implementation bytecode contains the selector. * Returns undefined when the bytecode is empty/unreadable or is unresolved * forwarding code, so callers proceed with the call and its normal error * handling. */ private implementationHasSelector; /** * Derives the token type for a given Warp Route address using specific methods * * @param warpRouteAddress - The Warp Route address to derive the token type for. * @returns The derived token type, which can be one of: collateralVault, collateral, native, or synthetic. */ deriveTokenType(warpRouteAddress: Address): Promise; private isNativeWarpToken; private isSyntheticWarpToken; fetchXERC20Config(xERC20Address: Address, warpRouteAddress: Address): Promise; /** * Fetches the metadata for a token address. * * @param warpRouteAddress - The address of the token. * @returns A partial ERC20 metadata object containing the token name, symbol, total supply, and decimals. * Throws if unsupported token type */ fetchTokenConfig(type: TokenType, warpRouteAddress: Address): Promise; private deriveHypXERC20TokenConfig; private deriveHypXERC20LockboxTokenConfig; private deriveHypCollateralCctpTokenConfig; private deriveHypCollateralDepositAddressTokenConfig; private deriveHypCollateralOftTokenConfig; private deriveAtomicLocalRebalancingBridgeTokenConfig; private deriveHypCollateralTokenConfig; private deriveHypCollateralFiatTokenConfig; private deriveHypCollateralVaultTokenConfig; private deriveHypCollateralVaultRebaseTokenConfig; private deriveHypSyntheticTokenConfig; private deriveHypNativeTokenConfig; private deriveOpL2TokenConfig; private deriveOpL1TokenConfig; private deriveHypSyntheticRebaseConfig; private deriveEverclearBaseBridgeConfig; private deriveEverclearEthTokenBridgeConfig; private deriveEverclearCollateralTokenBridgeConfig; /** * Derives the configuration for a CrossCollateralRouter router. */ private deriveCrossCollateralTokenConfig; fetchERC20Metadata(tokenAddress: Address): Promise; /** * Fetches the scale configuration from a TokenRouter contract. * Handles version compatibility based on contract version - reads scaleNumerator/scaleDenominator * for contracts >= 11.0.0, otherwise reads legacy scale value. * * @param tokenRouterAddress - The address of the TokenRouter contract. * @returns The scale as a NormalizedScale, or undefined when the scale is the identity (1/1). */ fetchScale(tokenRouterAddress: Address): Promise; fetchPackageVersion(address: Address): Promise; fetchProxyAdminConfig(tokenAddress: Address): Promise; fetchDestinationGas(warpRouteAddress: Address, additionalDomains?: number[]): Promise; } //# sourceMappingURL=EvmWarpRouteReader.d.ts.map