import { providers } from 'ethers'; import { Address, Logger } from '@hyperlane-xyz/utils'; /** * Returns true when the deployed contract version is already at or above the * target version. */ export declare function isValidContractVersion(currentVersion: string, targetVersion: string): boolean; export declare function isMissingSelectorCallException(error: unknown): boolean; /** * True for EVM call return/revert data with no payload ('0x' or ''). Not * isStorageEmpty, which also accepts '0x0' as an empty storage slot. */ export declare function isReturnDataEmpty(data: unknown): boolean; /** * True for an ethers CALL_EXCEPTION produced by a call that executed and * returned nothing: either ethers failed to decode an empty return (no nested * error) or the node reported an execution revert without data. * * ethers wraps every eth_call failure without revert data as a CALL_EXCEPTION * with data "0x", including transport failures (HTTP status errors, dropped * connections, JSON-RPC errors such as "header not found"). Those carry the * original error nested and must not be read as a missing selector. The * formatted message also contains data="0x" for those wrapped failures, so * the message fallback (for ethers/provider combinations that only expose * empty return data there) applies only when there is no nested error. With a * nested error, the call counts as a missing selector when the nested error * reports a revert (JSON-RPC code 3, a revert message, or Nethermind's -32015 * with revert data), or when it reports empty data ("0x" or "") and carries * neither a code nor a message. A nested error that pairs empty data with any * other code (SERVER_ERROR, 429, -32000 "header not found") or with a * non-revert message ("socket hang up", "timeout") is a transport failure. * Failures that are not reverts (out of gas, invalid opcode) are not missing * selectors. A diamond FacetNotFound() or an LSP17 * NoExtensionFoundForFunctionSelector(bytes4) revert is a missing selector. */ export declare function isMissingSelectorRevert(error: unknown): boolean; /** * True for a CALL_EXCEPTION whose revert data is a Panic(uint256). Unlike * isMissingSelectorRevert, it treats the reverting probe as an answer rather * than a failure to reach the contract. */ export declare function isPanicRevert(error: unknown): boolean; export declare function throwIfNotMissingSelector(error: unknown): void; export declare function throwIfNotMissingSelectorRevert(error: unknown): void; export declare function contractHasString(provider: providers.Provider, address: Address, searchFor: string): Promise; /** * Version reported for contracts that predate PACKAGE_VERSION (introduced in * @hyperlane-xyz/core@5.4.0); such a contract reverts the call with empty * return data (missing selector). * https://github.com/hyperlane-xyz/hyperlane-monorepo/releases/tag/%40hyperlane-xyz%2Fcore%405.4.0 */ export declare const LEGACY_PACKAGE_VERSION = "5.3.9"; /** * Reads a contract's PACKAGE_VERSION(), returning LEGACY_PACKAGE_VERSION for * pre-5.4.0 contracts (missing selector). Real RPC/provider errors propagate. */ export declare function fetchPackageVersion(provider: providers.Provider, address: Address, logger?: Logger): Promise; //# sourceMappingURL=contract.d.ts.map