{"record":{"id":"e6cacb83e621d120","repo":"FuelLabs/fuels-ts","slug":"invalid-evm-address","errorCode":"INVALID_EVM_ADDRESS","errorMessage":"Invalid Evm Address: ${evmAddress}.","messagePattern":"Invalid Evm Address: (.+?)\\.","errorType":"validation","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/address/src/address.ts","lineNumber":218,"sourceCode":"   * @throws Error - Unknown address if the format is not recognized\n   * @returns A new `Address` instance\n   *\n   * @deprecated Use `new Address` instead\n   */\n  static fromDynamicInput(address: string | Address): Address {\n    return new Address(address);\n  }\n\n  /**\n   * Takes an Evm Address and returns back an `Address`\n   *\n   * @returns A new `Address` instance\n   *\n   * @deprecated Use `new Address` instead\n   */\n  static fromEvmAddress(evmAddress: string): Address {\n    if (!isEvmAddress(evmAddress)) {\n      throw new FuelError(\n        FuelError.CODES.INVALID_EVM_ADDRESS,\n        `Invalid Evm Address: ${evmAddress}.`\n      );\n    }\n\n    return new Address(evmAddress);\n  }\n\n  /**\n   * Takes an ChecksumAddress and validates if it is a valid checksum address.\n   *\n   * @returns A `boolean` instance indicating if the address is valid.\n   */\n  static isChecksumValid(address: ChecksumAddress): boolean {\n    let addressParsed = address;\n\n    if (!address.startsWith('0x')) {\n      addressParsed = `0x${address}`;","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/address/src/address.ts#L200-L236","documentation":"Thrown by the deprecated Address.fromEvmAddress(evmAddress) static factory when isEvmAddress(evmAddress) returns false. A valid EVM address here is a 0x-prefixed 40-hex-character string (42 chars total). Other lengths or non-hex content are rejected. New code should use `new Address(evmAddress)`.","triggerScenarios":"Calling Address.fromEvmAddress() with a string that is not 42 characters, not 0x-prefixed, contains non-hex characters, or is actually a 64-char B256 address.","commonSituations":"Passing a B256 address (64 hex chars) where an EVM address (40 hex chars) was expected; missing 0x prefix; address from a checksummed-EVM context that altered casing (casing alone is fine for hex, but length errors are not); whitespace in the input.","solutions":["Supply a 0x-prefixed 40-hex-character EVM address.","If you actually have a B256 address, use new Address(b256) instead.","Trim whitespace from the input string.","Prefer `new Address(evmAddress)` over the deprecated factory."],"exampleFix":"// before\nconst a = Address.fromEvmAddress(b256Address); // wrong length\n// after\nconst a = new Address(evmAddress); // 0x + 40 hex chars","handlingStrategy":"validation","validationCode":"import { isEvmAddress } from '@fuel-ts/address/utils';\nif (!isEvmAddress(maybeEvm)) throw new Error('Not an EVM address');\nconst addr = new Address(maybeEvm);","typeGuard":"import { isEvmAddress } from '@fuel-ts/address/utils';\nconst isEvm = (s: unknown): s is string => typeof s === 'string' && isEvmAddress(s);","tryCatchPattern":null,"preventionTips":["Prefer `new Address(evmAddress)` over the deprecated fromEvmAddress.","Distinguish EVM (40 hex) from B256 (64 hex) addresses before construction.","Trim input strings."],"tags":["address","validation","evm","deprecated"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}