From bdb065a46539b665aad97c6c90c4efb1bd6f12da Mon Sep 17 00:00:00 2001 From: pbio <10051819+paulbalaji@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:24:02 +0000 Subject: [PATCH] CR dan --- typescript/sdk/src/core/HyperlaneCore.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;