diff --git a/typescript/sdk/src/core/HyperlaneCore.ts b/typescript/sdk/src/core/HyperlaneCore.ts index 4c5c794d3e..8b1425d102 100644 --- a/typescript/sdk/src/core/HyperlaneCore.ts +++ b/typescript/sdk/src/core/HyperlaneCore.ts @@ -42,6 +42,10 @@ import { CoreFactories, coreFactories } from './contracts.js'; import { DispatchEvent } from './events.js'; import { DispatchedMessage } from './types.js'; +// If no metadata is provided, ensure we provide a default of 0x0001. +// We set to 0x0001 instead of 0x0 to ensure it does not break on zksync. +const DEFAULT_METADATA = '0x0001'; + export class HyperlaneCore extends HyperlaneApp { static fromAddressesMap( addressesMap: HyperlaneAddressesMap, @@ -94,7 +98,7 @@ export class HyperlaneCore extends HyperlaneApp { destinationId, recipient, body, - metadata || '0x0001', + metadata || DEFAULT_METADATA, hook || ethers.constants.AddressZero, ); }; @@ -159,7 +163,7 @@ export class HyperlaneCore extends HyperlaneApp { destinationDomain, recipientBytes32, body, - metadata || '0x0001', + metadata || DEFAULT_METADATA, hook || ethers.constants.AddressZero, ] as const;