import { PopulatedTransaction } from 'ethers'; import { Address, ProtocolType } from '@hyperlane-xyz/utils'; import { HyperlaneModule, HyperlaneModuleParams } from '../core/AbstractHyperlaneModule.js'; import { MultiProtocolProvider } from '../providers/MultiProtocolProvider.js'; import { MultiProvider } from '../providers/MultiProvider.js'; import { AnnotatedEV5Transaction } from '../providers/ProviderType.js'; import { ChainName, DeployedOwnableConfig, OwnableConfig } from '../types.js'; import { EvmXERC20Reader, XERC20Limits, XERC20LimitsMap } from './EvmXERC20Reader.js'; import { XERC20LimitsTokenConfig, XERC20Type } from './types.js'; /** * Configuration for XERC20 limits management */ export interface XERC20ModuleConfig { type: XERC20Type; limits: XERC20LimitsMap; /** * Expected owner of the XERC20 token contract (controls limit/bridge mgmt). * On a config read this reflects the on-chain owner; on an expected config it * drives an ownership-transfer transaction when it differs. */ owner?: Address; /** * The XERC20 proxy's ProxyAdmin (controls upgrades). On a config read both * fields are populated; on an expected config only `owner` is meaningful and * `address` may be omitted. */ proxyAdmin?: DeployedOwnableConfig; } /** * Addresses managed by the XERC20 module */ export interface XERC20ModuleAddresses { xERC20: Address; warpRoute: Address; } /** * Module for managing XERC20 mint/burn limits and bridges. * Follows HyperlaneModule pattern with read() and update() methods. * Supports both Standard XERC20 (setLimits) and Velodrome XERC20 (setBufferCap/addBridge/removeBridge). */ export declare class EvmXERC20Module extends HyperlaneModule { protected readonly multiProvider: MultiProvider; protected logger: import("pino").pino.Logger; readonly reader: EvmXERC20Reader; protected readonly multiProtocolProvider: MultiProtocolProvider; readonly chainName: ChainName; constructor(multiProvider: MultiProvider, args: HyperlaneModuleParams); read(): Promise; /** * Generate transactions to update XERC20 limits to match expected config. * Detects drift and generates correction transactions. * * Ownership transfers are opt-in via `includeOwnership`. They are only emitted * by the dedicated `xerc20 apply` command, where `expectedConfig.owner` is an * intentional target for the XERC20 token's `Ownable` owner. The warp * deploy/apply path (EvmWarpModule) must NOT enable this: there the warp * config `owner` denotes the router owner, not the (often externally-governed) * XERC20 token owner, so reconciling it would emit a doomed transferOwnership. */ update(expectedConfig: XERC20ModuleConfig, { includeOwnership }?: { includeOwnership?: boolean; }): Promise; /** * Generate ownership-transfer transactions for the XERC20 token owner and the * proxy's ProxyAdmin owner. No-ops when the expected owner is unset or already * matches on-chain state, so callers can apply repeatedly (idempotent). */ protected generateOwnershipTransferTxs(expectedConfig: XERC20ModuleConfig, actualConfig: XERC20ModuleConfig): AnnotatedEV5Transaction[]; /** * Detect drift between expected and actual configurations. */ protected detectDriftFromConfigs(expected: XERC20ModuleConfig, actual: XERC20ModuleConfig): { missingBridges: Address[]; extraBridges: Address[]; limitMismatches: Array<{ bridge: Address; expected: XERC20Limits; actual: XERC20Limits; }>; }; /** * Get expected bridge addresses from config. */ protected getExpectedBridges(): Address[]; /** * Generate transactions to set limits for a bridge. */ generateSetLimitsTxs(bridge: Address, limits: XERC20Limits): Promise; /** * Generate transactions to add a bridge. * For Standard XERC20, equivalent to setLimits. * For Velodrome, uses addBridge function. */ generateAddBridgeTxs(bridge: Address, limits: XERC20Limits): Promise; /** * Generate transactions to remove a bridge (Velodrome only). */ generateRemoveBridgeTxs(bridge: Address): Promise; protected annotateTransaction(tx: PopulatedTransaction, chainId: number, to: Address): AnnotatedEV5Transaction; static fromWarpRouteConfig(multiProvider: MultiProvider, chain: ChainName, warpRouteConfig: XERC20LimitsTokenConfig & Partial, warpRouteAddress: Address): Promise<{ module: EvmXERC20Module; config: XERC20ModuleConfig; }>; } //# sourceMappingURL=EvmXERC20Module.d.ts.map