@hyperlane-xyz/cli 32.0.1 → 33.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/index.js CHANGED
@@ -403761,7 +403761,7 @@ async function __wbg_init(module_or_path, memory) {
403761
403761
  return __wbg_finalize_init(instance, module, thread_stack_size);
403762
403762
  }
403763
403763
 
403764
- const module$1 = __nccwpck_require__.ab + "aleo_wasm.wasm";
403764
+ const module$1 = __nccwpck_require__.ab + "aleo_wasm1.wasm";
403765
403765
 
403766
403766
  await __wbg_init({ module_or_path: pathToFileURL(module$1).href });
403767
403767
 
@@ -403772,7 +403772,7 @@ async function initThreadPool(threads) {
403772
403772
 
403773
403773
  console.info(`Spawning ${threads} threads`);
403774
403774
 
403775
- await initThreadPool$1(__nccwpck_require__.ab + "worker2.js", threads);
403775
+ await initThreadPool$1(__nccwpck_require__.ab + "worker3.js", threads);
403776
403776
  }
403777
403777
 
403778
403778
 
@@ -417892,7 +417892,7 @@ async function __wbg_init(module_or_path, memory) {
417892
417892
  return __wbg_finalize_init(instance, module, thread_stack_size);
417893
417893
  }
417894
417894
 
417895
- const module$1 = __nccwpck_require__.ab + "aleo_wasm1.wasm";
417895
+ const module$1 = __nccwpck_require__.ab + "aleo_wasm.wasm";
417896
417896
 
417897
417897
  await __wbg_init({ module_or_path: pathToFileURL(module$1).href });
417898
417898
 
@@ -417903,7 +417903,7 @@ async function initThreadPool(threads) {
417903
417903
 
417904
417904
  console.info(`Spawning ${threads} threads`);
417905
417905
 
417906
- await initThreadPool$1(__nccwpck_require__.ab + "worker3.js", threads);
417906
+ await initThreadPool$1(__nccwpck_require__.ab + "worker2.js", threads);
417907
417907
  }
417908
417908
 
417909
417909
 
@@ -563010,6 +563010,8 @@ __nccwpck_require__.d(__webpack_exports__, {
563010
563010
  INf: () => (/* reexport */ PackageVersioned__factory),
563011
563011
  h7E: () => (/* reexport */ PausableHook__factory),
563012
563012
  fiP: () => (/* reexport */ PausableIsm__factory),
563013
+ TsJ: () => (/* reexport */ PredicateCrossCollateralRouterWrapper__factory),
563014
+ sYb: () => (/* reexport */ PredicateRouterWrapper__factory),
563013
563015
  ETb: () => (/* reexport */ ProgressiveFee__factory),
563014
563016
  teD: () => (/* reexport */ ProtocolFee__factory),
563015
563017
  Aig: () => (/* reexport */ ProxyAdmin__factory),
@@ -563045,7 +563047,7 @@ __nccwpck_require__.d(__webpack_exports__, {
563045
563047
  ze0: () => (/* reexport */ loadAllZKSyncArtifacts)
563046
563048
  });
563047
563049
 
563048
- // UNUSED EXPORTS: AbstractAggregationIsm__factory, AbstractDomainRoutingIsmFactory__factory, AbstractInterchainAccountRouter__factory, AbstractMerkleRootMultisigIsm__factory, AbstractMessageIdAuthHook__factory, AbstractMessageIdMultisigIsm__factory, AbstractMetaProxyMultisigIsm__factory, AbstractMetaProxyWeightedMultisigIsm__factory, AbstractMultisigIsm__factory, AbstractMultisig__factory, AbstractOffchainQuoter__factory, AbstractPostDispatchHook__factory, AbstractPredicateWrapper__factory, AbstractStaticWeightedMultisigIsm__factory, AccessControl__factory, AmountPartition__factory, AttributeCheckpointFraud__factory, CCIPReceiver__factory, CctpMessageV1__factory, CctpService__factory, CheckpointFraudProofs__factory, Client__factory, CommitmentReadIsmService__factory, CommitmentReadIsm__factory, ContextUpgradeable__factory, DestinationRecipientRoutingHook__factory, ECDSAServiceManagerBase__factory, ECDSAStakeRegistryStorage__factory, ERC165Upgradeable__factory, ERC165__factory, ERC1967Proxy__factory, ERC1967Upgrade__factory, ERC20Test__factory, ERC20Upgradeable__factory, ERC4626Test__factory, ERC4626Upgradeable__factory, ERC5164Hook__factory, ERC5164Ism__factory, ERC721EnumerableUpgradeable__factory, ERC721Test__factory, ERC721URIStorageUpgradeable__factory, ERC721Upgradeable__factory, ERC721__factory, EnumerableDomainSet__factory, EnumerableMapEnrollment__factory, EverclearBridge__factory, FalseReturningERC20Mock__factory, FiatTokenTest__factory, HyperlaneServiceManager__factory, IAVSDirectory__factory, IAccessControl__factory, IAllowanceTransfer__factory, IAny2EVMMessageReceiver__factory, IBeacon__factory, IBridge__factory, ICcipReadIsm__factory, ICrossCollateralFee__factory, ICrossCollateralRouter__factory, ICrossDomainMessenger__factory, IECDSAStakeRegistryEventsAndErrors__factory, IEIP712__factory, IERC1155Receiver__factory, IERC1271Upgradeable__factory, IERC165Upgradeable__factory, IERC165__factory, IERC1822Proxiable__factory, IERC1967__factory, IERC20MetadataUpgradeable__factory, IERC20Metadata__factory, IERC20PermitUpgradeable__factory, IERC20Permit__factory, IERC20Upgradeable__factory, IERC4626Upgradeable__factory, IERC4906Upgradeable__factory, IERC721EnumerableUpgradeable__factory, IERC721Enumerable__factory, IERC721MetadataUpgradeable__factory, IERC721Metadata__factory, IERC721ReceiverUpgradeable__factory, IERC721Receiver__factory, IERC721Upgradeable__factory, IERC721__factory, IEnumerableDomains__factory, IEverclearAdapter__factory, IEverclearSpoke__factory, IGasOracle__factory, IInterchainAccountRouter__factory, IInterchainGasPaymaster__factory, IL2CrossDomainMessenger__factory, IL2ToL1MessagePasser__factory, IMailbox__factory, IMessageDispatcher__factory, IMessageHandlerV2__factory, IMessageHandler__factory, IMessageTransmitterV2__factory, IOFT__factory, IOffchainQuoter__factory, IOptimismPortal2__factory, IOptimismPortal__factory, IOwnable__factory, IOwnerManager__factory, IPaymentCoordinator__factory, IPredicateClient__factory, IPredicateRegistry__factory, IPredicateWrapper__factory, IReceiverV2__factory, IReceiver__factory, IRelayerV2__factory, IRelayer__factory, IRemoteChallenger__factory, IRouterClient__factory, IRouter__factory, IRoutingHook__factory, IServiceManagerUI__factory, IServiceManager__factory, ISlasher__factory, ISpecifiesInterchainSecurityModule__factory, IStandardBridge__factory, IStaticWeightedMultisigIsm__factory, IStrategy__factory, IThresholdAddressFactory__factory, ITokenFee__factory, ITokenMessengerV1__factory, ITokenMessengerV2__factory, ITokenMessenger__factory, ITransparentUpgradeableProxy__factory, IValidatorAnnounce__factory, Indexed__factory, Initializable__factory, InterchainQueryRouter__factory, LightTestRecipient__factory, LpCollateralRouter__factory, MockArbBridge__factory, MockArbSys__factory, MockCircleMessageTransmitter__factory, MockCircleTokenMessenger__factory, MockERC4626YieldSharing__factory, MockEverclearAdapter__factory, MockHyperlaneEnvironment__factory, MockL2ToL1MessagePasser__factory, MockMailbox__factory, MockMessageDispatcher__factory, MockMessageExecutor__factory, MockOptimismMessenger__factory, MockOptimismPortal__factory, MockOptimismStandardBridge__factory, MockPredicateRegistry__factory, MockSafe__factory, MockToken__factory, MockValueTransferBridge__factory, MockWETH__factory, NonCompliantERC20Test__factory, NoopIsm__factory, OPL2ToL1CcipReadIsm__factory, OPL2ToL1Hook__factory, OPL2ToL1V1CcipReadIsm__factory, OPL2ToL1V2CcipReadIsm__factory, OffchainQuotedIGP__factory, OpL1V2NativeTokenBridge__factory, OpL2toL1Service__factory, OpTokenBridgeStorage__factory, Ownable2StepUpgradeable__factory, OwnableMulticall__factory, OwnableUpgradeable__factory, Pausable__factory, PredicateClient__factory, PredicateCrossCollateralRouterWrapper__factory, PredicateRouterWrapper__factory, Proxy__factory, RateLimitedHook__factory, RateLimitedIsm__factory, RateLimited__factory, ReentrancyGuardTransient__factory, SafeERC20Harness__factory, StandardHookMetadata__factory, StaticAddressSetFactory__factory, StaticMerkleRootMultisigIsm__factory, StaticMerkleRootWeightedMultisigIsm__factory, StaticMessageIdMultisigIsm__factory, StaticMessageIdWeightedMultisigIsm__factory, StaticThresholdAddressSetFactory__factory, StaticWeightedValidatorSetFactory__factory, StorageAggregationIsmFactory__factory, StorageMerkleRootMultisigIsmFactory__factory, StorageMessageIdMultisigIsmFactory__factory, StorageMultisigIsmFactory__factory, TestCcipReadIsm__factory, TestDelegationManager__factory, TestGasRouter__factory, TestHyperlaneServiceManager__factory, TestInterchainGasPaymaster__factory, TestLpCollateralRouter__factory, TestMailbox__factory, TestMerkleTreeHook__factory, TestMerkle__factory, TestMessage__factory, TestPaymentCoordinator__factory, TestPostDispatchHook__factory, TestQuerySender__factory, TestQuery__factory, TestRemoteChallenger__factory, TestRouter__factory, TestSendReceiver__factory, TestSlasher__factory, TestStorage__factory, TimelockRouter__factory, TokenBridgeCctpBaseStorage__factory, TronUSDTMock__factory, TypedMemView__factory, Versioned__factory, WHypERC4626__factory, XERC20LockboxTest__factory, XERC20Test__factory, XERC20VSTest__factory, buildArtifact, factories, getZKSyncArtifactByName, zkSyncContractArtifacts
563050
+ // UNUSED EXPORTS: AbstractAggregationIsm__factory, AbstractDomainRoutingIsmFactory__factory, AbstractInterchainAccountRouter__factory, AbstractMerkleRootMultisigIsm__factory, AbstractMessageIdAuthHook__factory, AbstractMessageIdMultisigIsm__factory, AbstractMetaProxyMultisigIsm__factory, AbstractMetaProxyWeightedMultisigIsm__factory, AbstractMultisigIsm__factory, AbstractMultisig__factory, AbstractOffchainQuoter__factory, AbstractPostDispatchHook__factory, AbstractPredicateWrapper__factory, AbstractStaticWeightedMultisigIsm__factory, AccessControl__factory, AmountPartition__factory, AttributeCheckpointFraud__factory, CCIPReceiver__factory, CctpMessageV1__factory, CctpService__factory, CheckpointFraudProofs__factory, Client__factory, CommitmentReadIsmService__factory, CommitmentReadIsm__factory, ContextUpgradeable__factory, DestinationRecipientRoutingHook__factory, ECDSAServiceManagerBase__factory, ECDSAStakeRegistryStorage__factory, ERC165Upgradeable__factory, ERC165__factory, ERC1967Proxy__factory, ERC1967Upgrade__factory, ERC20Test__factory, ERC20Upgradeable__factory, ERC4626Test__factory, ERC4626Upgradeable__factory, ERC5164Hook__factory, ERC5164Ism__factory, ERC721EnumerableUpgradeable__factory, ERC721Test__factory, ERC721URIStorageUpgradeable__factory, ERC721Upgradeable__factory, ERC721__factory, EnumerableDomainSet__factory, EnumerableMapEnrollment__factory, EverclearBridge__factory, FalseReturningERC20Mock__factory, FiatTokenTest__factory, HyperlaneServiceManager__factory, IAVSDirectory__factory, IAccessControl__factory, IAllowanceTransfer__factory, IAny2EVMMessageReceiver__factory, IBeacon__factory, IBridge__factory, ICcipReadIsm__factory, ICrossCollateralFee__factory, ICrossCollateralRouter__factory, ICrossDomainMessenger__factory, IECDSAStakeRegistryEventsAndErrors__factory, IEIP712__factory, IERC1155Receiver__factory, IERC1271Upgradeable__factory, IERC165Upgradeable__factory, IERC165__factory, IERC1822Proxiable__factory, IERC1967__factory, IERC20MetadataUpgradeable__factory, IERC20Metadata__factory, IERC20PermitUpgradeable__factory, IERC20Permit__factory, IERC20Upgradeable__factory, IERC4626Upgradeable__factory, IERC4906Upgradeable__factory, IERC721EnumerableUpgradeable__factory, IERC721Enumerable__factory, IERC721MetadataUpgradeable__factory, IERC721Metadata__factory, IERC721ReceiverUpgradeable__factory, IERC721Receiver__factory, IERC721Upgradeable__factory, IERC721__factory, IEnumerableDomains__factory, IEverclearAdapter__factory, IEverclearSpoke__factory, IGasOracle__factory, IInterchainAccountRouter__factory, IInterchainGasPaymaster__factory, IL2CrossDomainMessenger__factory, IL2ToL1MessagePasser__factory, IMailbox__factory, IMessageDispatcher__factory, IMessageHandlerV2__factory, IMessageHandler__factory, IMessageTransmitterV2__factory, IOFT__factory, IOffchainQuoter__factory, IOptimismPortal2__factory, IOptimismPortal__factory, IOwnable__factory, IOwnerManager__factory, IPaymentCoordinator__factory, IPredicateClient__factory, IPredicateRegistry__factory, IPredicateWrapper__factory, IReceiverV2__factory, IReceiver__factory, IRelayerV2__factory, IRelayer__factory, IRemoteChallenger__factory, IRouterClient__factory, IRouter__factory, IRoutingHook__factory, IServiceManagerUI__factory, IServiceManager__factory, ISlasher__factory, ISpecifiesInterchainSecurityModule__factory, IStandardBridge__factory, IStaticWeightedMultisigIsm__factory, IStrategy__factory, IThresholdAddressFactory__factory, ITokenFee__factory, ITokenMessengerV1__factory, ITokenMessengerV2__factory, ITokenMessenger__factory, ITransparentUpgradeableProxy__factory, IValidatorAnnounce__factory, Indexed__factory, Initializable__factory, InterchainQueryRouter__factory, LightTestRecipient__factory, LpCollateralRouter__factory, MockArbBridge__factory, MockArbSys__factory, MockCircleMessageTransmitter__factory, MockCircleTokenMessenger__factory, MockERC4626YieldSharing__factory, MockEverclearAdapter__factory, MockHyperlaneEnvironment__factory, MockL2ToL1MessagePasser__factory, MockMailbox__factory, MockMessageDispatcher__factory, MockMessageExecutor__factory, MockOptimismMessenger__factory, MockOptimismPortal__factory, MockOptimismStandardBridge__factory, MockPredicateRegistry__factory, MockSafe__factory, MockToken__factory, MockValueTransferBridge__factory, MockWETH__factory, NonCompliantERC20Test__factory, NoopIsm__factory, OPL2ToL1CcipReadIsm__factory, OPL2ToL1Hook__factory, OPL2ToL1V1CcipReadIsm__factory, OPL2ToL1V2CcipReadIsm__factory, OffchainQuotedIGP__factory, OpL1V2NativeTokenBridge__factory, OpL2toL1Service__factory, OpTokenBridgeStorage__factory, Ownable2StepUpgradeable__factory, OwnableMulticall__factory, OwnableUpgradeable__factory, Pausable__factory, PredicateClient__factory, Proxy__factory, RateLimitedHook__factory, RateLimitedIsm__factory, RateLimited__factory, ReentrancyGuardTransient__factory, SafeERC20Harness__factory, StandardHookMetadata__factory, StaticAddressSetFactory__factory, StaticMerkleRootMultisigIsm__factory, StaticMerkleRootWeightedMultisigIsm__factory, StaticMessageIdMultisigIsm__factory, StaticMessageIdWeightedMultisigIsm__factory, StaticThresholdAddressSetFactory__factory, StaticWeightedValidatorSetFactory__factory, StorageAggregationIsmFactory__factory, StorageMerkleRootMultisigIsmFactory__factory, StorageMessageIdMultisigIsmFactory__factory, StorageMultisigIsmFactory__factory, TestCcipReadIsm__factory, TestDelegationManager__factory, TestGasRouter__factory, TestHyperlaneServiceManager__factory, TestInterchainGasPaymaster__factory, TestLpCollateralRouter__factory, TestMailbox__factory, TestMerkleTreeHook__factory, TestMerkle__factory, TestMessage__factory, TestPaymentCoordinator__factory, TestPostDispatchHook__factory, TestQuerySender__factory, TestQuery__factory, TestRemoteChallenger__factory, TestRouter__factory, TestSendReceiver__factory, TestSlasher__factory, TestStorage__factory, TimelockRouter__factory, TokenBridgeCctpBaseStorage__factory, TronUSDTMock__factory, TypedMemView__factory, Versioned__factory, WHypERC4626__factory, XERC20LockboxTest__factory, XERC20Test__factory, XERC20VSTest__factory, buildArtifact, factories, getZKSyncArtifactByName, zkSyncContractArtifacts
563049
563051
 
563050
563052
  ;// CONCATENATED MODULE: ../../solidity/dist/typechain/factories/@arbitrum/nitro-contracts/src/bridge/IBridge__factory.js
563051
563053
  /* Autogenerated file. Do not edit manually. */
@@ -679512,6 +679514,22 @@ const send = {
679512
679514
  description: 'Skip transfer validation (e.g., collateral checks)',
679513
679515
  default: false,
679514
679516
  },
679517
+ 'predicate-api-key': {
679518
+ type: 'string',
679519
+ description: 'Predicate API key for fetching attestations automatically',
679520
+ default: process.env.PREDICATE_API_KEY,
679521
+ conflicts: 'attestation',
679522
+ },
679523
+ 'predicate-api-url': {
679524
+ type: 'string',
679525
+ description: 'Predicate API base URL (overrides default; useful for testing)',
679526
+ default: process.env.PREDICATE_API_URL,
679527
+ implies: 'predicate-api-key',
679528
+ },
679529
+ attestation: {
679530
+ type: 'string',
679531
+ description: 'Pre-obtained Predicate attestation (JSON string)',
679532
+ },
679515
679533
  'source-token': {
679516
679534
  type: 'string',
679517
679535
  description: 'Source token router address (for CrossCollateralRouter routes)',
@@ -679531,7 +679549,7 @@ const send = {
679531
679549
  default: process.env.FEE_QUOTING_API_KEY,
679532
679550
  },
679533
679551
  },
679534
- handler: async ({ context, origin, destination, timeout, quick, relay, warpRouteId, amount, recipient, roundTrip, chains: chainsArg, skipValidation, sourceToken, destinationToken, feeQuotingUrl, feeQuotingApiKey, }) => {
679552
+ handler: async ({ context, origin, destination, timeout, quick, relay, symbol: _symbol, warp: _warp, warpRouteId, amount, recipient, roundTrip, chains: chainsArg, skipValidation, predicateApiKey, predicateApiUrl, attestation, sourceToken, destinationToken, feeQuotingUrl, feeQuotingApiKey, }) => {
679535
679553
  const filterChains = [origin, destination, ...(chainsArg || [])]
679536
679554
  .filter((v) => Boolean(v))
679537
679555
  .filter((v, i, a) => a.indexOf(v) === i);
@@ -679584,6 +679602,9 @@ const send = {
679584
679602
  skipWaitForDelivery: quick,
679585
679603
  selfRelay: relay,
679586
679604
  skipValidation,
679605
+ predicateApiKey,
679606
+ predicateApiUrl,
679607
+ attestation,
679587
679608
  sourceToken,
679588
679609
  destinationToken,
679589
679610
  feeQuotingUrl,
@@ -685253,30 +685274,35 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
685253
685274
  /* harmony export */ });
685254
685275
  /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(77598);
685255
685276
  /* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(10684);
685256
- /* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(71280);
685257
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(25047);
685258
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(32772);
685259
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(9035);
685260
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(14372);
685261
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(2911);
685262
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(35835);
685263
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(32242);
685264
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(95778);
685265
- /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(71598);
685266
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(16639);
685267
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(21387);
685268
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(14918);
685269
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(73938);
685270
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(93142);
685271
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(78160);
685272
- /* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(46913);
685273
- /* harmony import */ var _deploy_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(62356);
685274
- /* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(54321);
685275
- /* harmony import */ var _utils_files_js__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(17468);
685276
- /* harmony import */ var _utils_relay_js__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(92941);
685277
- /* harmony import */ var _utils_tokens_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(32853);
685278
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_deploy_utils_js__WEBPACK_IMPORTED_MODULE_4__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_6__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_15__]);
685279
- ([_deploy_utils_js__WEBPACK_IMPORTED_MODULE_4__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_6__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
685277
+ /* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(50653);
685278
+ /* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(71280);
685279
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(25047);
685280
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(41339);
685281
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(32772);
685282
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(9035);
685283
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(95176);
685284
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(89155);
685285
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(14372);
685286
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(2911);
685287
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(35835);
685288
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(32242);
685289
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(95778);
685290
+ /* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(71598);
685291
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(16639);
685292
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(21387);
685293
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(14918);
685294
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(73938);
685295
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(93142);
685296
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_27__ = __nccwpck_require__(78160);
685297
+ /* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(46913);
685298
+ /* harmony import */ var _deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(62356);
685299
+ /* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(54321);
685300
+ /* harmony import */ var _utils_files_js__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(17468);
685301
+ /* harmony import */ var _utils_relay_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(92941);
685302
+ /* harmony import */ var _utils_tokens_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(32853);
685303
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_7__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_19__]);
685304
+ ([_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_7__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_19__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
685305
+
685280
685306
 
685281
685307
 
685282
685308
 
@@ -685292,13 +685318,13 @@ const WarpSendLogs = {
685292
685318
  SUCCESS: 'Transfer was self-relayed!',
685293
685319
  };
685294
685320
  const SUPPORTED_PROTOCOLS = new Set([
685295
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Ethereum,
685296
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Tron,
685297
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Sealevel,
685298
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Cosmos,
685299
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.CosmosNative,
685300
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Starknet,
685301
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Radix,
685321
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Ethereum,
685322
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Tron,
685323
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Sealevel,
685324
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Cosmos,
685325
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.CosmosNative,
685326
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Starknet,
685327
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Radix,
685302
685328
  ]);
685303
685329
  const EXPLORER_GRAPHQL_URL = process.env.HYPERLANE_EXPLORER_GRAPHQL_URL ??
685304
685330
  process.env.EXPLORER_GRAPHQL_URL ??
@@ -685310,13 +685336,13 @@ function isAnnotatedTx(value) {
685310
685336
  }
685311
685337
  function toTypedAltVmReceipt(providerType, receipt) {
685312
685338
  switch (providerType) {
685313
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.SolanaWeb3:
685314
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.CosmJs:
685315
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.CosmJsWasm:
685316
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.CosmJsNative:
685317
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.Starknet:
685318
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.Radix:
685319
- case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.Aleo:
685339
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.SolanaWeb3:
685340
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.CosmJs:
685341
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.CosmJsWasm:
685342
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.CosmJsNative:
685343
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.Starknet:
685344
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.Radix:
685345
+ case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.Aleo:
685320
685346
  // CAST: Provider SDK receipts are the correct protocol-specific shape at runtime,
685321
685347
  // but TxReceipt is typed as { [key: string]: any } so the union cast is unavoidable.
685322
685348
  return {
@@ -685327,9 +685353,9 @@ function toTypedAltVmReceipt(providerType, receipt) {
685327
685353
  throw new Error(`Unsupported provider type for non-EVM transfer execution: ${providerType}`);
685328
685354
  }
685329
685355
  }
685330
- async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recipient, timeoutSec, skipWaitForDelivery, selfRelay, skipValidation, sourceToken, destinationToken, feeQuotingUrl, feeQuotingApiKey, }) {
685356
+ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recipient, timeoutSec, skipWaitForDelivery, selfRelay, skipValidation, predicateApiKey, predicateApiUrl, attestation, sourceToken, destinationToken, feeQuotingUrl, feeQuotingApiKey, }) {
685331
685357
  const { multiProvider } = context;
685332
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .assert */ .v)(chains.length >= 2, 'At least two chains are required to send a warp transfer');
685358
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(chains.length >= 2, 'At least two chains are required to send a warp transfer');
685333
685359
  const unsupportedChains = chains.filter((chain) => !SUPPORTED_PROTOCOLS.has(multiProvider.getProtocol(chain)));
685334
685360
  if (unsupportedChains.length > 0) {
685335
685361
  const chainDetails = unsupportedChains
@@ -685342,7 +685368,7 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685342
685368
  for (let i = 0; i < chains.length - 1; i++) {
685343
685369
  const hopDest = chains[i + 1];
685344
685370
  if (i < chains.length - 2 &&
685345
- !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(multiProvider.getProtocol(hopDest))) {
685371
+ !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(multiProvider.getProtocol(hopDest))) {
685346
685372
  throw new Error(`Non-EVM chain '${hopDest}' cannot be an intermediate hop. ` +
685347
685373
  `Non-EVM chains are only supported as the final destination.`);
685348
685374
  }
@@ -685351,7 +685377,7 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685351
685377
  const normalizedRecipient = recipient && recipient.trim().length > 0 ? recipient.trim() : undefined;
685352
685378
  // Validate once up front to avoid partial multi-hop sends before failing.
685353
685379
  if (!normalizedRecipient &&
685354
- !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(multiProvider.getProtocol(finalDestination))) {
685380
+ !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(multiProvider.getProtocol(finalDestination))) {
685355
685381
  throw new Error(`Recipient address is required when sending to non-EVM destination '${finalDestination}'`);
685356
685382
  }
685357
685383
  // Only preflight-check chains where we have signers (hop origins + EVM
@@ -685362,13 +685388,29 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685362
685388
  if (i < chains.length - 1)
685363
685389
  return true;
685364
685390
  // Final destination only needs a signer for EVM self-relay
685365
- return selfRelay && (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(multiProvider.getProtocol(chain));
685391
+ return selfRelay && (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(multiProvider.getProtocol(chain));
685366
685392
  });
685393
+ // Parse attestation if provided as JSON string
685394
+ let parsedAttestation;
685395
+ if (attestation || predicateApiKey) {
685396
+ if (chains.length > 2) {
685397
+ throw new Error('Predicate attestations are not supported for multi-hop routes. ' +
685398
+ 'Provide a single origin and destination chain.');
685399
+ }
685400
+ if (attestation) {
685401
+ try {
685402
+ parsedAttestation = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__/* .PredicateAttestationSchema */ .D.parse(JSON.parse(attestation));
685403
+ }
685404
+ catch (e) {
685405
+ throw new Error(`Invalid attestation JSON: ${e}`);
685406
+ }
685407
+ }
685408
+ }
685367
685409
  if (signerChains.length > 0) {
685368
- await (0,_deploy_utils_js__WEBPACK_IMPORTED_MODULE_4__/* .runPreflightChecksForChains */ .DF)({
685410
+ await (0,_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__/* .runPreflightChecksForChains */ .DF)({
685369
685411
  context,
685370
685412
  chains: signerChains,
685371
- minGas: _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__/* .GasAction */ .Y1.TEST_SEND_GAS,
685413
+ minGas: _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .GasAction */ .Y1.TEST_SEND_GAS,
685372
685414
  });
685373
685415
  }
685374
685416
  for (let i = 0; i < chains.length; i++) {
@@ -685376,8 +685418,8 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685376
685418
  const destination = chains[i + 1];
685377
685419
  if (destination) {
685378
685420
  const recipientForHop = i === chains.length - 2 ? normalizedRecipient : undefined;
685379
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Sending a message from ${origin} to ${destination}`);
685380
- await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .timeout */ .wR)(executeDelivery({
685421
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Sending a message from ${origin} to ${destination}`);
685422
+ await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .timeout */ .wR)(executeDelivery({
685381
685423
  context,
685382
685424
  origin,
685383
685425
  destination,
@@ -685387,6 +685429,9 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685387
685429
  skipWaitForDelivery,
685388
685430
  selfRelay,
685389
685431
  skipValidation,
685432
+ predicateApiKey,
685433
+ predicateApiUrl,
685434
+ attestation: parsedAttestation,
685390
685435
  timeoutSec,
685391
685436
  sourceToken: i === 0 ? sourceToken : undefined,
685392
685437
  destinationToken: i === chains.length - 2 ? destinationToken : undefined,
@@ -685396,116 +685441,213 @@ async function sendTestTransfer({ context, warpCoreConfig, chains, amount, recip
685396
685441
  }
685397
685442
  }
685398
685443
  }
685399
- async function executeDelivery({ context, origin, destination, warpCoreConfig, amount, recipient, skipWaitForDelivery, selfRelay, skipValidation, timeoutSec, sourceToken: sourceTokenAddr, destinationToken: destTokenAddr, feeQuotingUrl, feeQuotingApiKey, }) {
685444
+ async function executeDelivery({ context, origin, destination, warpCoreConfig, amount, recipient, skipWaitForDelivery, selfRelay, skipValidation, predicateApiKey, predicateApiUrl, attestation, timeoutSec, sourceToken: sourceTokenAddr, destinationToken: destTokenAddr, feeQuotingUrl, feeQuotingApiKey, }) {
685400
685445
  const { multiProvider, registry, altVmSigners, multiProtocolProvider } = context;
685401
685446
  const originProtocol = multiProvider.getProtocol(origin);
685402
685447
  const destinationProtocol = multiProvider.getProtocol(destination);
685403
- const signerAddress = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(originProtocol)
685448
+ const signerAddress = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(originProtocol)
685404
685449
  ? await multiProvider.getSigner(origin).getAddress()
685405
- : (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .mustGet */ .Qd)(altVmSigners, origin).getSignerAddress();
685450
+ : (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__/* .mustGet */ .Qd)(altVmSigners, origin).getSignerAddress();
685406
685451
  const normalizedRecipient = recipient && recipient.trim().length > 0 ? recipient.trim() : undefined;
685407
- if (!normalizedRecipient && !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(destinationProtocol)) {
685452
+ if (!normalizedRecipient && !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(destinationProtocol)) {
685408
685453
  throw new Error(`Recipient address is required when sending to non-EVM destination '${destination}'`);
685409
685454
  }
685410
685455
  const recipientAddress = normalizedRecipient ??
685411
685456
  (await multiProvider.getSigner(destination).getAddress());
685412
685457
  if (!normalizedRecipient) {
685413
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`No recipient specified, defaulting to: ${recipientAddress}`);
685458
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`No recipient specified, defaulting to: ${recipientAddress}`);
685414
685459
  }
685415
685460
  const chainAddresses = await registry.getAddresses();
685416
- const mailboxes = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .objMap */ .Yp)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .objFilter */ .s3)(chainAddresses, (_, addresses) => !!addresses?.mailbox), (_, { mailbox }) => ({ mailbox }));
685461
+ // Only load core contracts for chains we're actually using (origin + destination)
685462
+ const relevantChains = [origin, destination];
685463
+ const filteredChainAddresses = Object.fromEntries(Object.entries(chainAddresses).filter(([chain]) => relevantChains.includes(chain)));
685464
+ const mailboxes = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__/* .objMap */ .Yp)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__/* .objFilter */ .s3)(filteredChainAddresses, (_, addresses) => !!addresses?.mailbox), (_, { mailbox }) => ({ mailbox }));
685417
685465
  const warpMultiProvider = multiProtocolProvider.extendChainMetadata(mailboxes);
685418
685466
  // CAST: Registry addresses include CoreAddresses fields (mailbox) for all deployed chains.
685419
685467
  // The warp route config guarantees origin/destination have core deployments.
685420
- const core = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_14__/* .MultiProtocolCore */ .n.fromAddressesMap(chainAddresses, warpMultiProvider);
685421
- const warpCore = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_15__/* .WarpCore */ .u.FromConfig(warpMultiProvider, warpCoreConfig);
685468
+ const core = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__/* .MultiProtocolCore */ .n.fromAddressesMap(chainAddresses, warpMultiProvider);
685469
+ const warpCore = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__/* .WarpCore */ .u.FromConfig(warpMultiProvider, warpCoreConfig);
685422
685470
  let token;
685423
685471
  const tokensForRoute = warpCore.getTokensForRoute(origin, destination);
685424
685472
  if (sourceTokenAddr) {
685425
685473
  const found = warpCore.findToken(origin, sourceTokenAddr);
685426
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .assert */ .v)(found, `Source token ${sourceTokenAddr} not found on ${origin}`);
685474
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(found, `Source token ${sourceTokenAddr} not found on ${origin}`);
685427
685475
  token = found;
685428
685476
  }
685429
685477
  else if (tokensForRoute.length === 0) {
685430
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logRed */ .SU)(`No Warp Routes found from ${origin} to ${destination}`);
685478
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logRed */ .SU)(`No Warp Routes found from ${origin} to ${destination}`);
685431
685479
  throw new Error('Error finding warp route');
685432
685480
  }
685433
685481
  else if (tokensForRoute.length === 1) {
685434
685482
  token = tokensForRoute[0];
685435
685483
  }
685436
685484
  else {
685437
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Please select a token from the Warp config`);
685438
- const routerAddress = await (0,_utils_tokens_js__WEBPACK_IMPORTED_MODULE_7__/* .runTokenSelectionStep */ .J)(tokensForRoute);
685485
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Please select a token from the Warp config`);
685486
+ const routerAddress = await (0,_utils_tokens_js__WEBPACK_IMPORTED_MODULE_8__/* .runTokenSelectionStep */ .J)(tokensForRoute);
685439
685487
  const found = warpCore.findToken(origin, routerAddress);
685440
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .assert */ .v)(found, `Token not found for ${routerAddress} on ${origin}`);
685488
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(found, `Token not found for ${routerAddress} on ${origin}`);
685441
685489
  token = found;
685442
685490
  }
685491
+ let finalAttestation;
685492
+ let quote;
685493
+ let tokenAmount = token.amount(amount); // Hoist to reuse for transaction
685443
685494
  let destToken;
685444
685495
  if (destTokenAddr) {
685445
685496
  const found = warpCore.findToken(destination, destTokenAddr);
685446
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .assert */ .v)(found, `Destination token ${destTokenAddr} not found on ${destination}`);
685497
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(found, `Destination token ${destTokenAddr} not found on ${destination}`);
685447
685498
  destToken = found;
685448
685499
  }
685449
- const isCosmosOrigin = originProtocol === _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.Cosmos ||
685450
- originProtocol === _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .ProtocolType */ .Hb.CosmosNative;
685500
+ // Auto-resolve destToken for cross-collateral routes when not explicitly provided.
685501
+ // Must happen before both attestation branches so that the manual --attestation path
685502
+ // uses transferRemoteTo (not transferRemote) and doesn't produce a calldata mismatch.
685503
+ if (!destToken && token.isCrossCollateralToken()) {
685504
+ const connectionsForDest = token
685505
+ .getConnections()
685506
+ .filter((c) => c.token.chainName === destination);
685507
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(connectionsForDest.length <= 1, `Multiple cross-collateral connections exist from ${token.chainName} to ${destination}. ` +
685508
+ `Use --destination-token to specify which one.`);
685509
+ if (connectionsForDest.length === 1) {
685510
+ destToken =
685511
+ warpCore.findToken(destination, connectionsForDest[0].token.addressOrDenom) ?? undefined;
685512
+ }
685513
+ }
685514
+ if (attestation) {
685515
+ finalAttestation = attestation;
685516
+ // Pre-compute fees so getTransferRemoteTxs uses the same msg_value the
685517
+ // attestation was signed over rather than re-quoting at submission time.
685518
+ quote = await warpCore.getInterchainTransferFee({
685519
+ originTokenAmount: tokenAmount,
685520
+ destination,
685521
+ sender: signerAddress,
685522
+ recipient: recipientAddress,
685523
+ destinationToken: destToken,
685524
+ });
685525
+ }
685526
+ else if (predicateApiKey) {
685527
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)('Fetching Predicate attestation...');
685528
+ const predicateClient = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__/* .PredicateApiClient */ .p(predicateApiKey, predicateApiUrl);
685529
+ const destinationDomain = multiProvider.getDomainId(destination);
685530
+ const recipientBytes32 = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .addressToBytes32 */ .In)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .addressToByteHexString */ .a2)(recipientAddress));
685531
+ const isCrossCollateral = warpCore.isCrossCollateralTransfer(token, destToken);
685532
+ let calldata;
685533
+ if (isCrossCollateral) {
685534
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(destToken, 'destToken required for cross-collateral attestation');
685535
+ const targetRouterBytes32 = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .addressToBytes32 */ .In)(destToken.addressOrDenom);
685536
+ calldata =
685537
+ _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_2__/* .CrossCollateralRouter__factory */ .P77.createInterface().encodeFunctionData('transferRemoteTo', [
685538
+ destinationDomain,
685539
+ recipientBytes32,
685540
+ tokenAmount.amount,
685541
+ targetRouterBytes32,
685542
+ ]);
685543
+ }
685544
+ else {
685545
+ calldata = _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_2__/* .TokenRouter__factory */ .NgW.createInterface().encodeFunctionData('transferRemote(uint32,bytes32,uint256)', [destinationDomain, recipientBytes32, tokenAmount.amount]);
685546
+ }
685547
+ quote = await warpCore.getInterchainTransferFee({
685548
+ originTokenAmount: tokenAmount,
685549
+ destination,
685550
+ sender: signerAddress,
685551
+ recipient: recipientAddress,
685552
+ destinationToken: destToken,
685553
+ });
685554
+ const hypAdapter = token.getHypAdapter(_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_19__/* .MultiProtocolProvider */ .f.fromMultiProvider(multiProvider), destination);
685555
+ let predicateTarget = token.addressOrDenom;
685556
+ if ((0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__/* .isPredicateCapableAdapter */ .R)(hypAdapter)) {
685557
+ const wrapperAddress = await hypAdapter.getPredicateWrapperAddress();
685558
+ if (wrapperAddress) {
685559
+ predicateTarget = wrapperAddress;
685560
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Using PredicateRouterWrapper address: ${wrapperAddress}`);
685561
+ }
685562
+ }
685563
+ // Mirror adapter logic: igpQuote + tokenFeeQuote (when native denom) + token amount (when native token)
685564
+ const tokenFeeDenom = quote.tokenFeeQuote?.token.addressOrDenom;
685565
+ const nativeTokenFee = quote.tokenFeeQuote && (!tokenFeeDenom || (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .isZeroishAddress */ .Hi)(tokenFeeDenom))
685566
+ ? quote.tokenFeeQuote.amount
685567
+ : 0n;
685568
+ const msgValue = ((token.isNative() || token.isHypNative()
685569
+ ? BigInt(tokenAmount.amount.toString())
685570
+ : 0n) +
685571
+ quote.igpQuote.amount +
685572
+ nativeTokenFee).toString();
685573
+ // The Predicate API validates transfer intent, not exact on-chain calldata.
685574
+ // `to` is the wrapper address (the contract that will execute the attestation-gated call),
685575
+ // and `data` is the underlying transferRemote / transferRemoteTo calldata so the API
685576
+ // can parse the destination, recipient, and amount.
685577
+ // The actual on-chain tx will call transferRemoteWithAttestation on the wrapper,
685578
+ // but the API does not need to match the wrapping layer — only the transfer intent.
685579
+ const attestationRequest = {
685580
+ to: predicateTarget,
685581
+ from: signerAddress,
685582
+ data: calldata,
685583
+ msg_value: msgValue,
685584
+ chain: origin,
685585
+ };
685586
+ const response = await predicateClient.fetchAttestation(attestationRequest);
685587
+ finalAttestation = response.attestation;
685588
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logGreen */ .In)('Predicate attestation obtained successfully');
685589
+ }
685590
+ const isCosmosOrigin = originProtocol === _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.Cosmos ||
685591
+ originProtocol === _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .ProtocolType */ .Hb.CosmosNative;
685451
685592
  const skippedByUser = !!skipValidation;
685452
685593
  const shouldSkipTransferValidation = skippedByUser || isCosmosOrigin;
685453
685594
  if (isCosmosOrigin) {
685454
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Skipping transfer validation for ${origin} because Cosmos-origin validation is currently unsupported (CosmJS gas estimation requires sender public key).`);
685595
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Skipping transfer validation for ${origin} because Cosmos-origin validation is currently unsupported (CosmJS gas estimation requires sender public key).`);
685455
685596
  }
685456
685597
  else if (skippedByUser) {
685457
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Skipping transfer validation for ${origin} because --skip-validation was set.`);
685598
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Skipping transfer validation for ${origin} because --skip-validation was set.`);
685458
685599
  }
685459
685600
  if (!shouldSkipTransferValidation) {
685460
685601
  const errors = await warpCore.validateTransfer({
685461
- originTokenAmount: token.amount(amount),
685602
+ originTokenAmount: tokenAmount,
685462
685603
  destination,
685463
685604
  recipient: recipientAddress,
685464
685605
  sender: signerAddress,
685606
+ attestation: finalAttestation,
685465
685607
  destinationToken: destToken,
685466
685608
  });
685467
685609
  if (errors) {
685468
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logRed */ .SU)('Error validating transfer', JSON.stringify(errors));
685610
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logRed */ .SU)('Error validating transfer', JSON.stringify(errors));
685469
685611
  throw new Error('Error validating transfer');
685470
685612
  }
685471
685613
  }
685472
685614
  // Build QuotedCalls params if fee-quoting is configured
685473
685615
  let quotedCalls;
685474
685616
  if (feeQuotingUrl && !feeQuotingApiKey) {
685475
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)('Warning: --fee-quoting-url provided without --fee-quoting-api-key, skipping fee quoting');
685617
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)('Warning: --fee-quoting-url provided without --fee-quoting-api-key, skipping fee quoting');
685476
685618
  }
685477
685619
  if (feeQuotingUrl && feeQuotingApiKey) {
685478
685620
  const chainAddressesForOrigin = chainAddresses[origin];
685479
685621
  const quotedCallsAddress = chainAddressesForOrigin?.quotedCalls;
685480
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .assert */ .v)(quotedCallsAddress, `No quotedCalls address found for chain ${origin}`);
685622
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(quotedCallsAddress, `No quotedCalls address found for chain ${origin}`);
685481
685623
  const clientSalt = `0x${node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomBytes(32).toString('hex')}`;
685482
- const salt = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__/* .computeScopedSalt */ .cQ)(signerAddress, clientSalt);
685624
+ const salt = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .computeScopedSalt */ .cQ)(signerAddress, clientSalt);
685483
685625
  const destinationDomainId = multiProvider.getDomainId(destination);
685484
- const feeQuotingClient = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__/* .FeeQuotingClient */ .h({
685626
+ const feeQuotingClient = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__/* .FeeQuotingClient */ .h({
685485
685627
  baseUrl: feeQuotingUrl,
685486
685628
  apiKey: feeQuotingApiKey,
685487
685629
  });
685488
685630
  const command = destToken
685489
- ? _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_18__/* .FeeQuotingCommand */ .jM.TransferRemoteTo
685490
- : _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_18__/* .FeeQuotingCommand */ .jM.TransferRemote;
685491
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)('Fetching offchain fee quotes...');
685631
+ ? _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__/* .FeeQuotingCommand */ .jM.TransferRemoteTo
685632
+ : _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__/* .FeeQuotingCommand */ .jM.TransferRemote;
685633
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)('Fetching offchain fee quotes...');
685492
685634
  const { quotes } = await feeQuotingClient.getQuote({
685493
685635
  origin,
685494
685636
  command,
685495
685637
  router: token.addressOrDenom,
685496
685638
  destination: destinationDomainId,
685497
685639
  salt,
685498
- recipient: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .addressToBytes32 */ .In)(recipient),
685640
+ recipient: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .addressToBytes32 */ .In)(recipient),
685499
685641
  });
685500
685642
  quotedCalls = {
685501
685643
  address: quotedCallsAddress,
685502
685644
  quotes,
685503
685645
  clientSalt,
685504
- tokenPullMode: _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_18__/* .TokenPullMode */ .Mk.TransferFrom,
685646
+ tokenPullMode: _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__/* .TokenPullMode */ .Mk.TransferFrom,
685505
685647
  };
685506
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Got ${quotes.length} quote(s), estimating fees...`);
685648
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Got ${quotes.length} quote(s), estimating fees...`);
685507
685649
  const { feeQuotes } = await warpCore.getQuotedTransferFee({
685508
- originTokenAmount: new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__/* .TokenAmount */ .s(amount, token),
685650
+ originTokenAmount: new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__/* .TokenAmount */ .s(amount, token),
685509
685651
  destination,
685510
685652
  sender: signerAddress,
685511
685653
  recipient: recipient,
@@ -685514,11 +685656,21 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685514
685656
  });
685515
685657
  quotedCalls.feeQuotes = feeQuotes;
685516
685658
  }
685659
+ if (finalAttestation && quotedCalls) {
685660
+ throw new Error('Predicate attestation (--attestation / --predicate-api-key) and fee quoting (--fee-quoting-url) cannot be used together. ' +
685661
+ 'The QuotedCalls path does not support attestation-gated transfers.');
685662
+ }
685517
685663
  // TODO: override hook address for self-relay
685518
685664
  const transferTxs = await warpCore.getTransferRemoteTxs({
685519
- originTokenAmount: new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__/* .TokenAmount */ .s(amount, token),
685665
+ originTokenAmount: tokenAmount, // Use same tokenAmount as attestation
685520
685666
  destination,
685521
685667
  sender: signerAddress,
685668
+ attestation: finalAttestation,
685669
+ // Always pin the pre-computed fees when available so WarpCore doesn't re-quote.
685670
+ // tokenFeeQuote is intentionally omitted when undefined (valid for routes with no
685671
+ // token fee) — passing undefined would wrongly trigger a re-fetch in WarpCore.
685672
+ ...(quote && { interchainFee: quote.igpQuote }),
685673
+ ...(quote?.tokenFeeQuote && { tokenFeeQuote: quote.tokenFeeQuote }),
685522
685674
  recipient: recipientAddress,
685523
685675
  destinationToken: destToken,
685524
685676
  quotedCalls,
@@ -685527,7 +685679,7 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685527
685679
  let transferReceipt = null;
685528
685680
  let evmTransferReceipt = null;
685529
685681
  for (const tx of transferTxs) {
685530
- if (tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.EthersV5 || tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.Tron) {
685682
+ if (tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.EthersV5 || tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.Tron) {
685531
685683
  const signer = multiProvider.getSigner(origin);
685532
685684
  const preparedTx = await multiProvider.prepareTx(origin, tx.transaction);
685533
685685
  const txResponse = await signer.sendTransaction(preparedTx);
@@ -685537,26 +685689,26 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685537
685689
  receipt: txReceipt,
685538
685690
  };
685539
685691
  txReceipts.push(typedReceipt);
685540
- if (tx.category === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .WarpTxCategory */ .b.Transfer) {
685692
+ if (tx.category === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__/* .WarpTxCategory */ .b.Transfer) {
685541
685693
  transferReceipt = typedReceipt;
685542
685694
  evmTransferReceipt = txReceipt;
685543
685695
  }
685544
685696
  }
685545
685697
  else {
685546
- const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .mustGet */ .Qd)(altVmSigners, origin);
685698
+ const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__/* .mustGet */ .Qd)(altVmSigners, origin);
685547
685699
  if (!isAnnotatedTx(tx.transaction)) {
685548
685700
  throw new Error(`Expected AnnotatedTx for non-EVM transfer execution, got ${typeof tx.transaction}`);
685549
685701
  }
685550
685702
  // For Solana, forward extraSigners so the signer can convert
685551
685703
  // legacy @solana/web3.js Transactions to @solana/kit format.
685552
685704
  // TODO: remove once SDK adapters return @solana/kit-native transactions
685553
- const transaction = tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.SolanaWeb3 && tx.extraSigners
685705
+ const transaction = tx.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.SolanaWeb3 && tx.extraSigners
685554
685706
  ? { ...tx.transaction, extraSigners: tx.extraSigners }
685555
685707
  : tx.transaction;
685556
685708
  const txReceipt = await signer.sendAndConfirmTransaction(transaction);
685557
685709
  const typedReceipt = toTypedAltVmReceipt(tx.type, txReceipt);
685558
685710
  txReceipts.push(typedReceipt);
685559
- if (tx.category === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .WarpTxCategory */ .b.Transfer) {
685711
+ if (tx.category === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__/* .WarpTxCategory */ .b.Transfer) {
685560
685712
  transferReceipt = typedReceipt;
685561
685713
  }
685562
685714
  }
@@ -685570,36 +685722,36 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685570
685722
  if (!messageId) {
685571
685723
  // Same-chain transfers don't dispatch an interchain message.
685572
685724
  if (origin === destination) {
685573
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logGreen */ .In)(`Same-chain transfer on ${origin} completed.`);
685725
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logGreen */ .In)(`Same-chain transfer on ${origin} completed.`);
685574
685726
  return;
685575
685727
  }
685576
685728
  throw new Error('No dispatched message found in transfer receipt');
685577
685729
  }
685578
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Sent transfer from sender (${signerAddress}) on ${origin} to recipient (${recipientAddress}) on ${destination}.`);
685579
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Message ID: ${messageId}`);
685580
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logBlue */ .RK)(`Explorer Link: ${_consts_js__WEBPACK_IMPORTED_MODULE_3__/* .EXPLORER_URL */ .q0}/message/${messageId}`);
685581
- if ((transferReceipt.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.EthersV5 ||
685582
- transferReceipt.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__/* .ProviderType */ .c.Tron) &&
685730
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Sent transfer from sender (${signerAddress}) on ${origin} to recipient (${recipientAddress}) on ${destination}.`);
685731
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Message ID: ${messageId}`);
685732
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logBlue */ .RK)(`Explorer Link: ${_consts_js__WEBPACK_IMPORTED_MODULE_4__/* .EXPLORER_URL */ .q0}/message/${messageId}`);
685733
+ if ((transferReceipt.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.EthersV5 ||
685734
+ transferReceipt.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .ProviderType */ .c.Tron) &&
685583
685735
  evmTransferReceipt) {
685584
685736
  const messageIndex = 0;
685585
- const message = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__/* .HyperlaneCore */ .K.getDispatchedMessages(evmTransferReceipt)[messageIndex];
685737
+ const message = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_26__/* .HyperlaneCore */ .K.getDispatchedMessages(evmTransferReceipt)[messageIndex];
685586
685738
  if (message) {
685587
- const parsed = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_23__/* .parseWarpRouteMessage */ .U4)(message.parsed.body);
685588
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Message:\n${(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_5__/* .indentYamlOrJson */ .R7)((0,yaml__WEBPACK_IMPORTED_MODULE_1__/* .stringify */ .As)(message, null, 2), 4)}`);
685589
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Body:\n${(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_5__/* .indentYamlOrJson */ .R7)((0,yaml__WEBPACK_IMPORTED_MODULE_1__/* .stringify */ .As)(parsed, null, 2), 4)}`);
685739
+ const parsed = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_27__/* .parseWarpRouteMessage */ .U4)(message.parsed.body);
685740
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Message:\n${(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_6__/* .indentYamlOrJson */ .R7)((0,yaml__WEBPACK_IMPORTED_MODULE_1__/* .stringify */ .As)(message, null, 2), 4)}`);
685741
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Body:\n${(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_6__/* .indentYamlOrJson */ .R7)((0,yaml__WEBPACK_IMPORTED_MODULE_1__/* .stringify */ .As)(parsed, null, 2), 4)}`);
685590
685742
  }
685591
685743
  }
685592
685744
  if (selfRelay &&
685593
- (!(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(originProtocol) || !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(destinationProtocol))) {
685594
- const nonEvmSide = !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(originProtocol) ? origin : destination;
685595
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Self-relay requires both origin and destination to be EVM-like. '${nonEvmSide}' is not. Skipping self-relay.`);
685745
+ (!(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(originProtocol) || !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(destinationProtocol))) {
685746
+ const nonEvmSide = !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(originProtocol) ? origin : destination;
685747
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Self-relay requires both origin and destination to be EVM-like. '${nonEvmSide}' is not. Skipping self-relay.`);
685596
685748
  selfRelay = false;
685597
685749
  }
685598
685750
  if (selfRelay) {
685599
685751
  if (!evmTransferReceipt) {
685600
685752
  throw new Error('Missing EVM transfer receipt required for self-relay');
685601
685753
  }
685602
- return (0,_utils_relay_js__WEBPACK_IMPORTED_MODULE_6__/* .runSelfRelay */ .VC)({
685754
+ return (0,_utils_relay_js__WEBPACK_IMPORTED_MODULE_7__/* .runSelfRelay */ .VC)({
685603
685755
  txReceipt: evmTransferReceipt,
685604
685756
  multiProvider: multiProvider,
685605
685757
  registry: registry,
@@ -685609,7 +685761,7 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685609
685761
  if (skipWaitForDelivery)
685610
685762
  return;
685611
685763
  const timeoutMs = timeoutSec * 1000;
685612
- if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isEVMLike */ .Us)(destinationProtocol)) {
685764
+ if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .isEVMLike */ .Us)(destinationProtocol)) {
685613
685765
  const delayMs = 10000;
685614
685766
  const maxAttempts = Math.ceil(timeoutMs / delayMs);
685615
685767
  await core.waitForMessagesProcessed(origin, destination, transferReceipt, delayMs, maxAttempts);
@@ -685627,7 +685779,7 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685627
685779
  message.startsWith('Timed out waiting for message delivery') ||
685628
685780
  message.toLowerCase().includes('fetch failed')) {
685629
685781
  try {
685630
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .log */ .Rm)(`Explorer delivery check failed (${message}). Falling back to on-chain wait.`);
685782
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .log */ .Rm)(`Explorer delivery check failed (${message}). Falling back to on-chain wait.`);
685631
685783
  const delayMs = 10000;
685632
685784
  const maxAttempts = Math.ceil(timeoutMs / delayMs);
685633
685785
  await core.waitForMessagesProcessed(origin, destination, transferReceipt, delayMs, maxAttempts);
@@ -685637,8 +685789,8 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685637
685789
  ? fallbackError.message
685638
685790
  : String(fallbackError);
685639
685791
  if (fallbackMsg.includes('not implemented')) {
685640
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .warnYellow */ .dE)(`On-chain delivery polling not supported for '${destination}' (${destinationProtocol}). ` +
685641
- `Track at ${_consts_js__WEBPACK_IMPORTED_MODULE_3__/* .EXPLORER_URL */ .q0}/message/${messageId}`);
685792
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .warnYellow */ .dE)(`On-chain delivery polling not supported for '${destination}' (${destinationProtocol}). ` +
685793
+ `Track at ${_consts_js__WEBPACK_IMPORTED_MODULE_4__/* .EXPLORER_URL */ .q0}/message/${messageId}`);
685642
685794
  return;
685643
685795
  }
685644
685796
  else {
@@ -685651,7 +685803,7 @@ async function executeDelivery({ context, origin, destination, warpCoreConfig, a
685651
685803
  }
685652
685804
  }
685653
685805
  }
685654
- (0,_logger_js__WEBPACK_IMPORTED_MODULE_11__/* .logGreen */ .In)(`Transfer sent to ${destination} chain!`);
685806
+ (0,_logger_js__WEBPACK_IMPORTED_MODULE_13__/* .logGreen */ .In)(`Transfer sent to ${destination} chain!`);
685655
685807
  }
685656
685808
  async function waitForExplorerDelivery(messageId, timeoutMs) {
685657
685809
  let noResultCount = 0;
@@ -685671,7 +685823,7 @@ async function waitForExplorerDelivery(messageId, timeoutMs) {
685671
685823
  // result === false: message found but not yet delivered — reset counter
685672
685824
  noResultCount = 0;
685673
685825
  }
685674
- await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .sleep */ .yy)(EXPLORER_POLL_INTERVAL_MS);
685826
+ await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .sleep */ .yy)(EXPLORER_POLL_INTERVAL_MS);
685675
685827
  }
685676
685828
  throw new Error('Timed out waiting for message delivery via Explorer');
685677
685829
  }
@@ -693772,7 +693924,7 @@ __webpack_async_result__();
693772
693924
  /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
693773
693925
  /* harmony export */ x: () => (/* binding */ VERSION)
693774
693926
  /* harmony export */ });
693775
- const VERSION = '32.0.1';
693927
+ const VERSION = '33.0.0';
693776
693928
  //# sourceMappingURL=version.js.map
693777
693929
 
693778
693930
  /***/ }),
@@ -747450,10 +747602,12 @@ class HyperlaneHookDeployer extends HyperlaneDeployer/* HyperlaneDeployer */.J {
747450
747602
  aggregatedHooks.push(hookConfig);
747451
747603
  continue;
747452
747604
  }
747605
+ if (hookConfig.type === hook_types/* HookType */.WD.PREDICATE) {
747606
+ throw new Error('Predicate hooks cannot be deployed via HyperlaneHookDeployer, they must be pre-deployed');
747607
+ }
747453
747608
  const subhooks = await this.deployContracts(chain, hookConfig, coreAddresses);
747454
747609
  (0,validation/* assert */.v)(hookConfig.type !== hook_types/* HookType */.WD.UNKNOWN, `Cannot deploy unknown hook type in aggregation`);
747455
- const hookType = hookConfig.type;
747456
- aggregatedHooks.push(subhooks[hookType].address);
747610
+ aggregatedHooks.push(subhooks[hookConfig.type].address);
747457
747611
  hooks = { ...hooks, ...subhooks };
747458
747612
  }
747459
747613
  this.logger.debug({ aggregationHook: config.hooks }, `Deploying aggregation hook of type ${config.hooks.map((h) => typeof h === 'string' ? h : h.type)}...`);
@@ -747530,10 +747684,13 @@ class HyperlaneHookDeployer extends HyperlaneDeployer/* HyperlaneDeployer */.J {
747530
747684
  fallbackAddress = config.fallback;
747531
747685
  }
747532
747686
  else {
747687
+ if (config.fallback.type === hook_types/* HookType */.WD.PREDICATE) {
747688
+ throw new Error('Predicate hooks cannot be deployed via HyperlaneHookDeployer, they must be pre-deployed');
747689
+ }
747533
747690
  const fallbackHook = await this.deployContracts(chain, config.fallback, coreAddresses);
747534
747691
  (0,validation/* assert */.v)(config.fallback.type !== hook_types/* HookType */.WD.UNKNOWN, `Cannot deploy unknown hook type as fallback`);
747535
- const fallbackType = config.fallback.type;
747536
- fallbackAddress = fallbackHook[fallbackType].address;
747692
+ fallbackAddress =
747693
+ fallbackHook[config.fallback.type].address;
747537
747694
  }
747538
747695
  routingHook = await this.deployContract(chain, hook_types/* HookType */.WD.FALLBACK_ROUTING, [mailbox, deployer, fallbackAddress]);
747539
747696
  break;
@@ -747564,15 +747721,17 @@ class HyperlaneHookDeployer extends HyperlaneDeployer/* HyperlaneDeployer */.J {
747564
747721
  prevHookAddress = hookConfig;
747565
747722
  }
747566
747723
  else {
747724
+ if (hookConfig.type === hook_types/* HookType */.WD.PREDICATE) {
747725
+ throw new Error('Predicate hooks cannot be deployed via HyperlaneHookDeployer, they must be pre-deployed');
747726
+ }
747567
747727
  const hook = await this.deployContracts(chain, hookConfig, coreAddresses);
747568
747728
  (0,validation/* assert */.v)(hookConfig.type !== hook_types/* HookType */.WD.UNKNOWN, `Cannot deploy unknown hook type for routing destination ${dest}`);
747569
- const deployedHookType = hookConfig.type;
747570
747729
  routingConfigs.push({
747571
747730
  destination: destDomain,
747572
- hook: hook[deployedHookType].address,
747731
+ hook: hook[hookConfig.type].address,
747573
747732
  });
747574
747733
  prevHookConfig = hookConfig;
747575
- prevHookAddress = hook[deployedHookType].address;
747734
+ prevHookAddress = hook[hookConfig.type].address;
747576
747735
  }
747577
747736
  }
747578
747737
  const overrides = this.multiProvider.getTransactionOverrides(chain);
@@ -747600,10 +747759,12 @@ class HyperlaneHookDeployer extends HyperlaneDeployer/* HyperlaneDeployer */.J {
747600
747759
  hooks.push(hookConfig);
747601
747760
  continue;
747602
747761
  }
747603
- const contracts = await this.deployContracts(chain, hookConfig.type, this.core[chain]);
747762
+ if (hookConfig.type === hook_types/* HookType */.WD.PREDICATE) {
747763
+ throw new Error('Predicate hooks cannot be deployed via HyperlaneHookDeployer, they must be pre-deployed');
747764
+ }
747765
+ const contracts = await this.deployContracts(chain, hookConfig, this.core[chain]);
747604
747766
  (0,validation/* assert */.v)(hookConfig.type !== hook_types/* HookType */.WD.UNKNOWN, `Cannot deploy unknown hook type in amount routing`);
747605
- const deployedType = hookConfig.type;
747606
- hooks.push(contracts[deployedType].address);
747767
+ hooks.push(contracts[hookConfig.type].address);
747607
747768
  }
747608
747769
  const [lowerHook, upperHook] = hooks;
747609
747770
  // deploy routing hook
@@ -747734,6 +747895,7 @@ class HyperlaneCoreDeployer extends HyperlaneDeployer/* HyperlaneDeployer */.J {
747734
747895
  else {
747735
747896
  // Fail fast for unknown hook types from newer registry versions
747736
747897
  (0,validation/* assert */.v)(config.type !== hook_types/* HookType */.WD.UNKNOWN, `Cannot deploy unknown hook type`);
747898
+ (0,validation/* assert */.v)(config.type !== hook_types/* HookType */.WD.PREDICATE, 'Predicate hooks cannot be deployed via HyperlaneCoreDeployer, they must be pre-deployed');
747737
747899
  const hookType = config.type;
747738
747900
  return hooks[hookType];
747739
747901
  }
@@ -747881,7 +748043,7 @@ class EvmCoreModule extends AbstractHyperlaneModule/* HyperlaneModule */.x {
747881
748043
  return transactions;
747882
748044
  }
747883
748045
  async createHookUpdateTxs(proxyAdminAddress, setHookFunctionName, actualConfig, expectedConfig) {
747884
- return (0,updates/* getEvmHookUpdateTransactions */.m)(this.args.addresses.mailbox, {
748046
+ const { transactions } = await (0,updates/* getEvmHookUpdateTransactions */.m)(this.args.addresses.mailbox, {
747885
748047
  actualConfig: actualConfig,
747886
748048
  expectedConfig: expectedConfig,
747887
748049
  evmChainName: this.chainName,
@@ -747897,6 +748059,7 @@ class EvmCoreModule extends AbstractHyperlaneModule/* HyperlaneModule */.x {
747897
748059
  multiProvider: this.multiProvider,
747898
748060
  proxyAdminAddress,
747899
748061
  });
748062
+ return transactions;
747900
748063
  }
747901
748064
  /**
747902
748065
  * Create a transaction to update an existing ISM config, or deploy a new ISM and return a tx to setDefaultIsm
@@ -750876,24 +751039,26 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
750876
751039
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(73689);
750877
751040
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(21387);
750878
751041
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(73938);
750879
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(94523);
750880
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(14918);
750881
- /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(93142);
751042
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(94523);
751043
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(14918);
751044
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(93142);
750882
751045
  /* harmony import */ var _block_explorer_etherscan_js__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(26492);
750883
- /* harmony import */ var _ccip_utils_js__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(93035);
750884
- /* harmony import */ var _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(10256);
750885
- /* harmony import */ var _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(3612);
750886
- /* harmony import */ var _metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(22887);
750887
- /* harmony import */ var _router_types_js__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(38230);
750888
- /* harmony import */ var _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(48807);
751046
+ /* harmony import */ var _ccip_utils_js__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(93035);
751047
+ /* harmony import */ var _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(10256);
751048
+ /* harmony import */ var _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(3612);
751049
+ /* harmony import */ var _ism_HyperlaneIsmFactory_js__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(44886);
751050
+ /* harmony import */ var _metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(22887);
751051
+ /* harmony import */ var _router_types_js__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(38230);
751052
+ /* harmony import */ var _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(48807);
750889
751053
  /* harmony import */ var _token_config_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(4169);
750890
- /* harmony import */ var _token_contracts_js__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(81504);
751054
+ /* harmony import */ var _token_contracts_js__WEBPACK_IMPORTED_MODULE_27__ = __nccwpck_require__(81504);
750891
751055
  /* harmony import */ var _token_deploy_js__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(19186);
750892
- /* harmony import */ var _utils_ism_js__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(764);
751056
+ /* harmony import */ var _utils_ism_js__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(764);
750893
751057
  /* harmony import */ var _HyperlaneProxyFactoryDeployer_js__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(84387);
750894
751058
  /* harmony import */ var _verify_ContractVerifier_js__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(76939);
750895
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_25__]);
750896
- _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_25__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
751059
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_26__]);
751060
+ _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_26__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
751061
+
750897
751062
 
750898
751063
 
750899
751064
 
@@ -751018,7 +751183,8 @@ async function executeWarpDeploy(warpDeployConfig, multiProvider, altVmSigners,
751018
751183
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
751019
751184
  const deployer = warpDeployConfig.isNft
751020
751185
  ? new _token_deploy_js__WEBPACK_IMPORTED_MODULE_15__/* .HypERC721Deployer */ .il(multiProvider)
751021
- : new _token_deploy_js__WEBPACK_IMPORTED_MODULE_15__/* .HypERC20Deployer */ .A7(multiProvider); // TODO: replace with EvmWarpModule
751186
+ : new _token_deploy_js__WEBPACK_IMPORTED_MODULE_15__/* .HypERC20Deployer */ .A7(// TODO: replace with EvmERC20WarpModule
751187
+ multiProvider, _ism_HyperlaneIsmFactory_js__WEBPACK_IMPORTED_MODULE_16__/* .HyperlaneIsmFactory */ .K.fromAddressesMap(registryAddresses, multiProvider, undefined, contractVerifier), contractVerifier);
751022
751188
  const evmContracts = await deployer.deploy(protocolSpecificConfig);
751023
751189
  deployedContracts = {
751024
751190
  ...deployedContracts,
@@ -751027,7 +751193,7 @@ async function executeWarpDeploy(warpDeployConfig, multiProvider, altVmSigners,
751027
751193
  break;
751028
751194
  }
751029
751195
  default: {
751030
- const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_16__/* .altVmChainLookup */ .O)(multiProvider);
751196
+ const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_17__/* .altVmChainLookup */ .O)(multiProvider);
751031
751197
  const deployResults = {};
751032
751198
  for (const chain of (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objKeys */ .cG)(protocolSpecificConfig)) {
751033
751199
  const config = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .mustGet */ .Qd)(protocolSpecificConfig, chain);
@@ -751050,7 +751216,7 @@ async function executeWarpDeploy(warpDeployConfig, multiProvider, altVmSigners,
751050
751216
  }
751051
751217
  async function resolveWarpIsmAndHook(warpConfig, multiProvider, altVmSigners, registryAddresses, ismFactoryDeployer, contractVerifier) {
751052
751218
  return (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .promiseObjAll */ .a1)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objMap */ .Yp)(warpConfig, async (chain, config) => {
751053
- const ccipContractCache = new _ccip_utils_js__WEBPACK_IMPORTED_MODULE_17__/* .CCIPContractCache */ .G5(registryAddresses);
751219
+ const ccipContractCache = new _ccip_utils_js__WEBPACK_IMPORTED_MODULE_18__/* .CCIPContractCache */ .G5(registryAddresses);
751054
751220
  const chainAddresses = registryAddresses[chain];
751055
751221
  if (!chainAddresses) {
751056
751222
  throw new Error(`Registry factory addresses not found for ${chain}.`);
@@ -751087,21 +751253,21 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
751087
751253
  const { interchainSecurityModule } = warpConfig;
751088
751254
  if (!interchainSecurityModule ||
751089
751255
  typeof interchainSecurityModule === 'string') {
751090
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Config Ism is ${!interchainSecurityModule ? 'empty' : interchainSecurityModule}, skipping deployment.`);
751256
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Config Ism is ${!interchainSecurityModule ? 'empty' : interchainSecurityModule}, skipping deployment.`);
751091
751257
  return interchainSecurityModule;
751092
751258
  }
751093
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751094
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Creating ${interchainSecurityModule.type} ISM for token on ${chain} chain...`);
751095
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Finished creating ${interchainSecurityModule.type} ISM for token on ${chain} chain.`);
751259
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751260
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Creating ${interchainSecurityModule.type} ISM for token on ${chain} chain...`);
751261
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Finished creating ${interchainSecurityModule.type} ISM for token on ${chain} chain.`);
751096
751262
  const protocolType = multiProvider.getProtocol(chain);
751097
751263
  switch (protocolType) {
751098
751264
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Tron:
751099
751265
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
751100
- const evmIsmModule = await _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_19__/* .EvmIsmModule */ .a.create({
751266
+ const evmIsmModule = await _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_20__/* .EvmIsmModule */ .a.create({
751101
751267
  chain,
751102
751268
  mailbox: chainAddresses.mailbox,
751103
751269
  multiProvider: multiProvider,
751104
- proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_20__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
751270
+ proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_21__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
751105
751271
  config: interchainSecurityModule,
751106
751272
  ccipContractCache,
751107
751273
  contractVerifier,
@@ -751111,7 +751277,7 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
751111
751277
  }
751112
751278
  default: {
751113
751279
  const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .mustGet */ .Qd)(altVmSigners, chain);
751114
- const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_16__/* .altVmChainLookup */ .O)(multiProvider);
751280
+ const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_17__/* .altVmChainLookup */ .O)(multiProvider);
751115
751281
  const chainMetadata = chainLookup.getChainMetadata(chain);
751116
751282
  const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createIsmWriter */ .lN)(chainMetadata, chainLookup, signer);
751117
751283
  const artifact = (0,_hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_6__/* .ismConfigToArtifact */ .HL)(
@@ -751125,22 +751291,22 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
751125
751291
  async function createWarpHook({ ccipContractCache, chain, chainAddresses, multiProvider, altVmSigners, contractVerifier, warpConfig, }) {
751126
751292
  const { hook } = warpConfig;
751127
751293
  if (!hook || typeof hook === 'string') {
751128
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Config Hook is ${!hook ? 'empty' : hook}, skipping deployment.`);
751294
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Config Hook is ${!hook ? 'empty' : hook}, skipping deployment.`);
751129
751295
  return hook;
751130
751296
  }
751131
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751132
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
751297
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751298
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
751133
751299
  const protocolType = multiProvider.getProtocol(chain);
751134
751300
  switch (protocolType) {
751135
751301
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Tron:
751136
751302
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
751137
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751138
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
751303
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
751304
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
751139
751305
  // If config.proxyadmin.address exists, then use that. otherwise deploy a new proxyAdmin
751140
751306
  const proxyAdminAddress = warpConfig.proxyAdmin?.address ??
751141
751307
  (await multiProvider.handleDeploy(chain, new _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .ProxyAdmin__factory */ .Aig(), []))
751142
751308
  .address;
751143
- const evmHookModule = await _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_21__/* .EvmHookModule */ .o.create({
751309
+ const evmHookModule = await _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_22__/* .EvmHookModule */ .o.create({
751144
751310
  chain,
751145
751311
  multiProvider: multiProvider,
751146
751312
  coreAddresses: {
@@ -751150,15 +751316,15 @@ async function createWarpHook({ ccipContractCache, chain, chainAddresses, multiP
751150
751316
  config: hook,
751151
751317
  ccipContractCache,
751152
751318
  contractVerifier,
751153
- proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_20__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
751319
+ proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_21__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
751154
751320
  });
751155
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Finished creating ${hook.type} Hook for token on ${chain} chain.`);
751321
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Finished creating ${hook.type} Hook for token on ${chain} chain.`);
751156
751322
  const { deployedHook } = evmHookModule.serialize();
751157
751323
  return deployedHook;
751158
751324
  }
751159
751325
  default: {
751160
751326
  const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .mustGet */ .Qd)(altVmSigners, chain);
751161
- const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_16__/* .altVmChainLookup */ .O)(multiProvider);
751327
+ const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_17__/* .altVmChainLookup */ .O)(multiProvider);
751162
751328
  const metadata = multiProvider.getChainMetadata(chain);
751163
751329
  // Deploy new hook using artifact writer with mailbox context
751164
751330
  const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createHookWriter */ .JM)(metadata, chainLookup, signer, {
@@ -751171,17 +751337,17 @@ async function createWarpHook({ ccipContractCache, chain, chainAddresses, multiP
751171
751337
  }
751172
751338
  }
751173
751339
  async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAddresses, warpDeployConfig, }, deployedContracts) {
751174
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.info(`Start enrolling cross chain routers`);
751340
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.info(`Start enrolling cross chain routers`);
751175
751341
  const resolvedConfigMap = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objMap */ .Yp)(warpDeployConfig, (_, config) => ({
751176
751342
  gas: (0,_token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .gasOverhead */ .yv)(config.type),
751177
751343
  ...config,
751178
751344
  }));
751179
751345
  const supportedChains = Object.keys((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objFilter */ .s3)(resolvedConfigMap, (_, config) => !config.foreignDeployment));
751180
751346
  // Process all chains in parallel since they are independent
751181
- const { fulfilled, rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_22__/* .mapAllSettled */ .bh)(supportedChains, async (currentChain) => {
751347
+ const { fulfilled, rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_23__/* .mapAllSettled */ .bh)(supportedChains, async (currentChain) => {
751182
751348
  const protocol = multiProvider.getProtocol(currentChain);
751183
751349
  // Start with user-specified remote routers (for chains not in the deployment)
751184
- const userRemoteRouters = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objMap */ .Yp)((0,_router_types_js__WEBPACK_IMPORTED_MODULE_23__/* .resolveRouterMapConfig */ .c0)(multiProvider, resolvedConfigMap[currentChain].remoteRouters ?? {}), (_, value) => ({ address: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_24__/* .addressToBytes32 */ .In)(value.address) }));
751350
+ const userRemoteRouters = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objMap */ .Yp)((0,_router_types_js__WEBPACK_IMPORTED_MODULE_24__/* .resolveRouterMapConfig */ .c0)(multiProvider, resolvedConfigMap[currentChain].remoteRouters ?? {}), (_, value) => ({ address: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_25__/* .addressToBytes32 */ .In)(value.address) }));
751185
751351
  // Merge: deployed routers take precedence over user-specified
751186
751352
  const remoteRouters = {
751187
751353
  ...userRemoteRouters,
@@ -751190,12 +751356,12 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751190
751356
  .map(([chain, address]) => [
751191
751357
  multiProvider.getDomainId(chain).toString(),
751192
751358
  {
751193
- address: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_24__/* .addressToBytes32 */ .In)(address),
751359
+ address: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_25__/* .addressToBytes32 */ .In)(address),
751194
751360
  },
751195
751361
  ])),
751196
751362
  };
751197
751363
  // Start with user-specified destination gas
751198
- const userDestinationGas = (0,_router_types_js__WEBPACK_IMPORTED_MODULE_23__/* .resolveRouterMapConfig */ .c0)(multiProvider, resolvedConfigMap[currentChain].destinationGas ?? {});
751364
+ const userDestinationGas = (0,_router_types_js__WEBPACK_IMPORTED_MODULE_24__/* .resolveRouterMapConfig */ .c0)(multiProvider, resolvedConfigMap[currentChain].destinationGas ?? {});
751199
751365
  // Default to MAX_GAS_OVERHEAD for user-specified remote routers without explicit destinationGas
751200
751366
  const defaultGasForUserRouters = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objMap */ .Yp)(userRemoteRouters, (domainId) => userDestinationGas[domainId] ?? _token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .MAX_GAS_OVERHEAD */ .mA.toString());
751201
751367
  // Merge: deployed chain gas takes precedence over defaults and user-specified
@@ -751209,14 +751375,14 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751209
751375
  ])),
751210
751376
  };
751211
751377
  for (const domainId of Object.keys(remoteRouters)) {
751212
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.debug(`Creating enroll remote router transactions with remote domain id ${domainId} and address ${remoteRouters[domainId]} on chain ${currentChain}`);
751378
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.debug(`Creating enroll remote router transactions with remote domain id ${domainId} and address ${remoteRouters[domainId]} on chain ${currentChain}`);
751213
751379
  }
751214
751380
  let transactions = [];
751215
751381
  switch (protocol) {
751216
751382
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Tron:
751217
751383
  case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
751218
751384
  const { domainRoutingIsmFactory, incrementalDomainRoutingIsmFactory, staticMerkleRootMultisigIsmFactory, staticMessageIdMultisigIsmFactory, staticAggregationIsmFactory, staticAggregationHookFactory, staticMerkleRootWeightedMultisigIsmFactory, staticMessageIdWeightedMultisigIsmFactory, } = registryAddresses[currentChain];
751219
- const evmWarpModule = new _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_25__/* .EvmWarpModule */ .N(multiProvider, {
751385
+ const evmWarpModule = new _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_26__/* .EvmWarpModule */ .N(multiProvider, {
751220
751386
  chain: currentChain,
751221
751387
  config: resolvedConfigMap[currentChain],
751222
751388
  addresses: {
@@ -751256,7 +751422,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751256
751422
  }
751257
751423
  default: {
751258
751424
  const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .mustGet */ .Qd)(altVmSigners, currentChain);
751259
- const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_16__/* .altVmChainLookup */ .O)(multiProvider);
751425
+ const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_17__/* .altVmChainLookup */ .O)(multiProvider);
751260
751426
  const chainMetadata = chainLookup.getChainMetadata(currentChain);
751261
751427
  const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createWarpTokenWriter */ .l5)(chainMetadata, chainLookup, signer);
751262
751428
  const expectedConfig = {
@@ -751273,7 +751439,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751273
751439
  transactions = await writer.update(deployedArtifact);
751274
751440
  }
751275
751441
  }
751276
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.debug(`Created enroll router update transactions for chain ${currentChain}`);
751442
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.debug(`Created enroll router update transactions for chain ${currentChain}`);
751277
751443
  return { chain: currentChain, transactions };
751278
751444
  }, (chain) => chain);
751279
751445
  // Process settled results and collect transactions
@@ -751285,7 +751451,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751285
751451
  }
751286
751452
  }
751287
751453
  for (const [chain, error] of rejected) {
751288
- _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_18__/* .rootLogger */ .Jk.error(`Failed to create enroll router transactions for chain ${chain}: ${error.message}`);
751454
+ _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .rootLogger */ .Jk.error(`Failed to create enroll router transactions for chain ${chain}: ${error.message}`);
751289
751455
  errors.push(`${chain}: ${error.message}`);
751290
751456
  }
751291
751457
  if (errors.length > 0) {
@@ -751294,7 +751460,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
751294
751460
  return updateTransactions;
751295
751461
  }
751296
751462
  function getRouter(contracts) {
751297
- for (const key of (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objKeys */ .cG)(_token_contracts_js__WEBPACK_IMPORTED_MODULE_26__/* .hypERC20factories */ .AE)) {
751463
+ for (const key of (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__/* .objKeys */ .cG)(_token_contracts_js__WEBPACK_IMPORTED_MODULE_27__/* .hypERC20factories */ .AE)) {
751298
751464
  if (contracts[key])
751299
751465
  return contracts[key];
751300
751466
  }
@@ -754963,6 +755129,10 @@ class EvmHookReader extends _utils_HyperlaneReader_js__WEBPACK_IMPORTED_MODULE_1
754963
755129
  derivedHookConfig =
754964
755130
  await this.deriveMailboxDefaultHookConfig(address);
754965
755131
  break;
755132
+ case _types_js__WEBPACK_IMPORTED_MODULE_4__/* .OnchainHookType */ .c0.PREDICATE_ROUTER_WRAPPER:
755133
+ derivedHookConfig = { type: _types_js__WEBPACK_IMPORTED_MODULE_4__/* .HookType */ .WD.PREDICATE, address };
755134
+ this._cache.set(address, derivedHookConfig);
755135
+ break;
754966
755136
  default:
754967
755137
  throw new Error(`Unsupported HookType: ${_types_js__WEBPACK_IMPORTED_MODULE_4__/* .OnchainHookType */ .c0[onchainHookType]}`);
754968
755138
  }
@@ -755366,7 +755536,7 @@ const hookFactories = {
755366
755536
  /* harmony export */ vC: () => (/* binding */ HookConfigSchema),
755367
755537
  /* harmony export */ yx: () => (/* binding */ MUTABLE_HOOK_TYPE)
755368
755538
  /* harmony export */ });
755369
- /* unused harmony exports ProtocolFeeSchema, MerkleTreeSchema, PausableHookSchema, MailboxDefaultHookSchema, OpStackHookSchema, ArbL2ToL1HookSchema, IgpSchema, DomainRoutingHookConfigSchema, FallbackRoutingHookConfigSchema, AmountRoutingHookConfigSchema, AggregationHookConfigSchema, CCIPHookSchema, UnknownHookSchema, normalizeUnknownHookTypes, SafeParseHookConfigSchema, HooksConfigSchema, HooksConfigMapSchema */
755539
+ /* unused harmony exports ProtocolFeeSchema, MerkleTreeSchema, PredicateHookSchema, PausableHookSchema, MailboxDefaultHookSchema, OpStackHookSchema, ArbL2ToL1HookSchema, IgpSchema, DomainRoutingHookConfigSchema, FallbackRoutingHookConfigSchema, AmountRoutingHookConfigSchema, AggregationHookConfigSchema, CCIPHookSchema, UnknownHookSchema, normalizeUnknownHookTypes, SafeParseHookConfigSchema, HooksConfigSchema, HooksConfigMapSchema */
755370
755540
  /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(49355);
755371
755541
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(73689);
755372
755542
  /* harmony import */ var _gas_oracle_types_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(73847);
@@ -755395,8 +755565,16 @@ var OnchainHookType;
755395
755565
  OnchainHookType[OnchainHookType["OP_L2_TO_L1"] = 12] = "OP_L2_TO_L1";
755396
755566
  OnchainHookType[OnchainHookType["MAILBOX_DEFAULT_HOOK"] = 13] = "MAILBOX_DEFAULT_HOOK";
755397
755567
  OnchainHookType[OnchainHookType["AMOUNT_ROUTING"] = 14] = "AMOUNT_ROUTING";
755568
+ OnchainHookType[OnchainHookType["CCTP"] = 15] = "CCTP";
755569
+ OnchainHookType[OnchainHookType["TIMELOCK_ROUTING"] = 16] = "TIMELOCK_ROUTING";
755570
+ OnchainHookType[OnchainHookType["PREDICATE_ROUTER_WRAPPER"] = 17] = "PREDICATE_ROUTER_WRAPPER";
755398
755571
  })(OnchainHookType || (OnchainHookType = {}));
755399
755572
  const HookType = {
755573
+ /**
755574
+ * Retained for backwards compatibility with pre-deployed hooks that don't fit
755575
+ * a named type. Excluded from `DeployableHookType` — cannot be deployed via
755576
+ * `HyperlaneHookDeployer`. New code should use a specific named hook type.
755577
+ */
755400
755578
  CUSTOM: 'custom',
755401
755579
  MERKLE_TREE: 'merkleTreeHook',
755402
755580
  INTERCHAIN_GAS_PAYMASTER: 'interchainGasPaymaster',
@@ -755411,6 +755589,7 @@ const HookType = {
755411
755589
  MAILBOX_DEFAULT: 'defaultHook',
755412
755590
  CCIP: 'ccipHook',
755413
755591
  UNKNOWN: 'unknownHook',
755592
+ PREDICATE: 'predicateHook',
755414
755593
  };
755415
755594
  const HookTypeToContractNameMap = {
755416
755595
  [HookType.MERKLE_TREE]: 'merkleTreeHook',
@@ -755443,6 +755622,10 @@ const ProtocolFeeSchema = _types_js__WEBPACK_IMPORTED_MODULE_0__/* .OwnableSchem
755443
755622
  const MerkleTreeSchema = zod__WEBPACK_IMPORTED_MODULE_1__/* .object */ .Ik({
755444
755623
  type: zod__WEBPACK_IMPORTED_MODULE_1__/* .literal */ .eu(HookType.MERKLE_TREE),
755445
755624
  });
755625
+ const PredicateHookSchema = zod__WEBPACK_IMPORTED_MODULE_1__/* .object */ .Ik({
755626
+ type: zod__WEBPACK_IMPORTED_MODULE_1__/* .literal */ .eu(HookType.PREDICATE),
755627
+ address: zod__WEBPACK_IMPORTED_MODULE_1__/* .string */ .Yj(),
755628
+ });
755446
755629
  const PausableHookSchema = _types_js__WEBPACK_IMPORTED_MODULE_0__/* .PausableSchema */ .T9.extend({
755447
755630
  type: zod__WEBPACK_IMPORTED_MODULE_1__/* .literal */ .eu(HookType.PAUSABLE),
755448
755631
  });
@@ -755550,6 +755733,7 @@ const HookConfigSchema = zod__WEBPACK_IMPORTED_MODULE_1__/* .union */ .KC([
755550
755733
  MailboxDefaultHookSchema,
755551
755734
  CCIPHookSchema,
755552
755735
  UnknownHookSchema,
755736
+ PredicateHookSchema,
755553
755737
  ]);
755554
755738
  /**
755555
755739
  * Forward-compatible hook config schema that normalizes unknown hook types.
@@ -755607,12 +755791,53 @@ async function getEvmHookUpdateTransactions(clientContractAddress, updateHookPar
755607
755791
  data: updateHookParams.setHookFunctionCallEncoder(newHookAddress),
755608
755792
  });
755609
755793
  }
755610
- return updateTransactions;
755794
+ return { transactions: updateTransactions, newHookAddress };
755611
755795
  }
755612
755796
  //# sourceMappingURL=updates.js.map
755613
755797
 
755614
755798
  /***/ }),
755615
755799
 
755800
+ /***/ 13912:
755801
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
755802
+
755803
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
755804
+ /* harmony export */ B: () => (/* binding */ stripPredicateSubHook)
755805
+ /* harmony export */ });
755806
+ /* unused harmony export isHookCompatible */
755807
+ /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(52116);
755808
+
755809
+
755810
+ /**
755811
+ * Checks if the given hook type is compatible with the chain's technical stack.
755812
+ *
755813
+ * @param {HookType} params.hookType - The type of hook
755814
+ * @param {ChainTechnicalStack | undefined} params.chainTechnicalStack - The technical stack of the chain
755815
+ * @returns {boolean} True if the hook type is compatible with the chain, false otherwise
755816
+ */
755817
+ /**
755818
+ * Strips the PREDICATE sub-hook from an aggregation hook config.
755819
+ * If the aggregation contains exactly one non-predicate hook, unwraps it.
755820
+ * Returns the hook unchanged if no predicate is found or multiple remain.
755821
+ */
755822
+ function stripPredicateSubHook(hook) {
755823
+ if (typeof hook === 'string' || hook.type !== _types_js__WEBPACK_IMPORTED_MODULE_0__/* .HookType */ .WD.AGGREGATION)
755824
+ return hook;
755825
+ const agg = hook;
755826
+ const remaining = agg.hooks.filter((h) => typeof h === 'string' ||
755827
+ h.type !== _types_js__WEBPACK_IMPORTED_MODULE_0__/* .HookType */ .WD.PREDICATE);
755828
+ if (remaining.length === agg.hooks.length)
755829
+ return hook; // no predicate found
755830
+ if (remaining.length === 1)
755831
+ return remaining[0];
755832
+ // Multiple non-predicate hooks remain — can't construct without on-chain address
755833
+ return hook;
755834
+ }
755835
+ const isHookCompatible = ({ hookType, chainTechnicalStack, }) => !(hookType === HookType.AGGREGATION &&
755836
+ chainTechnicalStack === ChainTechnicalStack.ZkSync);
755837
+ //# sourceMappingURL=utils.js.map
755838
+
755839
+ /***/ }),
755840
+
755616
755841
  /***/ 40139:
755617
755842
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
755618
755843
 
@@ -759507,6 +759732,317 @@ const interchainAccountFactories = {
759507
759732
 
759508
759733
  /***/ }),
759509
759734
 
759735
+ /***/ 41339:
759736
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
759737
+
759738
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
759739
+ /* harmony export */ D: () => (/* binding */ PredicateAttestationSchema),
759740
+ /* harmony export */ p: () => (/* binding */ PredicateApiClient)
759741
+ /* harmony export */ });
759742
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(94523);
759743
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(21387);
759744
+ /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(49355);
759745
+
759746
+
759747
+ const DEFAULT_PREDICATE_API_URL = 'https://api.predicate.io/v2/attestation';
759748
+ const PredicateAttestationSchema = zod__WEBPACK_IMPORTED_MODULE_0__/* .object */ .Ik({
759749
+ uuid: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759750
+ expiration: zod__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai(),
759751
+ attester: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759752
+ signature: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759753
+ });
759754
+ const PredicateAttestationResponseSchema = zod__WEBPACK_IMPORTED_MODULE_0__/* .object */ .Ik({
759755
+ policy_id: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759756
+ policy_name: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759757
+ verification_hash: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
759758
+ is_compliant: zod__WEBPACK_IMPORTED_MODULE_0__/* .boolean */ .zM(),
759759
+ attestation: PredicateAttestationSchema,
759760
+ });
759761
+ class PredicateApiClient {
759762
+ logger = _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .rootLogger */ .Jk.child({ module: 'PredicateApiClient' });
759763
+ baseUrl;
759764
+ apiKey;
759765
+ constructor(apiKey, baseUrl = DEFAULT_PREDICATE_API_URL) {
759766
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(apiKey, 'Predicate API key is required');
759767
+ this.apiKey = apiKey;
759768
+ this.baseUrl = baseUrl;
759769
+ }
759770
+ async fetchAttestation(request) {
759771
+ this.logger.debug('Fetching attestation', {
759772
+ url: this.baseUrl,
759773
+ request,
759774
+ });
759775
+ const controller = new AbortController();
759776
+ const timeoutId = setTimeout(() => controller.abort(), 30_000);
759777
+ let response;
759778
+ try {
759779
+ response = await fetch(this.baseUrl, {
759780
+ method: 'POST',
759781
+ headers: {
759782
+ 'Content-Type': 'application/json',
759783
+ 'x-api-key': this.apiKey,
759784
+ },
759785
+ body: JSON.stringify(request),
759786
+ signal: controller.signal,
759787
+ });
759788
+ }
759789
+ finally {
759790
+ clearTimeout(timeoutId);
759791
+ }
759792
+ if (!response.ok) {
759793
+ const errorText = await response.text();
759794
+ throw new Error(`Predicate API error (${response.status}): ${errorText}`);
759795
+ }
759796
+ const result = PredicateAttestationResponseSchema.parse(await response.json());
759797
+ if (!result.is_compliant) {
759798
+ throw new Error(`Transaction not compliant: policy=${result.policy_id}, hash=${result.verification_hash}`);
759799
+ }
759800
+ const now = Math.floor(Date.now() / 1000);
759801
+ if (result.attestation.expiration <= now) {
759802
+ throw new Error(`Attestation already expired (expiration=${result.attestation.expiration}, now=${now})`);
759803
+ }
759804
+ this.logger.debug('Attestation received', {
759805
+ uuid: result.attestation.uuid,
759806
+ });
759807
+ return result;
759808
+ }
759809
+ }
759810
+ //# sourceMappingURL=PredicateApiClient.js.map
759811
+
759812
+ /***/ }),
759813
+
759814
+ /***/ 550:
759815
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
759816
+
759817
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
759818
+ /* harmony export */ t: () => (/* binding */ PredicateWrapperDeployer)
759819
+ /* harmony export */ });
759820
+ /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(61934);
759821
+ /* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(50653);
759822
+ /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(94523);
759823
+ /* harmony import */ var _hook_types_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(52116);
759824
+ /* harmony import */ var _token_config_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4169);
759825
+
759826
+
759827
+
759828
+
759829
+
759830
+ class PredicateWrapperDeployer {
759831
+ multiProvider;
759832
+ staticAggregationHookFactory;
759833
+ logger;
759834
+ constructor(multiProvider, staticAggregationHookFactory, logger) {
759835
+ this.multiProvider = multiProvider;
759836
+ this.staticAggregationHookFactory = staticAggregationHookFactory;
759837
+ this.logger =
759838
+ logger ?? _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .rootLogger */ .Jk.child({ module: 'PredicateWrapperDeployer' });
759839
+ }
759840
+ async deployPredicateWrapper(chain, warpRouteAddress, config, tokenType) {
759841
+ const signer = this.multiProvider.getSigner(chain);
759842
+ const isCrossCollateral = tokenType === _token_config_js__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.crossCollateral;
759843
+ const wrapperName = isCrossCollateral
759844
+ ? 'PredicateCrossCollateralRouterWrapper'
759845
+ : 'PredicateRouterWrapper';
759846
+ this.logger.info({
759847
+ chain,
759848
+ warpRoute: warpRouteAddress,
759849
+ registry: config.predicateRegistry,
759850
+ tokenType,
759851
+ wrapperType: wrapperName,
759852
+ }, `Deploying ${wrapperName}`);
759853
+ const overrides = this.multiProvider.getTransactionOverrides(chain);
759854
+ // Deploy the appropriate wrapper based on token type
759855
+ // Token address is fetched from warpRoute.token() in constructor
759856
+ const wrapper = isCrossCollateral
759857
+ ? await new _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .PredicateCrossCollateralRouterWrapper__factory */ .TsJ(signer).deploy(warpRouteAddress, config.predicateRegistry, config.policyId, overrides)
759858
+ : await new _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .PredicateRouterWrapper__factory */ .sYb(signer).deploy(warpRouteAddress, config.predicateRegistry, config.policyId, overrides);
759859
+ await wrapper.deployed();
759860
+ // Transfer wrapper ownership to the warp route owner so that admin functions
759861
+ // (setPolicyID, setRegistry, withdrawETH) are controlled by the same key/multisig
759862
+ // that owns the warp route, not the ephemeral deployer key.
759863
+ // Use the explicit owner from config rather than reading from on-chain, because
759864
+ // during initial deployment the on-chain owner is still the deployer signer
759865
+ // (transferOwnership hasn't run yet).
759866
+ const routeOwner = config.owner;
759867
+ await this.multiProvider.handleTx(chain, wrapper.transferOwnership(routeOwner, overrides));
759868
+ this.logger.info({
759869
+ chain,
759870
+ address: wrapper.address,
759871
+ owner: routeOwner,
759872
+ wrapperType: wrapperName,
759873
+ }, `${wrapperName} deployed and ownership transferred`);
759874
+ return wrapper.address;
759875
+ }
759876
+ async createAggregationHook(chain, predicateWrapperAddress, existingHookAddress) {
759877
+ const signer = this.multiProvider.getSigner(chain);
759878
+ this.logger.info({
759879
+ chain,
759880
+ predicateWrapper: predicateWrapperAddress,
759881
+ existingHook: existingHookAddress,
759882
+ }, 'Creating aggregation hook');
759883
+ const hooks = [predicateWrapperAddress, existingHookAddress];
759884
+ const threshold = hooks.length;
759885
+ const factory = this.staticAggregationHookFactory.connect(signer);
759886
+ const existingAddress = await factory['getAddress(address[],uint8)'](hooks, threshold);
759887
+ const code = await this.multiProvider
759888
+ .getProvider(chain)
759889
+ .getCode(existingAddress);
759890
+ let aggregationHookAddress;
759891
+ if (code === '0x') {
759892
+ const overrides = this.multiProvider.getTransactionOverrides(chain);
759893
+ const tx = await factory['deploy(address[],uint8)'](hooks, threshold, overrides);
759894
+ await this.multiProvider.handleTx(chain, tx);
759895
+ aggregationHookAddress = existingAddress;
759896
+ }
759897
+ else {
759898
+ this.logger.debug({ chain, address: existingAddress }, 'Recovered existing aggregation hook');
759899
+ aggregationHookAddress = existingAddress;
759900
+ }
759901
+ this.logger.info({ chain, address: aggregationHookAddress }, 'Aggregation hook ready');
759902
+ return aggregationHookAddress;
759903
+ }
759904
+ /**
759905
+ * Deploys the predicate wrapper and aggregation hook on-chain as a side effect, then
759906
+ * returns the populated setHook transaction for the caller to include in its transaction
759907
+ * array.
759908
+ *
759909
+ * IMPORTANT — irreversible side effects: deployPredicateWrapper submits a real on-chain
759910
+ * transaction before this method returns. If the caller discards the returned setHookTx
759911
+ * (dry-run, cancellation, error), the PredicateRouterWrapper is orphaned — deployed but
759912
+ * unreferenced by any warp route. The aggregation hook is safe because
759913
+ * StaticAggregationHookFactory uses CREATE2 (idempotent). Eliminating the wrapper orphan
759914
+ * risk requires a CREATE2 factory for PredicateRouterWrapper (future contract work).
759915
+ *
759916
+ * This differs from EvmHookModule/EvmIsmModule: those modules own the full configuration
759917
+ * lifecycle (deploy + configure in one atomic step). Here, deployment is eager but the
759918
+ * final wiring (setHook) is deferred to EvmWarpModule.update(), which may choose not to
759919
+ * submit it.
759920
+ *
759921
+ * @param existingHookOverride - When provided, skips the on-chain hook() read and uses
759922
+ * this address instead. Pass the pending new hook address when a hook update is being
759923
+ * applied in the same update() call to avoid wrapping a stale on-chain hook.
759924
+ */
759925
+ async deployAndConfigure(chain, warpRouteAddress, config, tokenType, existingHookOverride) {
759926
+ const signer = this.multiProvider.getSigner(chain);
759927
+ // Connect to the appropriate router type
759928
+ const isCrossCollateral = tokenType === _token_config_js__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.crossCollateral;
759929
+ const warpRoute = isCrossCollateral
759930
+ ? _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .CrossCollateralRouter__factory */ .P77.connect(warpRouteAddress, signer)
759931
+ : _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .TokenRouter__factory */ .NgW.connect(warpRouteAddress, signer);
759932
+ // Use the override when provided (e.g. when a hook update is pending in the same
759933
+ // update() call and the on-chain value would be stale).
759934
+ const rawExistingHook = existingHookOverride ?? (await warpRoute.hook());
759935
+ // If the existing hook is already an aggregation containing a predicate wrapper,
759936
+ // unwrap it to the base (non-predicate) hook before re-aggregating. Without this,
759937
+ // updating a predicate config would stack wrappers:
759938
+ // newAggregation([newWrapper, oldAggregation([oldWrapper, IGP])])
759939
+ // instead of the correct:
759940
+ // newAggregation([newWrapper, IGP])
759941
+ const existingHook = await this.stripPredicateAndReaggregateHook(chain, rawExistingHook);
759942
+ // WARNING: deployPredicateWrapper submits a real on-chain transaction here.
759943
+ // If the caller discards the returned setHookTx, this wrapper will be orphaned.
759944
+ this.logger.warn({ chain, warpRoute: warpRouteAddress }, 'Deploying PredicateRouterWrapper — this on-chain deployment is irreversible. ' +
759945
+ 'Submit the returned setHookTx to complete wiring; discarding it will leave the wrapper orphaned.');
759946
+ const wrapperAddress = await this.deployPredicateWrapper(chain, warpRouteAddress, config, tokenType);
759947
+ let hookToAggregateWith;
759948
+ if (existingHook !== ethers__WEBPACK_IMPORTED_MODULE_3__.constants.AddressZero) {
759949
+ hookToAggregateWith = existingHook;
759950
+ }
759951
+ else {
759952
+ const mailboxAddress = await warpRoute.mailbox();
759953
+ const mailbox = _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .Mailbox__factory */ .L9x.connect(mailboxAddress, signer);
759954
+ hookToAggregateWith = await mailbox.defaultHook();
759955
+ this.logger.info({ chain, defaultHook: hookToAggregateWith }, 'Using mailbox default hook for aggregation (warp route had no existing hook)');
759956
+ }
759957
+ const aggregationHookAddress = await this.createAggregationHook(chain, wrapperAddress, hookToAggregateWith);
759958
+ const setHookTx = await warpRoute.populateTransaction.setHook(aggregationHookAddress);
759959
+ return {
759960
+ wrapperAddress,
759961
+ aggregationHookAddress,
759962
+ setHookTx,
759963
+ };
759964
+ }
759965
+ /**
759966
+ * If hookAddress is a StaticAggregationHook that contains a predicate wrapper,
759967
+ * strips it and (when multiple non-predicate sub-hooks remain) re-aggregates
759968
+ * them via CREATE2 before returning, so the caller can safely wrap the result
759969
+ * in a new aggregation without stacking wrappers.
759970
+ *
759971
+ * Falls back to hookAddress unchanged when:
759972
+ * - The address is zero / not an aggregation hook
759973
+ * - No predicate wrapper is found among sub-hooks
759974
+ * - Multiple non-predicate sub-hooks remain (cannot safely re-aggregate here)
759975
+ */
759976
+ async stripPredicateAndReaggregateHook(chain, hookAddress) {
759977
+ if (!hookAddress || hookAddress === ethers__WEBPACK_IMPORTED_MODULE_3__.constants.AddressZero) {
759978
+ return hookAddress;
759979
+ }
759980
+ const provider = this.multiProvider.getProvider(chain);
759981
+ let subHooks;
759982
+ try {
759983
+ subHooks = await _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .StaticAggregationHook__factory */ ._ok.connect(hookAddress, provider).hooks('0x');
759984
+ }
759985
+ catch {
759986
+ // Any failure means hookAddress is not a StaticAggregationHook.
759987
+ // SmartProvider wraps CALL_EXCEPTION as "Invalid response from provider" with code: undefined.
759988
+ return hookAddress;
759989
+ }
759990
+ if (!subHooks || subHooks.length === 0)
759991
+ return hookAddress;
759992
+ const nonPredicateHooks = [];
759993
+ for (const sub of subHooks) {
759994
+ try {
759995
+ const hookType = await _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .PredicateRouterWrapper__factory */ .sYb.connect(sub, provider).hookType();
759996
+ if (hookType === _hook_types_js__WEBPACK_IMPORTED_MODULE_4__/* .OnchainHookType */ .c0.PREDICATE_ROUTER_WRAPPER) {
759997
+ this.logger.debug({ chain, predicateWrapper: sub }, 'Stripping existing predicate wrapper from aggregation to avoid stacking');
759998
+ }
759999
+ else {
760000
+ nonPredicateHooks.push(sub);
760001
+ }
760002
+ }
760003
+ catch {
760004
+ // hookType() failed — not a recognisable hook (or SmartProvider wrapped the
760005
+ // revert as "Invalid response from provider" with code: undefined); keep it.
760006
+ nonPredicateHooks.push(sub);
760007
+ }
760008
+ }
760009
+ if (nonPredicateHooks.length === subHooks.length) {
760010
+ // No predicate wrapper found — use hook as-is
760011
+ return hookAddress;
760012
+ }
760013
+ if (nonPredicateHooks.length === 1) {
760014
+ // Happy path: exactly one base hook remains
760015
+ return nonPredicateHooks[0];
760016
+ }
760017
+ // Multiple non-predicate sub-hooks remain after removing the predicate wrapper.
760018
+ // Re-aggregate them via CREATE2 (idempotent) so the caller produces:
760019
+ // outerAgg([newWrapper, innerAgg([hookA, hookB])])
760020
+ // instead of the stacking anti-pattern:
760021
+ // newAgg([newWrapper, oldAgg([oldWrapper, hookA, hookB])])
760022
+ this.logger.debug({ chain, nonPredicateHooks }, 'Multiple non-predicate sub-hooks found — re-aggregating without predicate wrapper');
760023
+ const signer = this.multiProvider.getSigner(chain);
760024
+ const overrides = this.multiProvider.getTransactionOverrides(chain);
760025
+ const factory = this.staticAggregationHookFactory.connect(signer);
760026
+ const threshold = nonPredicateHooks.length;
760027
+ const innerAggAddress = await factory['getAddress(address[],uint8)'](nonPredicateHooks, threshold);
760028
+ const code = await this.multiProvider
760029
+ .getProvider(chain)
760030
+ .getCode(innerAggAddress);
760031
+ if (code === '0x') {
760032
+ const tx = await factory['deploy(address[],uint8)'](nonPredicateHooks, threshold, overrides);
760033
+ await this.multiProvider.handleTx(chain, tx);
760034
+ this.logger.info({ chain, innerAgg: innerAggAddress, hooks: nonPredicateHooks }, 'Inner aggregation hook deployed for predicate-stripped sub-hooks');
760035
+ }
760036
+ else {
760037
+ this.logger.debug({ chain, innerAgg: innerAggAddress }, 'Recovered existing inner aggregation hook');
760038
+ }
760039
+ return innerAggAddress;
760040
+ }
760041
+ }
760042
+ //# sourceMappingURL=PredicateDeployer.js.map
760043
+
760044
+ /***/ }),
760045
+
759510
760046
  /***/ 95176:
759511
760047
  /***/ ((__webpack_module__, __webpack_exports__, __nccwpck_require__) => {
759512
760048
 
@@ -799571,8 +800107,8 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
799571
800107
  /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
799572
800108
  /* harmony export */ N: () => (/* binding */ EvmWarpModule)
799573
800109
  /* harmony export */ });
799574
- /* harmony import */ var compare_versions__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(95416);
799575
- /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(61934);
800110
+ /* harmony import */ var compare_versions__WEBPACK_IMPORTED_MODULE_28__ = __nccwpck_require__(95416);
800111
+ /* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(61934);
799576
800112
  /* harmony import */ var starknet__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(98954);
799577
800113
  /* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(50653);
799578
800114
  /* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(74119);
@@ -799583,22 +800119,25 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
799583
800119
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(52193);
799584
800120
  /* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(73689);
799585
800121
  /* harmony import */ var _block_explorer_etherscan_js__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(26492);
799586
- /* harmony import */ var _contracts_contracts_js__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(15570);
800122
+ /* harmony import */ var _contracts_contracts_js__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(15570);
799587
800123
  /* harmony import */ var _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(53387);
799588
800124
  /* harmony import */ var _deploy_proxy_js__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(83697);
799589
800125
  /* harmony import */ var _deploy_verify_ContractVerifier_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(76939);
799590
- /* harmony import */ var _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(43313);
799591
- /* harmony import */ var _hook_updates_js__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(69203);
799592
- /* harmony import */ var _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(3612);
800126
+ /* harmony import */ var _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(43313);
800127
+ /* harmony import */ var _hook_updates_js__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(69203);
800128
+ /* harmony import */ var _hook_utils_js__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(13912);
800129
+ /* harmony import */ var _hook_types_js__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(52116);
800130
+ /* harmony import */ var _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(3612);
800131
+ /* harmony import */ var _predicate_PredicateDeployer_js__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(550);
799593
800132
  /* harmony import */ var _router_types_js__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(38230);
799594
- /* harmony import */ var _utils_decimals_js__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(27043);
799595
- /* harmony import */ var _utils_ism_js__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(764);
800133
+ /* harmony import */ var _utils_decimals_js__WEBPACK_IMPORTED_MODULE_29__ = __nccwpck_require__(27043);
800134
+ /* harmony import */ var _utils_ism_js__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(764);
799596
800135
  /* harmony import */ var _EvmWarpRouteReader_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(40945);
799597
800136
  /* harmony import */ var _EvmXERC20Module_js__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(5715);
799598
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(4169);
799599
- /* harmony import */ var _configUtils_js__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(63776);
799600
- /* harmony import */ var _contracts_js__WEBPACK_IMPORTED_MODULE_28__ = __nccwpck_require__(81504);
799601
- /* harmony import */ var _deploy_js__WEBPACK_IMPORTED_MODULE_27__ = __nccwpck_require__(19186);
800137
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_27__ = __nccwpck_require__(4169);
800138
+ /* harmony import */ var _configUtils_js__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(63776);
800139
+ /* harmony import */ var _contracts_js__WEBPACK_IMPORTED_MODULE_31__ = __nccwpck_require__(81504);
800140
+ /* harmony import */ var _deploy_js__WEBPACK_IMPORTED_MODULE_30__ = __nccwpck_require__(19186);
799602
800141
  /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(38466);
799603
800142
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_EvmXERC20Module_js__WEBPACK_IMPORTED_MODULE_11__]);
799604
800143
  _EvmXERC20Module_js__WEBPACK_IMPORTED_MODULE_11__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
@@ -799623,6 +800162,9 @@ _EvmXERC20Module_js__WEBPACK_IMPORTED_MODULE_11__ = (__webpack_async_dependencie
799623
800162
 
799624
800163
 
799625
800164
 
800165
+
800166
+
800167
+
799626
800168
 
799627
800169
 
799628
800170
 
@@ -799667,6 +800209,11 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
799667
800209
  /**
799668
800210
  * Updates the Warp Route contract with the provided configuration.
799669
800211
  *
800212
+ * IMPORTANT — irreversible side effects when expectedConfig includes `predicateWrapper`:
800213
+ * The PredicateRouterWrapper contract is deployed on-chain during planning (before this
800214
+ * method returns). If the returned transactions are never submitted, the wrapper is
800215
+ * orphaned. See PredicateWrapperDeployer.deployAndConfigure for details.
800216
+ *
799670
800217
  * @param expectedConfig - The configuration for the token router to be updated.
799671
800218
  * @returns An array of Ethereum transactions that were executed to update the contract, or an error if the update failed.
799672
800219
  */
@@ -799685,8 +800232,10 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
799685
800232
  * 1. createOwnershipUpdateTxs() must always be LAST because no updates possible after ownership transferred
799686
800233
  * 2. createEnrollRemoteRoutersUpdateTxs() must be BEFORE createSetDestinationGasUpdateTxs()
799687
800234
  * because GasRouter requires routers to be enrolled before setting destination gas
800235
+ * 3. createHookAndPredicateUpdateTxs() handles hook + predicate wrapper together so the
800236
+ * pending new hook address is threaded through without leaking into other method signatures
799688
800237
  */
799689
- transactions.push(...(await this.upgradeWarpRouteImplementationTx(actualConfig, expectedConfig)), ...(await this.createIsmUpdateTxs(actualConfig, expectedConfig)), ...(await this.createHookUpdateTxs(actualConfig, expectedConfig)), ...(await this.createTokenFeeUpdateTxs(actualConfig, expectedConfig, tokenReaderParams)), ...this.createUnenrollRemoteRoutersUpdateTxs(actualConfig, expectedConfig), ...this.createEnrollRemoteRoutersUpdateTxs(actualConfig, expectedConfig),
800238
+ transactions.push(...(await this.upgradeWarpRouteImplementationTx(actualConfig, expectedConfig)), ...(await this.createIsmUpdateTxs(actualConfig, expectedConfig)), ...(await this.createHookAndPredicateUpdateTxs(actualConfig, expectedConfig)), ...(await this.createTokenFeeUpdateTxs(actualConfig, expectedConfig, tokenReaderParams)), ...this.createUnenrollRemoteRoutersUpdateTxs(actualConfig, expectedConfig), ...this.createEnrollRemoteRoutersUpdateTxs(actualConfig, expectedConfig),
799690
800239
  // MC unenroll before enroll for consistency with remote routers.
799691
800240
  // MC enrollment must come before gas setting so that MC-only domains
799692
800241
  ...this.createUnenrollCrossCollateralRoutersTxs(actualConfig, expectedConfig), ...this.createEnrollCrossCollateralRoutersTxs(actualConfig, expectedConfig), ...this.createSetDestinationGasUpdateTxs(actualConfig, expectedConfig), ...this.createAddRebalancersUpdateTxs(actualConfig, expectedConfig), ...this.createRemoveRebalancersUpdateTxs(actualConfig, expectedConfig), ...(await this.createAddAllowedBridgesUpdateTxs(actualConfig, expectedConfig)), ...this.createRemoveBridgesTxs(actualConfig, expectedConfig), ...this.createAddRemoteOutputAssetsTxs(actualConfig, expectedConfig), ...this.createRemoveRemoteOutputAssetsTxs(actualConfig, expectedConfig), ...this.createUpdateEverclearFeeParamsTxs(actualConfig, expectedConfig), ...this.createRemoveEverclearFeeParamsTxs(actualConfig, expectedConfig), ...this.createSetMaxFeePpmTxs(actualConfig, expectedConfig), ...xerc20Txs, ...this.createOwnershipUpdateTxs(actualConfig, expectedConfig), ...(0,_deploy_proxy_js__WEBPACK_IMPORTED_MODULE_12__/* .proxyAdminUpdateTxs */ .CK)(this.chainId, this.args.addresses.deployedTokenRoute, actualConfig, expectedConfig));
@@ -800163,24 +800712,257 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800163
800712
  return updateTransactions;
800164
800713
  }
800165
800714
  async createHookUpdateTxs(actualConfig, expectedConfig) {
800166
- if (!expectedConfig.hook) {
800167
- return [];
800715
+ return this.createHookAndPredicateUpdateTxs(actualConfig, expectedConfig);
800716
+ }
800717
+ /**
800718
+ * Deploys hook updates and predicate wrapper together so the post-update hook address
800719
+ * is available to deployAndConfigure without a stale on-chain read.
800720
+ */
800721
+ async createHookAndPredicateUpdateTxs(actualConfig, expectedConfig) {
800722
+ let hookTransactions = [];
800723
+ let newHookAddress;
800724
+ // Explicit type annotation narrows away the undefined that TypeScript infers
800725
+ // from the RouterConfig & DerivedMailboxClientConfig intersection.
800726
+ const actualHook = actualConfig.hook;
800727
+ // Predicate removal: on-chain wrapper exists but expected config omits it.
800728
+ // When the user provides an explicit hook that differs from the underlying hook
800729
+ // (predicate stripped), the hook-diff path generates the setHook to the new hook.
800730
+ // Otherwise (no hook, or a stale aggregation from a warp read), the
800731
+ // needsPredicateRemoval block below clears the hook to zero so the router uses the
800732
+ // mailbox default — the user who removed predicateWrapper without supplying a
800733
+ // replacement hook wants the default behavior restored, not the underlying sub-hook
800734
+ // silently preserved.
800735
+ const needsPredicateRemoval = actualConfig.predicateWrapper != null && !expectedConfig.predicateWrapper;
800736
+ // Treat a zero-address hook the same as "no explicit hook": expandWarpDeployConfig
800737
+ // sets hook: zeroAddress as a default when the user config omits the hook field.
800738
+ // EvmHookModule.update(zeroAddress) returns [] early without updating deployedHook,
800739
+ // so a zero-address target produces no setHook tx and the predicate removal branch
800740
+ // would never be reached. Exclude zero addresses so needsPredicateRemoval can fire.
800741
+ if (expectedConfig.hook &&
800742
+ (typeof expectedConfig.hook !== 'string' ||
800743
+ !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isZeroishAddress */ .Hi)(expectedConfig.hook))) {
800744
+ const proxyAdminAddress = expectedConfig.proxyAdmin?.address ?? actualConfig.proxyAdmin?.address;
800745
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(proxyAdminAddress, 'ProxyAdmin address is undefined');
800746
+ // The reader leaves the PREDICATE sub-hook inside actualConfig.hook
800747
+ // (e.g. Agg([Predicate, IGP])). When expectedConfig is derived from
800748
+ // actualConfig (e.g. during the enrollment step after initial deploy, OR
800749
+ // during a read→edit→apply round-trip where the operator removed predicateWrapper
800750
+ // but kept the hook field unchanged), expectedConfig.hook carries the same
800751
+ // aggregation. Strip the predicate from BOTH sides so the hook diff sees the bare
800752
+ // hook (e.g. IGP) on both sides and doesn't generate a spurious setHook.
800753
+ // The needsPredicateRemoval block below then fires to clear the hook to zero.
800754
+ const shouldStripHookForComparison = !!expectedConfig.predicateWrapper || needsPredicateRemoval;
800755
+ const actualHookForComparison = shouldStripHookForComparison
800756
+ ? (0,_hook_utils_js__WEBPACK_IMPORTED_MODULE_17__/* .stripPredicateSubHook */ .B)(actualHook)
800757
+ : actualHook;
800758
+ const expectedHookForComparison = shouldStripHookForComparison && expectedConfig.hook
800759
+ ? (0,_hook_utils_js__WEBPACK_IMPORTED_MODULE_17__/* .stripPredicateSubHook */ .B)(expectedConfig.hook)
800760
+ : expectedConfig.hook;
800761
+ const result = await (0,_hook_updates_js__WEBPACK_IMPORTED_MODULE_18__/* .getEvmHookUpdateTransactions */ .m)(this.args.addresses.deployedTokenRoute, {
800762
+ actualConfig: actualHookForComparison,
800763
+ expectedConfig: expectedHookForComparison,
800764
+ ccipContractCache: this.ccipContractCache,
800765
+ contractVerifier: this.contractVerifier,
800766
+ evmChainName: this.chainName,
800767
+ hookAndIsmFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_19__/* .extractIsmAndHookFactoryAddresses */ .zs)(this.args.addresses),
800768
+ setHookFunctionCallEncoder: (addr) => _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .MailboxClient__factory */ .mG7.createInterface().encodeFunctionData('setHook', [addr]),
800769
+ logger: this.logger,
800770
+ mailbox: actualConfig.mailbox,
800771
+ multiProvider: this.multiProvider,
800772
+ proxyAdminAddress,
800773
+ });
800774
+ hookTransactions = result.transactions;
800775
+ newHookAddress = result.newHookAddress;
800776
+ }
800777
+ // Predicate removal when no new hook was deployed: clear the custom hook entirely.
800778
+ // This fires whether or not expectedConfig.hook was provided — it handles both the
800779
+ // "no hook field" case and the round-trip hazard where the operator removed
800780
+ // predicateWrapper but left an unchanged hook field (still containing the aggregation).
800781
+ if (needsPredicateRemoval && !newHookAddress) {
800782
+ const currentAddress = typeof actualHook === 'string' ? actualHook : actualHook.address;
800783
+ if (!(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isZeroishAddress */ .Hi)(currentAddress)) {
800784
+ this.logger.debug({ chain: this.chainName }, 'Removing predicate wrapper: generating setHook(zero) to clear custom hook');
800785
+ hookTransactions.push({
800786
+ annotation: 'Remove predicate wrapper: clear custom hook (router will use mailbox default)',
800787
+ chainId: this.chainId,
800788
+ to: this.args.addresses.deployedTokenRoute,
800789
+ data: _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .MailboxClient__factory */ .mG7.createInterface().encodeFunctionData('setHook', [ethers__WEBPACK_IMPORTED_MODULE_20__.constants.AddressZero]),
800790
+ });
800791
+ }
800168
800792
  }
800169
- const proxyAdminAddress = expectedConfig.proxyAdmin?.address ?? actualConfig.proxyAdmin?.address;
800170
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(proxyAdminAddress, 'ProxyAdmin address is undefined');
800171
- return (0,_hook_updates_js__WEBPACK_IMPORTED_MODULE_17__/* .getEvmHookUpdateTransactions */ .m)(this.args.addresses.deployedTokenRoute, {
800172
- actualConfig: actualConfig.hook,
800173
- expectedConfig: expectedConfig.hook,
800174
- ccipContractCache: this.ccipContractCache,
800175
- contractVerifier: this.contractVerifier,
800176
- evmChainName: this.chainName,
800177
- hookAndIsmFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_18__/* .extractIsmAndHookFactoryAddresses */ .zs)(this.args.addresses),
800178
- setHookFunctionCallEncoder: (newHookAddress) => _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .MailboxClient__factory */ .mG7.createInterface().encodeFunctionData('setHook', [newHookAddress]),
800179
- logger: this.logger,
800180
- mailbox: actualConfig.mailbox,
800181
- multiProvider: this.multiProvider,
800182
- proxyAdminAddress,
800183
- });
800793
+ const { transactions: predicateTransactions, deploysNewWrapper } = await this.createPredicateWrapperUpdateTxs(actualConfig, expectedConfig, newHookAddress);
800794
+ // When predicate wrapper is being deployed, its setHook(aggregation) sets the final
800795
+ // router hook and already incorporates newHookAddress inside the aggregation.
800796
+ // Drop the intermediate setHook(newHookAddress) from hookTransactions to avoid a
800797
+ // redundant write that would be immediately overwritten.
800798
+ //
800799
+ // IMPORTANT: only drop when a NEW wrapper is being deployed. The ownership-only
800800
+ // path (deploysNewWrapper=false) must not suppress the hook update even though
800801
+ // predicateTransactions is non-empty.
800802
+ const effectiveHookTransactions = hookTransactions.length > 0 && deploysNewWrapper
800803
+ ? hookTransactions.filter((tx) => !(tx.to &&
800804
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(tx.to, this.args.addresses.deployedTokenRoute) &&
800805
+ tx.data?.startsWith(_hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .MailboxClient__factory */ .mG7.createInterface().getSighash('setHook'))))
800806
+ : hookTransactions;
800807
+ return [...effectiveHookTransactions, ...predicateTransactions];
800808
+ }
800809
+ /**
800810
+ * Searches the current on-chain hook tree for a PredicateRouterWrapper that
800811
+ * matches by registry and policyId. Returns the wrapper address and its current
800812
+ * on-chain owner when found, undefined otherwise.
800813
+ *
800814
+ * Uses unbounded recursion into aggregation hooks (consistent with
800815
+ * EvmTokenAdapter.findPredicateWrapperInHook and EvmWarpRouteReader.findPredicateAddressInHook).
800816
+ */
800817
+ async findDeployedPredicateWrapper(actualConfig, expectedPredicateConfig) {
800818
+ const hookAddress = (0,_types_js__WEBPACK_IMPORTED_MODULE_10__/* .derivedHookAddress */ .Lm)(actualConfig);
800819
+ if (!hookAddress || (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isZeroishAddress */ .Hi)(hookAddress))
800820
+ return undefined;
800821
+ try {
800822
+ const provider = this.multiProvider.getProvider(this.domainId);
800823
+ return await this.searchPredicateInHook(hookAddress, provider, expectedPredicateConfig);
800824
+ }
800825
+ catch (error) {
800826
+ this.logger.debug({ chain: this.chainName, error }, 'Error checking predicate wrapper deployment');
800827
+ }
800828
+ return undefined;
800829
+ }
800830
+ /**
800831
+ * Recursively searches a hook tree for a matching PredicateRouterWrapper.
800832
+ * Descends into StaticAggregationHook sub-hooks without depth limit.
800833
+ */
800834
+ async searchPredicateInHook(hookAddr, provider, expectedPredicateConfig) {
800835
+ const match = await this.matchPredicateWrapper(hookAddr, provider, expectedPredicateConfig);
800836
+ if (match)
800837
+ return match;
800838
+ let subHooks;
800839
+ try {
800840
+ subHooks = await _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .StaticAggregationHook__factory */ ._ok.connect(hookAddr, provider).hooks('0x');
800841
+ }
800842
+ catch {
800843
+ // Any call failure means hookAddr is not a StaticAggregationHook.
800844
+ // HyperlaneSmartProvider wraps CALL_EXCEPTION as "Invalid response from provider"
800845
+ // with code: undefined, so checking error.code is insufficient.
800846
+ return undefined;
800847
+ }
800848
+ for (const subHook of subHooks) {
800849
+ const found = await this.searchPredicateInHook(subHook, provider, expectedPredicateConfig);
800850
+ if (found)
800851
+ return found;
800852
+ }
800853
+ return undefined;
800854
+ }
800855
+ /**
800856
+ * Checks whether a single hook address is a PredicateRouterWrapper matching
800857
+ * the warp route and expected config. Returns the match or undefined.
800858
+ */
800859
+ async matchPredicateWrapper(hookAddr, provider, expectedPredicateConfig) {
800860
+ try {
800861
+ const predicateWrapper = _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .PredicateRouterWrapper__factory */ .sYb.connect(hookAddr, provider);
800862
+ // Verify identity: warpRoute + hookType confirm it's a PredicateRouterWrapper
800863
+ // for this route. Then compare registry + policyId so config rotations
800864
+ // (e.g. changing compliance policy) trigger a redeploy rather than silently no-op.
800865
+ const [warpRoute, hookType, onchainRegistry, onchainPolicyId, onchainOwner,] = await Promise.all([
800866
+ predicateWrapper.warpRoute(),
800867
+ predicateWrapper.hookType(),
800868
+ predicateWrapper.getRegistry(),
800869
+ predicateWrapper.getPolicyID(),
800870
+ predicateWrapper.owner(),
800871
+ ]);
800872
+ if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(warpRoute, this.args.addresses.deployedTokenRoute) &&
800873
+ hookType === _hook_types_js__WEBPACK_IMPORTED_MODULE_21__/* .OnchainHookType */ .c0.PREDICATE_ROUTER_WRAPPER &&
800874
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(onchainRegistry, expectedPredicateConfig.predicateRegistry) &&
800875
+ onchainPolicyId === expectedPredicateConfig.policyId) {
800876
+ return { address: hookAddr, onchainOwner };
800877
+ }
800878
+ }
800879
+ catch {
800880
+ // Any call failure means hookAddr is not a PredicateRouterWrapper.
800881
+ // HyperlaneSmartProvider wraps CALL_EXCEPTION as "Invalid response from provider"
800882
+ // with code: undefined, so checking error.code === 'CALL_EXCEPTION' is insufficient.
800883
+ return undefined;
800884
+ }
800885
+ return undefined;
800886
+ }
800887
+ /**
800888
+ * Check if predicate wrapper is already deployed with fully matching config
800889
+ * (registry, policyId, and owner).
800890
+ *
800891
+ * @param actualConfig - The on-chain router configuration.
800892
+ * @param expectedPredicateConfig - The expected predicate wrapper configuration.
800893
+ * @returns True if wrapper is deployed with all fields matching, false otherwise.
800894
+ */
800895
+ async isPredicateWrapperDeployed(actualConfig, expectedPredicateConfig) {
800896
+ const found = await this.findDeployedPredicateWrapper(actualConfig, expectedPredicateConfig);
800897
+ return (found !== undefined &&
800898
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(found.onchainOwner, expectedPredicateConfig.owner));
800899
+ }
800900
+ /**
800901
+ * Create transactions to deploy predicate wrapper and update hook.
800902
+ *
800903
+ * @param actualConfig - The on-chain router configuration.
800904
+ * @param expectedConfig - The expected token router configuration.
800905
+ * @returns transactions to execute and whether a new wrapper is being deployed.
800906
+ * deploysNewWrapper=true means the predicate emits its own setHook(aggregation)
800907
+ * that supersedes any hook update in the same batch.
800908
+ */
800909
+ async createPredicateWrapperUpdateTxs(actualConfig, expectedConfig, pendingHookAddress) {
800910
+ // Only proceed if expectedConfig has predicateWrapper
800911
+ if (!('predicateWrapper' in expectedConfig) ||
800912
+ !expectedConfig.predicateWrapper) {
800913
+ return { transactions: [], deploysNewWrapper: false };
800914
+ }
800915
+ const predicateWrapperConfig = _types_js__WEBPACK_IMPORTED_MODULE_10__/* .PredicateWrapperConfigSchema */ .Ky.parse(expectedConfig.predicateWrapper);
800916
+ // Check if a wrapper matching by registry+policyId already exists on-chain.
800917
+ // If so, only a transferOwnership tx is needed (not a full redeploy).
800918
+ const existingWrapper = await this.findDeployedPredicateWrapper(actualConfig, predicateWrapperConfig);
800919
+ if (existingWrapper) {
800920
+ if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(existingWrapper.onchainOwner, predicateWrapperConfig.owner)) {
800921
+ this.logger.debug({ chain: this.chainName }, 'Predicate wrapper already deployed with matching config, skipping');
800922
+ return { transactions: [], deploysNewWrapper: false };
800923
+ }
800924
+ // Owner changed — generate a transferOwnership tx without redeploying.
800925
+ this.logger.debug({ chain: this.chainName, wrapper: existingWrapper.address }, 'Predicate wrapper owner changed, generating transferOwnership transaction');
800926
+ const transferOwnershipTx = await _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .PredicateRouterWrapper__factory */ .sYb.connect(existingWrapper.address, this.multiProvider.getProvider(this.chainName)).populateTransaction.transferOwnership(predicateWrapperConfig.owner);
800927
+ return {
800928
+ transactions: [
800929
+ {
800930
+ ...transferOwnershipTx,
800931
+ chainId: this.chainId,
800932
+ annotation: `Transferring predicate wrapper ownership to ${predicateWrapperConfig.owner}`,
800933
+ },
800934
+ ],
800935
+ deploysNewWrapper: false,
800936
+ };
800937
+ }
800938
+ const staticAggregationHookFactory = this.args.addresses.staticAggregationHookFactory;
800939
+ if (!staticAggregationHookFactory) {
800940
+ throw new Error(`staticAggregationHookFactory not found for ${this.chainName}. Ensure proxy factories are deployed.`);
800941
+ }
800942
+ const signer = this.multiProvider.getSigner(this.chainName);
800943
+ const factory = _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_1__/* .StaticAggregationHookFactory__factory */ .KZH.connect(staticAggregationHookFactory, signer);
800944
+ const predicateDeployer = new _predicate_PredicateDeployer_js__WEBPACK_IMPORTED_MODULE_22__/* .PredicateWrapperDeployer */ .t(this.multiProvider, factory, this.logger);
800945
+ // Deploy predicate wrapper and get addresses.
800946
+ // Pass token type to deploy the appropriate wrapper.
800947
+ // Pass pendingHookAddress (if any) so deployAndConfigure uses the post-update hook
800948
+ // instead of reading the stale on-chain value when hook and predicate wrapper are
800949
+ // both being changed in the same update() call.
800950
+ const result = await predicateDeployer.deployAndConfigure(this.chainName, this.args.addresses.deployedTokenRoute, predicateWrapperConfig, expectedConfig.type, pendingHookAddress);
800951
+ this.logger.info({
800952
+ chain: this.chainName,
800953
+ wrapper: result.wrapperAddress,
800954
+ aggregationHook: result.aggregationHookAddress,
800955
+ }, 'Predicate wrapper deployed, returning setHook transaction');
800956
+ return {
800957
+ transactions: [
800958
+ {
800959
+ annotation: 'Set aggregation hook wrapping PredicateRouterWrapper on warp route',
800960
+ chainId: this.chainId,
800961
+ ...result.setHookTx,
800962
+ },
800963
+ ],
800964
+ deploysNewWrapper: true,
800965
+ };
800184
800966
  }
800185
800967
  /**
800186
800968
  * Create transactions to update token fee configuration.
@@ -800194,16 +800976,16 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800194
800976
  return [];
800195
800977
  }
800196
800978
  const routerAddress = this.args.addresses.deployedTokenRoute;
800197
- const resolvedTokenFee = (0,_configUtils_js__WEBPACK_IMPORTED_MODULE_19__/* .resolveTokenFeeAddress */ .i0)(expectedConfig.tokenFee, routerAddress, expectedConfig);
800979
+ const resolvedTokenFee = (0,_configUtils_js__WEBPACK_IMPORTED_MODULE_23__/* .resolveTokenFeeAddress */ .i0)(expectedConfig.tokenFee, routerAddress, expectedConfig);
800198
800980
  const currentTokenFee = actualConfig.tokenFee;
800199
800981
  if (!currentTokenFee) {
800200
800982
  this.logger.info('No existing token fee found, creating new one');
800201
- const expandedExpectedConfig = await _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_20__/* .EvmTokenFeeModule */ .e.expandConfig({
800983
+ const expandedExpectedConfig = await _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_24__/* .EvmTokenFeeModule */ .e.expandConfig({
800202
800984
  config: resolvedTokenFee,
800203
800985
  multiProvider: this.multiProvider,
800204
800986
  chainName: this.chainName,
800205
800987
  });
800206
- const tokenFeeModule = await _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_20__/* .EvmTokenFeeModule */ .e.create({
800988
+ const tokenFeeModule = await _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_24__/* .EvmTokenFeeModule */ .e.create({
800207
800989
  multiProvider: this.multiProvider,
800208
800990
  chain: this.chainName,
800209
800991
  config: expandedExpectedConfig,
@@ -800216,7 +800998,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800216
800998
  .feeRecipient()
800217
800999
  .catch((error) => {
800218
801000
  this.logger.warn(`Failed to read feeRecipient, defaulting to generate setFeeRecipient tx`, error);
800219
- return ethers__WEBPACK_IMPORTED_MODULE_21__.constants.AddressZero;
801001
+ return ethers__WEBPACK_IMPORTED_MODULE_20__.constants.AddressZero;
800220
801002
  });
800221
801003
  if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .eqAddress */ .fv)(currentFeeRecipient, deployedFee)) {
800222
801004
  return [];
@@ -800231,7 +801013,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800231
801013
  ];
800232
801014
  }
800233
801015
  this.logger.info('Updating existing token fee configuration');
800234
- const tokenFeeModule = new _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_20__/* .EvmTokenFeeModule */ .e(this.multiProvider, {
801016
+ const tokenFeeModule = new _fee_EvmTokenFeeModule_js__WEBPACK_IMPORTED_MODULE_24__/* .EvmTokenFeeModule */ .e(this.multiProvider, {
800235
801017
  chain: this.chainName,
800236
801018
  config: currentTokenFee,
800237
801019
  addresses: {
@@ -800259,7 +801041,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800259
801041
  * @returns Ethereum transaction that need to be executed to update the owner.
800260
801042
  */
800261
801043
  createOwnershipUpdateTxs(actualConfig, expectedConfig) {
800262
- return (0,_contracts_contracts_js__WEBPACK_IMPORTED_MODULE_22__/* .transferOwnershipTransactions */ .Yg)(this.multiProvider.getEvmChainId(this.args.chain), this.args.addresses.deployedTokenRoute, actualConfig, expectedConfig, `${expectedConfig.type} Warp Route`);
801044
+ return (0,_contracts_contracts_js__WEBPACK_IMPORTED_MODULE_25__/* .transferOwnershipTransactions */ .Yg)(this.multiProvider.getEvmChainId(this.args.chain), this.args.addresses.deployedTokenRoute, actualConfig, expectedConfig, `${expectedConfig.type} Warp Route`);
800263
801045
  }
800264
801046
  /**
800265
801047
  * Updates or deploys the ISM using the provided configuration.
@@ -800275,7 +801057,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800275
801057
  updateTransactions: [],
800276
801058
  };
800277
801059
  }
800278
- const ismModule = new _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_23__/* .EvmIsmModule */ .a(this.multiProvider, {
801060
+ const ismModule = new _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_26__/* .EvmIsmModule */ .a(this.multiProvider, {
800279
801061
  chain: this.args.chain,
800280
801062
  config: actualConfig.interchainSecurityModule,
800281
801063
  addresses: {
@@ -800298,7 +801080,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800298
801080
  */
800299
801081
  async upgradeWarpRouteImplementationTx(actualConfig, expectedConfig) {
800300
801082
  const updateTransactions = [];
800301
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(expectedConfig.type !== _config_js__WEBPACK_IMPORTED_MODULE_24__/* .TokenType */ .ks.unknown, 'Cannot upgrade warp route with unknown token type');
801083
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(expectedConfig.type !== _config_js__WEBPACK_IMPORTED_MODULE_27__/* .TokenType */ .ks.unknown, 'Cannot upgrade warp route with unknown token type');
800302
801084
  // This should be impossible since we try catch the call to `PACKAGE_VERSION`
800303
801085
  // in `EvmWarpRouteReader.fetchPackageVersion`
800304
801086
  (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(actualConfig.contractVersion, 'Actual contract version is undefined');
@@ -800306,7 +801088,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800306
801088
  if (!expectedConfig.contractVersion) {
800307
801089
  return [];
800308
801090
  }
800309
- const comparisonValue = (0,compare_versions__WEBPACK_IMPORTED_MODULE_25__.compareVersions)(expectedConfig.contractVersion, actualConfig.contractVersion);
801091
+ const comparisonValue = (0,compare_versions__WEBPACK_IMPORTED_MODULE_28__.compareVersions)(expectedConfig.contractVersion, actualConfig.contractVersion);
800310
801092
  // Expected version is lower than actual version, no upgrade is possible
800311
801093
  if (comparisonValue === -1) {
800312
801094
  throw new Error(`Expected contract version ${expectedConfig.contractVersion} is lower than actual contract version ${actualConfig.contractVersion}`);
@@ -800321,13 +801103,13 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800321
801103
  // Scale values are immutables baked into the implementation bytecode.
800322
801104
  // Changing the effective scale during an upgrade would cause in-flight
800323
801105
  // messages to be decoded with incorrect scaling.
800324
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)((0,_utils_decimals_js__WEBPACK_IMPORTED_MODULE_26__/* .scalesEqual */ .gm)(actualConfig.scale, expectedConfig.scale), `Scale change detected during upgrade. ` +
801106
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)((0,_utils_decimals_js__WEBPACK_IMPORTED_MODULE_29__/* .scalesEqual */ .gm)(actualConfig.scale, expectedConfig.scale), `Scale change detected during upgrade. ` +
800325
801107
  `Changing scale on an existing deployment may cause in-flight messages to be decoded incorrectly.`);
800326
801108
  this.logger.info(`Upgrading Warp Route implementation on ${this.args.chain} from ${actualConfig.contractVersion} to ${expectedConfig.contractVersion}`);
800327
- const deployer = new _deploy_js__WEBPACK_IMPORTED_MODULE_27__/* .HypERC20Deployer */ .A7(this.multiProvider);
801109
+ const deployer = new _deploy_js__WEBPACK_IMPORTED_MODULE_30__/* .HypERC20Deployer */ .A7(this.multiProvider);
800328
801110
  const constructorArgs = await deployer.constructorArgs(this.chainName, expectedConfig);
800329
801111
  const tokenType = expectedConfig.type;
800330
- const implementation = await deployer.deployContractWithName(this.chainName, tokenType, _contracts_js__WEBPACK_IMPORTED_MODULE_28__/* .hypERC20contracts */ .LW[tokenType], constructorArgs, undefined, false);
801112
+ const implementation = await deployer.deployContractWithName(this.chainName, tokenType, _contracts_js__WEBPACK_IMPORTED_MODULE_31__/* .hypERC20contracts */ .LW[tokenType], constructorArgs, undefined, false);
800331
801113
  const provider = this.multiProvider.getProvider(this.domainId);
800332
801114
  const proxyAddress = this.args.addresses.deployedTokenRoute;
800333
801115
  const proxyAdminAddress = await (0,_deploy_proxy_js__WEBPACK_IMPORTED_MODULE_12__/* .proxyAdmin */ .Ey)(provider, proxyAddress);
@@ -800356,9 +801138,9 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800356
801138
  // proxy upgrade. Always emit setMaxFeePpm in this case.
800357
801139
  const crossingPpmBoundary = actualConfig.contractVersion &&
800358
801140
  expectedConfig.contractVersion &&
800359
- (0,compare_versions__WEBPACK_IMPORTED_MODULE_25__.compareVersions)(actualConfig.contractVersion, _EvmWarpRouteReader_js__WEBPACK_IMPORTED_MODULE_7__/* .CCTP_PPM_STORAGE_VERSION */ .EY) <
801141
+ (0,compare_versions__WEBPACK_IMPORTED_MODULE_28__.compareVersions)(actualConfig.contractVersion, _EvmWarpRouteReader_js__WEBPACK_IMPORTED_MODULE_7__/* .CCTP_PPM_STORAGE_VERSION */ .EY) <
800360
801142
  0 &&
800361
- (0,compare_versions__WEBPACK_IMPORTED_MODULE_25__.compareVersions)(expectedConfig.contractVersion, _EvmWarpRouteReader_js__WEBPACK_IMPORTED_MODULE_7__/* .CCTP_PPM_STORAGE_VERSION */ .EY) >= 0;
801143
+ (0,compare_versions__WEBPACK_IMPORTED_MODULE_28__.compareVersions)(expectedConfig.contractVersion, _EvmWarpRouteReader_js__WEBPACK_IMPORTED_MODULE_7__/* .CCTP_PPM_STORAGE_VERSION */ .EY) >= 0;
800362
801144
  if (!crossingPpmBoundary && actualMaxFeeBps === expectedConfig.maxFeeBps) {
800363
801145
  return [];
800364
801146
  }
@@ -800383,7 +801165,7 @@ class EvmWarpModule extends _core_AbstractHyperlaneModule_js__WEBPACK_IMPORTED_M
800383
801165
  static async create(params) {
800384
801166
  const { chain, config, multiProvider, ccipContractCache, contractVerifier, proxyFactoryFactories, } = params;
800385
801167
  const chainName = multiProvider.getChainName(chain);
800386
- const deployer = new _deploy_js__WEBPACK_IMPORTED_MODULE_27__/* .HypERC20Deployer */ .A7(multiProvider);
801168
+ const deployer = new _deploy_js__WEBPACK_IMPORTED_MODULE_30__/* .HypERC20Deployer */ .A7(multiProvider);
800387
801169
  const deployedContracts = await deployer.deployContracts(chainName, config);
800388
801170
  const warpModule = new EvmWarpModule(multiProvider, {
800389
801171
  addresses: {
@@ -800494,6 +801276,8 @@ var VerifyContractTypes;
800494
801276
  var EvmTokenFeeReader = __nccwpck_require__(73772);
800495
801277
  // EXTERNAL MODULE: ../sdk/dist/hook/EvmHookReader.js
800496
801278
  var EvmHookReader = __nccwpck_require__(69319);
801279
+ // EXTERNAL MODULE: ../sdk/dist/hook/types.js
801280
+ var types = __nccwpck_require__(52116);
800497
801281
  // EXTERNAL MODULE: ../sdk/dist/ism/EvmIsmReader.js
800498
801282
  var EvmIsmReader = __nccwpck_require__(60715);
800499
801283
  // EXTERNAL MODULE: ../sdk/dist/router/EvmRouterReader.js
@@ -800503,7 +801287,7 @@ var proxy = __nccwpck_require__(83697);
800503
801287
  // EXTERNAL MODULE: ../sdk/dist/token/config.js
800504
801288
  var token_config = __nccwpck_require__(4169);
800505
801289
  // EXTERNAL MODULE: ../sdk/dist/token/types.js
800506
- var types = __nccwpck_require__(38466);
801290
+ var token_types = __nccwpck_require__(38466);
800507
801291
  // EXTERNAL MODULE: ../sdk/dist/token/xerc20.js + 1 modules
800508
801292
  var xerc20 = __nccwpck_require__(32892);
800509
801293
  ;// CONCATENATED MODULE: ../sdk/dist/token/EvmWarpRouteReader.js
@@ -800525,6 +801309,7 @@ var xerc20 = __nccwpck_require__(32892);
800525
801309
 
800526
801310
 
800527
801311
 
801312
+
800528
801313
  const REBALANCING_CONTRACT_VERSION = '8.0.0';
800529
801314
  const TOKEN_FEE_CONTRACT_VERSION = '10.0.0';
800530
801315
  // version that introduced the fractional scale interface
@@ -800616,7 +801401,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800616
801401
  ? await this.fetchProxyAdminConfig(warpRouteAddress)
800617
801402
  : undefined;
800618
801403
  const ccrEnrolledDomains = [];
800619
- if ((0,types/* isCrossCollateralTokenConfig */.v3)(tokenConfig) &&
801404
+ if ((0,token_types/* isCrossCollateralTokenConfig */.v3)(tokenConfig) &&
800620
801405
  tokenConfig.crossCollateralRouters) {
800621
801406
  for (const domain of Object.keys(tokenConfig.crossCollateralRouters)) {
800622
801407
  ccrEnrolledDomains.push(Number(domain));
@@ -800639,7 +801424,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800639
801424
  let domains;
800640
801425
  // Only movable collateral tokens (collateral/native) have rebalancing config
800641
801426
  if (hasRebalancingInterface &&
800642
- (0,types/* isMovableCollateralTokenConfig */.zW)(tokenConfig)) {
801427
+ (0,token_types/* isMovableCollateralTokenConfig */.zW)(tokenConfig)) {
800643
801428
  const movableToken = dist/* MovableCollateralRouter__factory */.L6v.connect(warpRouteAddress, this.provider);
800644
801429
  try {
800645
801430
  allowedRebalancers = await dist/* MovableCollateralRouter__factory */.L6v.connect(warpRouteAddress, this.provider).allowedRebalancers();
@@ -800666,7 +801451,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800666
801451
  const feeDestinations = [
800667
801452
  ...new Set([...(domains ?? []), ...ccrEnrolledDomains]),
800668
801453
  ];
800669
- const tokenFee = await this.fetchTokenFee(warpRouteAddress, feeDestinations.length ? feeDestinations : undefined, (0,types/* isCrossCollateralTokenConfig */.v3)(tokenConfig)
801454
+ const tokenFee = await this.fetchTokenFee(warpRouteAddress, feeDestinations.length ? feeDestinations : undefined, (0,token_types/* isCrossCollateralTokenConfig */.v3)(tokenConfig)
800670
801455
  ? tokenConfig.crossCollateralRouters
800671
801456
  : undefined);
800672
801457
  // CCTP tokens implement their own ISM (the contract itself acts as the ISM via AbstractCcipReadIsm).
@@ -800675,6 +801460,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800675
801460
  'interchainSecurityModule' in routerConfig) {
800676
801461
  routerConfig.interchainSecurityModule = lib.constants.AddressZero;
800677
801462
  }
801463
+ const predicateWrapper = await this.derivePredicateWrapperConfig(routerConfig.hook);
800678
801464
  const derivedConfig = {
800679
801465
  ...routerConfig,
800680
801466
  ...tokenConfig,
@@ -800683,9 +801469,40 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800683
801469
  proxyAdmin,
800684
801470
  destinationGas,
800685
801471
  tokenFee,
801472
+ ...(predicateWrapper && { predicateWrapper }),
800686
801473
  };
800687
801474
  return derivedConfig;
800688
801475
  }
801476
+ /**
801477
+ * Searches the derived hook tree for a PredicateRouterWrapper and, if found,
801478
+ * reads its on-chain config (registry, policyId, owner).
801479
+ */
801480
+ async derivePredicateWrapperConfig(hook) {
801481
+ const predicateAddress = this.findPredicateAddressInHook(hook);
801482
+ if (!predicateAddress)
801483
+ return undefined;
801484
+ const wrapper = dist/* PredicateRouterWrapper__factory */.sYb.connect(predicateAddress, this.provider);
801485
+ const [predicateRegistry, policyId, owner] = await Promise.all([
801486
+ wrapper.getRegistry(),
801487
+ wrapper.getPolicyID(),
801488
+ wrapper.owner(),
801489
+ ]);
801490
+ return { predicateRegistry, policyId, owner };
801491
+ }
801492
+ findPredicateAddressInHook(hook) {
801493
+ if (!hook || typeof hook === 'string')
801494
+ return undefined;
801495
+ if (hook.type === types/* HookType */.WD.PREDICATE)
801496
+ return hook.address;
801497
+ if (hook.type === types/* HookType */.WD.AGGREGATION) {
801498
+ for (const sub of hook.hooks) {
801499
+ const found = this.findPredicateAddressInHook(sub);
801500
+ if (found)
801501
+ return found;
801502
+ }
801503
+ }
801504
+ return undefined;
801505
+ }
800689
801506
  async fetchTokenFee(routerAddress, destinations, crossCollateralRouters) {
800690
801507
  const TokenRouter = dist/* TokenRouter__factory */.NgW.connect(routerAddress, this.provider);
800691
801508
  const [packageVersion, tokenFee] = await Promise.all([
@@ -800728,7 +801545,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800728
801545
  : VerifyContractTypes.Implementation;
800729
801546
  if (this.multiProvider.isLocalRpc(chain)) {
800730
801547
  this.logger.debug('Skipping verification for local endpoints');
800731
- return { [contractType]: types/* ContractVerificationStatus */.qZ.Skipped };
801548
+ return { [contractType]: token_types/* ContractVerificationStatus */.qZ.Skipped };
800732
801549
  }
800733
801550
  const quietVerificationLogger = this.logger.child({ module: 'contract-verifier' }, { level: 'silent' });
800734
801551
  contractVerificationStatus[contractType] =
@@ -800747,14 +801564,14 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800747
801564
  if (this.multiProvider.isLocalRpc(chain)) {
800748
801565
  this.logger.debug('Skipping owner verification for local endpoints');
800749
801566
  return {
800750
- [address]: types/* OwnerStatus */.C1.Skipped,
801567
+ [address]: token_types/* OwnerStatus */.C1.Skipped,
800751
801568
  };
800752
801569
  }
800753
801570
  const provider = this.multiProvider.getProvider(chain);
800754
801571
  const owner = await dist/* Ownable__factory */.PhF.connect(address, provider).owner();
800755
801572
  ownerStatus[owner] = (await (0,contracts/* isAddressActive */.dw)(provider, owner))
800756
- ? types/* OwnerStatus */.C1.Active
800757
- : types/* OwnerStatus */.C1.Inactive;
801573
+ ? token_types/* OwnerStatus */.C1.Active
801574
+ : token_types/* OwnerStatus */.C1.Inactive;
800758
801575
  // Heuristically check if the owner could be a safe by calling expected functions
800759
801576
  // This status will overwrite 'active' status
800760
801577
  try {
@@ -800763,7 +801580,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800763
801580
  potentialGnosisSafe.getThreshold(),
800764
801581
  potentialGnosisSafe.nonce(),
800765
801582
  ]);
800766
- ownerStatus[owner] = types/* OwnerStatus */.C1.GnosisSafe;
801583
+ ownerStatus[owner] = token_types/* OwnerStatus */.C1.GnosisSafe;
800767
801584
  }
800768
801585
  catch {
800769
801586
  this.logger.debug(`${owner} may not be a safe`);
@@ -800979,7 +801796,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
800979
801796
  return {
800980
801797
  xERC20: {
800981
801798
  warpRouteLimits: {
800982
- type: types/* XERC20Type */.FT.Velo,
801799
+ type: token_types/* XERC20Type */.FT.Velo,
800983
801800
  rateLimitPerSecond: (await xERC20.rateLimitPerSecond(warpRouteAddress)).toString(),
800984
801801
  bufferCap: (await xERC20.bufferCap(warpRouteAddress)).toString(),
800985
801802
  },
@@ -801014,7 +801831,7 @@ class EvmWarpRouteReader extends EvmRouterReader/* EvmRouterReader */.V {
801014
801831
  (0,umd.compareVersions)(config.contractVersion, CCTP_PPM_STORAGE_VERSION) >= 0) {
801015
801832
  config.maxFeeBps = config.maxFeeBps / 100;
801016
801833
  }
801017
- return types/* HypTokenConfigSchema */.cs.parse(config);
801834
+ return token_types/* HypTokenConfigSchema */.cs.parse(config);
801018
801835
  }
801019
801836
  async deriveHypXERC20TokenConfig(hypTokenAddress) {
801020
801837
  const hypXERC20TokenInstance = dist/* HypXERC20__factory */.ewf.connect(hypTokenAddress, this.provider);
@@ -803654,6 +804471,8 @@ var MultiProtocolApp = __nccwpck_require__(48381);
803654
804471
  // type(uint256).max
803655
804472
  const UIN256_MAX_VALUE = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
803656
804473
  //# sourceMappingURL=numbers.js.map
804474
+ // EXTERNAL MODULE: ../sdk/dist/hook/types.js
804475
+ var hook_types = __nccwpck_require__(52116);
803657
804476
  // EXTERNAL MODULE: ../sdk/dist/utils/contract.js
803658
804477
  var contract = __nccwpck_require__(76709);
803659
804478
  ;// CONCATENATED MODULE: ../sdk/dist/token/adapters/utils.js
@@ -803669,6 +804488,7 @@ function buildBlockTagOverrides(blockTag) {
803669
804488
 
803670
804489
 
803671
804490
 
804491
+
803672
804492
  // Ensures an address is in EVM hex format (e.g. converts Tron bs58 addresses)
803673
804493
  const toEvmAddress = (address) => (0,addresses/* convertToProtocolAddress */.Vj)(address, types/* ProtocolType */.Hb.Ethereum);
803674
804494
  // An estimate of the gas amount for a typical EVM token router transferRemote transaction
@@ -803763,6 +804583,10 @@ class EvmHypSyntheticAdapter extends EvmTokenAdapter {
803763
804583
  multiProvider;
803764
804584
  addresses;
803765
804585
  contractFactory;
804586
+ predicateWrapperAddress;
804587
+ clearPredicateCache() {
804588
+ this.predicateWrapperAddress = undefined;
804589
+ }
803766
804590
  constructor(chainName, multiProvider, addresses, contractFactory = dist/* HypERC20__factory */.kdF) {
803767
804591
  super(chainName, multiProvider, addresses, contractFactory);
803768
804592
  this.chainName = chainName;
@@ -803771,17 +804595,100 @@ class EvmHypSyntheticAdapter extends EvmTokenAdapter {
803771
804595
  this.contractFactory = contractFactory;
803772
804596
  }
803773
804597
  async isApproveRequired(owner, spender, weiAmountOrId) {
803774
- // transferRemote burns directly from msg.sender — no approval needed.
803775
- // External spenders (e.g. QuotedCalls) need standard ERC20 approval.
803776
- if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token))
803777
- return false;
804598
+ if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token)) {
804599
+ // Synthetics with PredicateWrapper need approval to the wrapper instead.
804600
+ // Without a wrapper, transferRemote burns directly from msg.sender — no approval needed.
804601
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804602
+ if (!predicateWrapper)
804603
+ return false;
804604
+ const allowance = await this.contract.allowance(toEvmAddress(owner), predicateWrapper);
804605
+ return allowance.lt(weiAmountOrId);
804606
+ }
804607
+ // External spenders (e.g. QuotedCalls) get the standard ERC20 allowance check.
803778
804608
  return super.isApproveRequired(owner, spender, weiAmountOrId);
803779
804609
  }
803780
804610
  async isRevokeApprovalRequired(owner, spender) {
803781
- if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token))
803782
- return false;
804611
+ if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token)) {
804612
+ // When a predicate wrapper is present, allowance was granted to the wrapper.
804613
+ // Check whether the wrapper has a non-zero allowance that must be revoked first
804614
+ // (relevant for USDT-like tokens that require zeroing before re-approval).
804615
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804616
+ if (!predicateWrapper)
804617
+ return false;
804618
+ return super.isRevokeApprovalRequired(owner, predicateWrapper);
804619
+ }
803783
804620
  return super.isRevokeApprovalRequired(owner, spender);
803784
804621
  }
804622
+ async populateApproveTx(params) {
804623
+ if ((0,addresses/* eqAddress */.fv)(params.recipient, this.addresses.token)) {
804624
+ // Synthetics with PredicateWrapper approve the wrapper, not the route contract
804625
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804626
+ if (predicateWrapper) {
804627
+ return this.contract.populateTransaction.approve(predicateWrapper, params.weiAmountOrId.toString());
804628
+ }
804629
+ }
804630
+ // External spender or no predicate wrapper — standard ERC20 approve
804631
+ return super.populateApproveTx(params);
804632
+ }
804633
+ async getPredicateWrapperAddress() {
804634
+ if (this.predicateWrapperAddress !== undefined) {
804635
+ return this.predicateWrapperAddress;
804636
+ }
804637
+ const hookAddress = await this.contract.hook();
804638
+ if (hookAddress === lib.constants.AddressZero) {
804639
+ this.predicateWrapperAddress = null;
804640
+ return null;
804641
+ }
804642
+ const provider = this.getProvider();
804643
+ const warpRouteAddress = this.addresses.token.toLowerCase();
804644
+ // findPredicateWrapperInHook returns null when the hook structure contains no
804645
+ // matching wrapper (a confirmed structural absence). Any exception here is an
804646
+ // unexpected RPC/network failure — don't cache null so the next call can retry.
804647
+ const foundWrapper = await this.findPredicateWrapperInHook(hookAddress, warpRouteAddress, provider);
804648
+ this.predicateWrapperAddress = foundWrapper;
804649
+ return this.predicateWrapperAddress;
804650
+ }
804651
+ async findPredicateWrapperInHook(hookAddress, warpRouteAddress, provider) {
804652
+ const hook = dist/* IPostDispatchHook__factory */.ZUR.connect(hookAddress, provider);
804653
+ let hookType;
804654
+ try {
804655
+ hookType = await hook.hookType();
804656
+ }
804657
+ catch (error) {
804658
+ // CALL_EXCEPTION means the contract at hookAddress doesn't implement hookType()
804659
+ // (e.g. an old or incompatible hook). Treat as "no wrapper here".
804660
+ // Any other error (network timeout, RPC failure) is unexpected — rethrow.
804661
+ if (error instanceof Error &&
804662
+ 'code' in error &&
804663
+ error.code === 'CALL_EXCEPTION')
804664
+ return null;
804665
+ throw error;
804666
+ }
804667
+ if (hookType === hook_types/* OnchainHookType */.c0.PREDICATE_ROUTER_WRAPPER) {
804668
+ const wrapper = dist/* PredicateRouterWrapper__factory */.sYb.connect(hookAddress, provider);
804669
+ const warpRouteFromWrapper = await wrapper.warpRoute();
804670
+ const matches = warpRouteFromWrapper.toLowerCase() === warpRouteAddress;
804671
+ if (matches) {
804672
+ return hookAddress;
804673
+ }
804674
+ }
804675
+ if (hookType === hook_types/* OnchainHookType */.c0.AGGREGATION) {
804676
+ const aggregationHook = dist/* StaticAggregationHook__factory */._ok.connect(hookAddress, provider);
804677
+ const subHooks = await aggregationHook.hooks('0x');
804678
+ for (const subHook of subHooks) {
804679
+ const found = await this.findPredicateWrapperInHook(subHook, warpRouteAddress, provider);
804680
+ if (found) {
804681
+ return found;
804682
+ }
804683
+ }
804684
+ }
804685
+ // Known constraint: recursion only descends into AGGREGATION hooks.
804686
+ // FALLBACK_ROUTING, DOMAIN_ROUTING, and AMOUNT_ROUTING hooks are not traversed.
804687
+ // In practice this is fine because PredicateWrapperDeployer always places the
804688
+ // wrapper inside a StaticAggregationHook. A wrapper nested inside a routing hook
804689
+ // would not be detected and predicate support would silently degrade to disabled.
804690
+ return null;
804691
+ }
803785
804692
  getDomains() {
803786
804693
  return this.contract.domains();
803787
804694
  }
@@ -803847,7 +804754,51 @@ class EvmHypSyntheticAdapter extends EvmTokenAdapter {
803847
804754
  tokenFeeQuote,
803848
804755
  };
803849
804756
  }
803850
- async populateTransferRemoteTx({ weiAmountOrId, destination, recipient, interchainGas, }, nativeValue = 0n) {
804757
+ /**
804758
+ * Check if this warp route supports Predicate attestations
804759
+ * @returns True if a PredicateRouterWrapper is configured on the hook
804760
+ */
804761
+ async supportsAttestation() {
804762
+ const wrapperAddress = await this.getPredicateWrapperAddress();
804763
+ return wrapperAddress !== null;
804764
+ }
804765
+ async populatePredicateTransferRemoteTx(params, nativeValue) {
804766
+ const { weiAmountOrId, destination, recipient, attestation } = params;
804767
+ (0,validation/* assert */.v)(attestation, 'attestation is required');
804768
+ const predicateWrapperAddress = await this.getPredicateWrapperAddress();
804769
+ if (!predicateWrapperAddress) {
804770
+ throw new Error('Attestation provided but no PredicateRouterWrapper detected on warp route hook. ' +
804771
+ 'Attestations can only be used with routes that have a PredicateRouterWrapper configured.');
804772
+ }
804773
+ let { interchainGas } = params;
804774
+ if (!interchainGas) {
804775
+ interchainGas = await this.quoteTransferRemoteGas({
804776
+ destination,
804777
+ recipient,
804778
+ amount: BigInt(weiAmountOrId),
804779
+ });
804780
+ }
804781
+ nativeValue += interchainGas.igpQuote.amount;
804782
+ if (!interchainGas.tokenFeeQuote?.addressOrDenom ||
804783
+ (0,addresses/* isZeroishAddress */.Hi)(interchainGas.tokenFeeQuote?.addressOrDenom)) {
804784
+ nativeValue += interchainGas.tokenFeeQuote?.amount ?? 0n;
804785
+ }
804786
+ const recipBytes32 = (0,addresses/* addressToBytes32 */.In)((0,addresses/* addressToByteHexString */.a2)(recipient));
804787
+ const predicateWrapper = dist/* PredicateRouterWrapper__factory */.sYb.connect(predicateWrapperAddress, this.getProvider());
804788
+ const contractAttestation = {
804789
+ uuid: attestation.uuid,
804790
+ expiration: attestation.expiration,
804791
+ attester: attestation.attester,
804792
+ signature: attestation.signature,
804793
+ };
804794
+ return predicateWrapper.populateTransaction.transferRemoteWithAttestation(contractAttestation, destination, recipBytes32, weiAmountOrId, { value: nativeValue.toString() });
804795
+ }
804796
+ async populateTransferRemoteTx(params, nativeValue = 0n) {
804797
+ const { weiAmountOrId, destination, recipient, attestation } = params;
804798
+ if (attestation) {
804799
+ return this.populatePredicateTransferRemoteTx(params, nativeValue);
804800
+ }
804801
+ let { interchainGas } = params;
803851
804802
  if (!interchainGas)
803852
804803
  interchainGas = await this.quoteTransferRemoteGas({
803853
804804
  destination,
@@ -803905,15 +804856,52 @@ class BaseEvmHypCollateralAdapter extends EvmHypSyntheticAdapter {
803905
804856
  getMetadata(isNft) {
803906
804857
  return this.getWrappedTokenAdapter().then((t) => t.getMetadata(isNft));
803907
804858
  }
803908
- isApproveRequired(owner, spender, weiAmountOrId) {
803909
- return this.getWrappedTokenAdapter().then((t) => t.isApproveRequired(owner, spender, weiAmountOrId));
804859
+ async isApproveRequired(owner, spender, weiAmountOrId) {
804860
+ const wrappedTokenAdapter = await this.getWrappedTokenAdapter();
804861
+ let effectiveSpender = spender;
804862
+ if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token)) {
804863
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804864
+ if (predicateWrapper)
804865
+ effectiveSpender = predicateWrapper;
804866
+ }
804867
+ return wrappedTokenAdapter.isApproveRequired(owner, effectiveSpender, weiAmountOrId);
803910
804868
  }
803911
804869
  async isRevokeApprovalRequired(owner, spender) {
803912
804870
  const collateral = await this.getWrappedTokenAdapter();
803913
- return collateral.isRevokeApprovalRequired(owner, spender);
804871
+ let effectiveSpender = spender;
804872
+ if ((0,addresses/* eqAddress */.fv)(spender, this.addresses.token)) {
804873
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804874
+ if (predicateWrapper)
804875
+ effectiveSpender = predicateWrapper;
804876
+ }
804877
+ return collateral.isRevokeApprovalRequired(owner, effectiveSpender);
804878
+ }
804879
+ async populateApproveTx(params) {
804880
+ const wrappedTokenAdapter = await this.getWrappedTokenAdapter();
804881
+ let effectiveRecipient = params.recipient;
804882
+ if ((0,addresses/* eqAddress */.fv)(params.recipient, this.addresses.token)) {
804883
+ const predicateWrapper = await this.getPredicateWrapperAddress();
804884
+ if (predicateWrapper)
804885
+ effectiveRecipient = predicateWrapper;
804886
+ }
804887
+ return wrappedTokenAdapter.populateApproveTx({
804888
+ ...params,
804889
+ recipient: effectiveRecipient,
804890
+ });
803914
804891
  }
803915
- populateApproveTx(params) {
803916
- return this.getWrappedTokenAdapter().then((t) => t.populateApproveTx(params));
804892
+ /**
804893
+ * Check if this warp route supports Predicate attestations
804894
+ * @returns True if a PredicateRouterWrapper is configured on the hook
804895
+ */
804896
+ async supportsAttestation() {
804897
+ const wrapperAddress = await this.getPredicateWrapperAddress();
804898
+ return wrapperAddress !== null;
804899
+ }
804900
+ async populateTransferRemoteTx(params, nativeValue = 0n) {
804901
+ if (params.attestation) {
804902
+ return this.populatePredicateTransferRemoteTx(params, nativeValue);
804903
+ }
804904
+ return super.populateTransferRemoteTx(params, nativeValue);
803917
804905
  }
803918
804906
  populateTransferTx(params) {
803919
804907
  return this.getWrappedTokenAdapter().then((t) => t.populateTransferTx(params));
@@ -804252,15 +805240,15 @@ class EvmHypNativeAdapter extends EvmMovableCollateralAdapter {
804252
805240
  value,
804253
805241
  });
804254
805242
  }
804255
- async populateTransferRemoteTx({ weiAmountOrId, destination, recipient, interchainGas, }) {
804256
- return super.populateTransferRemoteTx({
804257
- weiAmountOrId,
804258
- destination,
804259
- recipient,
804260
- interchainGas,
804261
- },
804262
- // Pass the amount as initial native value to the parent class
804263
- BigInt(weiAmountOrId));
805243
+ async populateTransferRemoteTx({ weiAmountOrId, destination, recipient, interchainGas, attestation, }) {
805244
+ // For native tokens the token amount is itself msg.value, so pass it as the
805245
+ // initial nativeValue. populatePredicateTransferRemoteTx / super both add
805246
+ // IGP fees on top of this base value.
805247
+ const nativeValue = BigInt(weiAmountOrId);
805248
+ if (attestation) {
805249
+ return this.populatePredicateTransferRemoteTx({ weiAmountOrId, destination, recipient, interchainGas, attestation }, nativeValue);
805250
+ }
805251
+ return super.populateTransferRemoteTx({ weiAmountOrId, destination, recipient, interchainGas }, nativeValue);
804264
805252
  }
804265
805253
  async getBridgedSupply(options) {
804266
805254
  const balance = await this.getProvider().getBalance(this.addresses.token, options?.blockTag);
@@ -804340,8 +805328,17 @@ class EvmXERC20VSAdapter extends EvmTokenAdapter {
804340
805328
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
804341
805329
 
804342
805330
  /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
804343
- /* harmony export */ I: () => (/* binding */ isHypCrossCollateralAdapter)
805331
+ /* harmony export */ I: () => (/* binding */ isHypCrossCollateralAdapter),
805332
+ /* harmony export */ R: () => (/* binding */ isPredicateCapableAdapter)
804344
805333
  /* harmony export */ });
805334
+ function isPredicateCapableAdapter(adapter) {
805335
+ return ('getPredicateWrapperAddress' in adapter &&
805336
+ typeof adapter
805337
+ .getPredicateWrapperAddress === 'function' &&
805338
+ 'supportsAttestation' in adapter &&
805339
+ typeof adapter
805340
+ .supportsAttestation === 'function');
805341
+ }
804345
805342
  function isHypCrossCollateralAdapter(adapter) {
804346
805343
  return ('populateTransferRemoteToTx' in adapter &&
804347
805344
  typeof adapter.populateTransferRemoteToTx === 'function' &&
@@ -809958,9 +810955,28 @@ class EvmHypCrossCollateralAdapter extends EvmTokenAdapter/* EvmHypCollateralAda
809958
810955
  const recipientBytes32 = (0,addresses/* addressToBytes32 */.In)(params.recipient);
809959
810956
  const targetRouterBytes32 = (0,addresses/* addressToBytes32 */.In)(params.targetRouter);
809960
810957
  const quote = params.interchainGas ?? (await this.quoteTransferRemoteToGas(params));
809961
- const nativeGas = !quote.igpQuote.addressOrDenom
809962
- ? quote.igpQuote.amount.toString()
809963
- : '0';
810958
+ let nativeValue = !quote.igpQuote.addressOrDenom
810959
+ ? quote.igpQuote.amount
810960
+ : 0n;
810961
+ if (!quote.tokenFeeQuote?.addressOrDenom ||
810962
+ (0,addresses/* isZeroishAddress */.Hi)(quote.tokenFeeQuote.addressOrDenom)) {
810963
+ nativeValue += quote.tokenFeeQuote?.amount ?? 0n;
810964
+ }
810965
+ const nativeGas = nativeValue.toString();
810966
+ if (params.attestation) {
810967
+ const predicateWrapperAddress = await this.getPredicateWrapperAddress();
810968
+ if (!predicateWrapperAddress) {
810969
+ throw new Error('Attestation provided but no PredicateCrossCollateralRouterWrapper detected on warp route hook.');
810970
+ }
810971
+ const predicateWrapper = dist/* PredicateCrossCollateralRouterWrapper__factory */.TsJ.connect(predicateWrapperAddress, this.getProvider());
810972
+ const contractAttestation = {
810973
+ uuid: params.attestation.uuid,
810974
+ expiration: params.attestation.expiration,
810975
+ attester: params.attestation.attester,
810976
+ signature: params.attestation.signature,
810977
+ };
810978
+ return predicateWrapper.populateTransaction.transferRemoteToWithAttestation(contractAttestation, params.destination, recipientBytes32, params.amount.toString(), targetRouterBytes32, { value: nativeGas });
810979
+ }
809964
810980
  return this.crossCollateralContract.populateTransaction.transferRemoteTo(params.destination, recipientBytes32, params.amount.toString(), targetRouterBytes32, { value: nativeGas });
809965
810981
  }
809966
810982
  /**
@@ -811879,6 +812895,8 @@ var addresses = __nccwpck_require__(93142);
811879
812895
  var types = __nccwpck_require__(16639);
811880
812896
  // EXTERNAL MODULE: ../sdk/dist/fee/EvmTokenFeeModule.js + 2 modules
811881
812897
  var EvmTokenFeeModule = __nccwpck_require__(43313);
812898
+ // EXTERNAL MODULE: ../sdk/dist/predicate/PredicateDeployer.js
812899
+ var PredicateDeployer = __nccwpck_require__(550);
811882
812900
  // EXTERNAL MODULE: ../sdk/dist/router/HyperlaneRouterDeployer.js
811883
812901
  var HyperlaneRouterDeployer = __nccwpck_require__(39166);
811884
812902
  // EXTERNAL MODULE: ../sdk/dist/router/types.js
@@ -811988,6 +813006,7 @@ var token_types = __nccwpck_require__(38466);
811988
813006
 
811989
813007
 
811990
813008
 
813009
+
811991
813010
  // initialize(address _hook, address _owner)
811992
813011
  const OP_L2_INITIALIZE_SIGNATURE = 'initialize(address,address)';
811993
813012
  // initialize(address _owner, string[] memory _urls)
@@ -812378,6 +813397,25 @@ class TokenDeployer extends GasRouterDeployer {
812378
813397
  await this.multiProvider.handleTx(chain, everclearTokenBridge.setOutputAssetsBatch(assets, overrides));
812379
813398
  }));
812380
813399
  }
813400
+ async deployPredicateWrappers(configMap, deployedContractsMap) {
813401
+ await (0,objects/* promiseObjAll */.a1)((0,objects/* objMap */.Yp)(configMap, async (chain, config) => {
813402
+ if (!config.predicateWrapper) {
813403
+ return;
813404
+ }
813405
+ const router = this.router(deployedContractsMap[chain]);
813406
+ const factoryContracts = this.options.ismFactory?.getContracts(chain);
813407
+ (0,validation/* assert */.v)(factoryContracts?.staticAggregationHookFactory, `staticAggregationHookFactory not found for ${chain}. Ensure proxy factories are deployed.`);
813408
+ const predicateDeployer = new PredicateDeployer/* PredicateWrapperDeployer */.t(this.multiProvider, factoryContracts.staticAggregationHookFactory, this.logger);
813409
+ // Token address is fetched from router.token() in PredicateRouterWrapper constructor.
813410
+ // config.predicateWrapper.owner (from the original configMap) is used for wrapper
813411
+ // ownership — it's explicit in the schema rather than read from on-chain, so it
813412
+ // correctly points to the intended final owner even before transferOwnership runs.
813413
+ const result = await predicateDeployer.deployAndConfigure(chain, router.address, config.predicateWrapper, config.type);
813414
+ const signerRouter = dist/* TokenRouter__factory */.NgW.connect(router.address, this.multiProvider.getSigner(chain));
813415
+ const txOverrides = this.multiProvider.getTransactionOverrides(chain);
813416
+ await this.multiProvider.handleTx(chain, signerRouter.setHook(result.aggregationHookAddress, txOverrides));
813417
+ }));
813418
+ }
812381
813419
  async enrollCrossCollateralRouters(configMap, deployedContractsMap) {
812382
813420
  await (0,objects/* promiseObjAll */.a1)((0,objects/* objMap */.Yp)(configMap, async (chain, config) => {
812383
813421
  if (!(0,token_types/* isCrossCollateralTokenConfig */.v3)(config)) {
@@ -812406,6 +813444,14 @@ class TokenDeployer extends GasRouterDeployer {
812406
813444
  }));
812407
813445
  }
812408
813446
  async deploy(configMap) {
813447
+ // Fail fast if any chain requires a predicate wrapper but lacks the factory.
813448
+ // Checked before any on-chain work to avoid partial deployments.
813449
+ for (const [chain, config] of Object.entries(configMap)) {
813450
+ if (!('predicateWrapper' in config) || !config.predicateWrapper)
813451
+ continue;
813452
+ const factoryContracts = this.options.ismFactory?.getContracts(chain);
813453
+ (0,validation/* assert */.v)(factoryContracts?.staticAggregationHookFactory, `staticAggregationHookFactory not found for ${chain}. Ensure proxy factories are deployed.`);
813454
+ }
812409
813455
  let tokenMetadataMap;
812410
813456
  try {
812411
813457
  tokenMetadataMap = await TokenDeployer.deriveTokenMetadata(this.multiProvider, configMap);
@@ -812476,6 +813522,7 @@ class TokenDeployer extends GasRouterDeployer {
812476
813522
  await this.setBridgesTokenApprovals(configMap, deployedContractsMap);
812477
813523
  await this.setEverclearFeeParams(configMap, deployedContractsMap);
812478
813524
  await this.setEverclearOutputAssets(configMap, deployedContractsMap);
813525
+ await this.deployPredicateWrappers(configMap, deployedContractsMap);
812479
813526
  await this.enrollCrossCollateralRouters(configMap, deployedContractsMap);
812480
813527
  await super.transferOwnership(deployedContractsMap, configMap);
812481
813528
  return deployedContractsMap;
@@ -812808,6 +813855,7 @@ async function deriveTokenMetadata(multiProvider, configMap, { validateScale = t
812808
813855
  /* harmony export */ HM: () => (/* binding */ isTokenMetadata),
812809
813856
  /* harmony export */ Jz: () => (/* binding */ isEverclearEthBridgeTokenConfig),
812810
813857
  /* harmony export */ Kh: () => (/* binding */ isXERC20TokenConfig),
813858
+ /* harmony export */ Ky: () => (/* binding */ PredicateWrapperConfigSchema),
812811
813859
  /* harmony export */ LA: () => (/* binding */ isSyntheticRebaseTokenConfig),
812812
813860
  /* harmony export */ Lm: () => (/* binding */ derivedHookAddress),
812813
813861
  /* harmony export */ Pc: () => (/* binding */ isCollateralTokenConfig),
@@ -812832,7 +813880,7 @@ async function deriveTokenMetadata(multiProvider, configMap, { validateScale = t
812832
813880
  /* harmony export */ vo: () => (/* binding */ isOftTokenConfig),
812833
813881
  /* harmony export */ zW: () => (/* binding */ isMovableCollateralTokenConfig)
812834
813882
  /* harmony export */ });
812835
- /* unused harmony exports WarpRouteDeployConfigSchemaErrors, BaseMovableTokenConfigSchema, NativeTokenConfigSchema, OpL2TokenConfigSchema, OpL1TokenConfigSchema, CollateralTokenConfigSchema, XERC20TokenConfigSchema, CctpTokenConfigSchema, DepositAddressRecipientConfigSchema, DepositAddressDestinationConfigSchema, DepositAddressTokenConfigSchema, OftTokenConfigSchema, CollateralRebaseTokenConfigSchema, isCollateralRebaseTokenConfig, SyntheticTokenConfigSchema, SyntheticRebaseTokenConfigSchema, CrossCollateralTokenConfigSchema, EverclearCollateralTokenConfigSchema, EverclearEthBridgeTokenConfigSchema, HypTokenRouterVirtualConfigSchema, UnknownTokenConfigSchema, isUnknownTokenConfig, HypTokenRouterConfigMailboxOptionalBaseSchema, HypTokenRouterConfigMailboxOptionalSchema */
813883
+ /* unused harmony exports WarpRouteDeployConfigSchemaErrors, BaseMovableTokenConfigSchema, isPredicateWrapperConfig, NativeTokenConfigSchema, OpL2TokenConfigSchema, OpL1TokenConfigSchema, CollateralTokenConfigSchema, XERC20TokenConfigSchema, CctpTokenConfigSchema, DepositAddressRecipientConfigSchema, DepositAddressDestinationConfigSchema, DepositAddressTokenConfigSchema, OftTokenConfigSchema, CollateralRebaseTokenConfigSchema, isCollateralRebaseTokenConfig, SyntheticTokenConfigSchema, SyntheticRebaseTokenConfigSchema, CrossCollateralTokenConfigSchema, EverclearCollateralTokenConfigSchema, EverclearEthBridgeTokenConfigSchema, HypTokenRouterVirtualConfigSchema, UnknownTokenConfigSchema, isUnknownTokenConfig, HypTokenRouterConfigMailboxOptionalBaseSchema, HypTokenRouterConfigMailboxOptionalSchema */
812836
813884
  /* harmony import */ var compare_versions__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(95416);
812837
813885
  /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(49355);
812838
813886
  /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(23630);
@@ -812916,9 +813964,19 @@ const BaseMovableTokenConfigSchema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object
812916
813964
  .transform((rawRebalancers) => Array.from(new Set(rawRebalancers)))
812917
813965
  .optional(),
812918
813966
  });
813967
+ // Predicate wrapper configuration for compliance-gated transfers
813968
+ const PredicateWrapperConfigSchema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object */ .Ik({
813969
+ predicateRegistry: _metadata_customZodTypes_js__WEBPACK_IMPORTED_MODULE_3__/* .ZHash */ .l.describe('Predicate registry contract address'),
813970
+ policyId: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj()
813971
+ .min(1)
813972
+ .describe('Predicate policy ID for attestation validation'),
813973
+ owner: _metadata_customZodTypes_js__WEBPACK_IMPORTED_MODULE_3__/* .ZHash */ .l.describe('Owner of the predicate wrapper contract (controls setPolicyID, setRegistry, withdrawETH)'),
813974
+ });
813975
+ const isPredicateWrapperConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(PredicateWrapperConfigSchema);
812919
813976
  const NativeTokenConfigSchema = TokenMetadataSchema.partial().extend({
812920
813977
  type: zod__WEBPACK_IMPORTED_MODULE_4__/* ["enum"] */ .k5([_config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.native, _config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.nativeScaled]),
812921
813978
  ...BaseMovableTokenConfigSchema.shape,
813979
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
812922
813980
  });
812923
813981
  const isNativeTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(NativeTokenConfigSchema);
812924
813982
  const OpL2TokenConfigSchema = NativeTokenConfigSchema.omit({
@@ -812949,6 +814007,7 @@ const CollateralTokenConfigSchema = TokenMetadataSchema.partial().extend({
812949
814007
  token: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj()
812950
814008
  .describe('Existing token address to extend with Warp Route functionality'),
812951
814009
  ...BaseMovableTokenConfigSchema.shape,
814010
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
812952
814011
  });
812953
814012
  const isCollateralTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(CollateralTokenConfigSchema);
812954
814013
  var XERC20Type;
@@ -813005,6 +814064,7 @@ const CctpTokenConfigSchema = TokenMetadataSchema.partial()
813005
814064
  .max(9_999.99)
813006
814065
  .optional()
813007
814066
  .describe('Maximum fee in basis points (bps), supports decimals for fractional bps. 1 bps = 0.01%. Examples: 1.3 bps for Circle Optimism/Arbitrum/Base fee, 1.5 bps for Circle Unichain fee. Internally converted to ppm (parts per million) for contract precision.'),
814067
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813008
814068
  })
813009
814069
  .merge(_ism_types_js__WEBPACK_IMPORTED_MODULE_7__/* .OffchainLookupIsmConfigSchema */ .ZE.omit({ type: true, owner: true }));
813010
814070
  const isCctpTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(CctpTokenConfigSchema);
@@ -813036,6 +814096,7 @@ const DepositAddressTokenConfigSchema = TokenMetadataSchema.partial().extend({
813036
814096
  type: zod__WEBPACK_IMPORTED_MODULE_4__/* .literal */ .eu(_config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.collateralDepositAddress),
813037
814097
  token: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj().describe('Underlying ERC20 token address'),
813038
814098
  destinationConfigs: zod__WEBPACK_IMPORTED_MODULE_4__/* .record */ .g1(_router_types_js__WEBPACK_IMPORTED_MODULE_6__/* .RemoteRouterDomainOrChainNameSchema */ .MR, DepositAddressDestinationConfigSchema),
814099
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813039
814100
  });
813040
814101
  const isDepositAddressTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(DepositAddressTokenConfigSchema);
813041
814102
  const OftTokenConfigSchema = TokenMetadataSchema.partial().extend({
@@ -813046,6 +814107,7 @@ const OftTokenConfigSchema = TokenMetadataSchema.partial().extend({
813046
814107
  domainMappings: zod__WEBPACK_IMPORTED_MODULE_4__/* .record */ .g1(_router_types_js__WEBPACK_IMPORTED_MODULE_6__/* .RemoteRouterDomainOrChainNameSchema */ .MR, zod__WEBPACK_IMPORTED_MODULE_4__/* .number */ .ai().int().nonnegative().max(4294967295))
813047
814108
  .describe('Mapping of Hyperlane domain (or chain name) to LayerZero endpoint ID'),
813048
814109
  extraOptions: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj().optional().describe('LayerZero extra options (hex)'),
814110
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813049
814111
  });
813050
814112
  const isOftTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(OftTokenConfigSchema);
813051
814113
  const CollateralRebaseTokenConfigSchema = TokenMetadataSchema.partial().extend({
@@ -813055,12 +814117,14 @@ const isCollateralRebaseTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MOD
813055
814117
  const SyntheticTokenConfigSchema = TokenMetadataSchema.partial().extend({
813056
814118
  type: zod__WEBPACK_IMPORTED_MODULE_4__/* ["enum"] */ .k5([_config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.synthetic, _config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.syntheticUri]),
813057
814119
  initialSupply: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj().or(zod__WEBPACK_IMPORTED_MODULE_4__/* .number */ .ai()).optional(),
814120
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813058
814121
  metadataUri: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj().url().optional(),
813059
814122
  });
813060
814123
  const isSyntheticTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(SyntheticTokenConfigSchema);
813061
814124
  const SyntheticRebaseTokenConfigSchema = TokenMetadataSchema.partial().extend({
813062
814125
  type: zod__WEBPACK_IMPORTED_MODULE_4__/* .literal */ .eu(_config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.syntheticRebase),
813063
814126
  collateralChainName: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .Yj(),
814127
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813064
814128
  });
813065
814129
  const isSyntheticRebaseTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(SyntheticRebaseTokenConfigSchema);
813066
814130
  /**
@@ -813074,6 +814138,7 @@ const CrossCollateralTokenConfigSchema = TokenMetadataSchema.partial().extend({
813074
814138
  crossCollateralRouters: zod__WEBPACK_IMPORTED_MODULE_4__/* .record */ .g1(_router_types_js__WEBPACK_IMPORTED_MODULE_6__/* .RemoteRouterDomainOrChainNameSchema */ .MR, zod__WEBPACK_IMPORTED_MODULE_4__/* .array */ .YO(_metadata_customZodTypes_js__WEBPACK_IMPORTED_MODULE_3__/* .ZHash */ .l))
813075
814139
  .optional(),
813076
814140
  ...BaseMovableTokenConfigSchema.shape,
814141
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813077
814142
  });
813078
814143
  const isCrossCollateralTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(CrossCollateralTokenConfigSchema);
813079
814144
  const EverclearCollateralTokenConfigSchema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object */ .Ik({
@@ -813122,6 +814187,7 @@ const HypTokenRouterVirtualConfigSchema = zod__WEBPACK_IMPORTED_MODULE_4__/* .ob
813122
814187
  const UnknownTokenConfigSchema = TokenMetadataSchema.partial()
813123
814188
  .extend({
813124
814189
  type: zod__WEBPACK_IMPORTED_MODULE_4__/* .literal */ .eu(_config_js__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.unknown),
814190
+ predicateWrapper: PredicateWrapperConfigSchema.optional(),
813125
814191
  })
813126
814192
  .passthrough();
813127
814193
  const isUnknownTokenConfig = (0,_utils_schemas_js__WEBPACK_IMPORTED_MODULE_5__/* .isCompliant */ .M)(UnknownTokenConfigSchema);
@@ -815346,7 +816412,7 @@ class WarpCore {
815346
816412
  /**
815347
816413
  * Simulates a transfer to estimate 'local' gas fees on the origin chain
815348
816414
  */
815349
- async getLocalTransferFee({ originToken, destination, sender, senderPubKey, interchainFee, tokenFeeQuote, destinationToken, }) {
816415
+ async getLocalTransferFee({ originToken, destination, sender, senderPubKey, interchainFee, tokenFeeQuote, attestation, amount, destinationToken, }) {
815350
816416
  this.logger.debug(`Estimating local transfer gas to ${destination}`);
815351
816417
  const originMetadata = this.multiProvider.getChainMetadata(originToken.chainName);
815352
816418
  const destinationMetadata = this.multiProvider.getChainMetadata(destination);
@@ -815358,22 +816424,26 @@ class WarpCore {
815358
816424
  }
815359
816425
  // Form transactions to estimate local gas with
815360
816426
  const recipient = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .convertToProtocolAddress */ .Vj)(sender, destinationMetadata.protocol, destinationMetadata.bech32Prefix);
815361
- // Use a small but viable amount for gas estimation. Must survive on-chain
815362
- // decimal truncation (e.g. 18→6 decimals) to avoid reverts like
815363
- // "HypNativeMinter: destination amount < 1". Compute minimum as
815364
- // 10^(originDecimals - destDecimals) so destination gets exactly 1 unit.
815365
- const destToken = originToken.getConnectionForChain(destinationMetadata.name)?.token;
815366
- const decimalDiff = destToken
815367
- ? Math.max(0, originToken.decimals - destToken.decimals)
815368
- : 0;
815369
- const gasEstimationAmount = BigInt(10) ** BigInt(decimalDiff);
816427
+ // Use a small but viable amount for gas estimation when none is provided.
816428
+ // Must survive on-chain decimal truncation (e.g. 18→6 decimals) to avoid
816429
+ // reverts like "HypNativeMinter: destination amount < 1". Compute minimum
816430
+ // as 10^(originDecimals - destDecimals) so destination gets exactly 1 unit.
816431
+ const estimationAmount = amount ??
816432
+ (() => {
816433
+ const destToken = originToken.getConnectionForChain(destinationMetadata.name)?.token;
816434
+ const decimalDiff = destToken
816435
+ ? Math.max(0, originToken.decimals - destToken.decimals)
816436
+ : 0;
816437
+ return BigInt(10) ** BigInt(decimalDiff);
816438
+ })();
815370
816439
  const txs = await this.getTransferRemoteTxs({
815371
- originTokenAmount: originToken.amount(gasEstimationAmount),
816440
+ originTokenAmount: originToken.amount(estimationAmount),
815372
816441
  destination,
815373
816442
  sender,
815374
816443
  recipient,
815375
816444
  interchainFee,
815376
816445
  tokenFeeQuote,
816446
+ attestation,
815377
816447
  destinationToken,
815378
816448
  });
815379
816449
  // Starknet does not support gas estimation without starknet account
@@ -815416,7 +816486,7 @@ class WarpCore {
815416
816486
  * but it also resolves the native token and returns a TokenAmount
815417
816487
  * @todo: rename to getLocalTransferFee for consistency (requires breaking change)
815418
816488
  */
815419
- async getLocalTransferFeeAmount({ originToken, destination, sender, senderPubKey, interchainFee, tokenFeeQuote, destinationToken, }) {
816489
+ async getLocalTransferFeeAmount({ originToken, destination, sender, senderPubKey, interchainFee, tokenFeeQuote, attestation, amount, destinationToken, }) {
815420
816490
  const originMetadata = this.multiProvider.getChainMetadata(originToken.chainName);
815421
816491
  // If there's no native token, we can't represent local gas
815422
816492
  if (!originMetadata.nativeToken)
@@ -815429,6 +816499,8 @@ class WarpCore {
815429
816499
  senderPubKey,
815430
816500
  interchainFee,
815431
816501
  tokenFeeQuote,
816502
+ attestation,
816503
+ amount,
815432
816504
  destinationToken,
815433
816505
  });
815434
816506
  // Get the local gas token. This assumes the chain's native token will pay for local gas
@@ -815440,7 +816512,12 @@ class WarpCore {
815440
816512
  * Gets a list of populated transactions required to transfer a token to a remote chain
815441
816513
  * Typically just 1 transaction but sometimes more, like when an approval is required first
815442
816514
  */
815443
- async getTransferRemoteTxs({ originTokenAmount, destination, sender, recipient, interchainFee, tokenFeeQuote, destinationToken, quotedCalls, }) {
816515
+ async getTransferRemoteTxs({ originTokenAmount, destination, sender, recipient, interchainFee, tokenFeeQuote, attestation, destinationToken, quotedCalls, }) {
816516
+ // QuotedCalls and attestation are mutually exclusive: the QuotedCalls.execute() path
816517
+ // calls transferRemote, not transferRemoteWithAttestation. Composing them would require
816518
+ // new contract support; for now, surface a clear error rather than silently dropping
816519
+ // the attestation.
816520
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(quotedCalls && attestation), 'quotedCalls and attestation cannot be used together. The QuotedCalls path does not support attestation-gated transfers.');
815444
816521
  // QuotedCalls atomic path — single execute() tx with quotes + token pull + transfer + sweep
815445
816522
  if (quotedCalls) {
815446
816523
  return this.getQuotedCallsTransferTxs({
@@ -815462,6 +816539,9 @@ class WarpCore {
815462
816539
  sender,
815463
816540
  recipient,
815464
816541
  destinationToken,
816542
+ attestation,
816543
+ interchainFee,
816544
+ tokenFeeQuote,
815465
816545
  });
815466
816546
  }
815467
816547
  // Standard warp route transfer
@@ -815471,7 +816551,10 @@ class WarpCore {
815471
816551
  const destinationDomainId = this.multiProvider.getDomainId(destination);
815472
816552
  const providerType = _token_TokenStandard_js__WEBPACK_IMPORTED_MODULE_13__/* .TOKEN_STANDARD_TO_PROVIDER_TYPE */ .ro[token.standard];
815473
816553
  const hypAdapter = token.getHypAdapter(this.multiProvider, destinationName);
815474
- if (!interchainFee || !tokenFeeQuote) {
816554
+ if (!interchainFee) {
816555
+ // Only re-fetch when the IGP quote is missing. tokenFeeQuote may legitimately
816556
+ // be undefined for routes that have no token fee — treating its absence as a
816557
+ // reason to re-fetch would overwrite a valid pinned interchainFee.
815475
816558
  const transferFee = await this.getInterchainTransferFee({
815476
816559
  originTokenAmount,
815477
816560
  destination,
@@ -815556,6 +816639,9 @@ class WarpCore {
815556
816639
  const extraSignerKeypairs = providerType === _providers_ProviderType_js__WEBPACK_IMPORTED_MODULE_14__/* .ProviderType */ .c.SolanaWeb3
815557
816640
  ? [_solana_web3_js__WEBPACK_IMPORTED_MODULE_0__/* .Keypair */ .AX.generate()]
815558
816641
  : undefined;
816642
+ if (attestation) {
816643
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)((0,_token_adapters_ITokenAdapter_js__WEBPACK_IMPORTED_MODULE_7__/* .isPredicateCapableAdapter */ .R)(hypAdapter), 'Attestation provided but adapter does not support predicate transfers');
816644
+ }
815559
816645
  const transferTxReq = await hypAdapter.populateTransferRemoteTx({
815560
816646
  weiAmountOrId: amount.toString(),
815561
816647
  destination: destinationDomainId,
@@ -815563,6 +816649,7 @@ class WarpCore {
815563
816649
  recipient,
815564
816650
  interchainGas,
815565
816651
  customHook: token.igpTokenAddressOrDenom,
816652
+ attestation,
815566
816653
  extraSigners: extraSignerKeypairs,
815567
816654
  });
815568
816655
  this.logger.debug(`Remote transfer tx for ${token.symbol} populated`);
@@ -815590,7 +816677,7 @@ class WarpCore {
815590
816677
  * Uses transferRemoteTo for both same-chain and cross-chain transfers.
815591
816678
  * Same-chain: calls handle() directly on target router (atomic, no relay needed).
815592
816679
  */
815593
- async getCrossCollateralTransferTxs({ originTokenAmount, destination, sender, recipient, destinationToken, }) {
816680
+ async getCrossCollateralTransferTxs({ originTokenAmount, destination, sender, recipient, destinationToken, attestation, interchainFee, tokenFeeQuote, }) {
815594
816681
  const transactions = [];
815595
816682
  const { token: originToken, amount } = originTokenAmount;
815596
816683
  const destinationName = this.multiProvider.getChainName(destination);
@@ -815604,13 +816691,36 @@ class WarpCore {
815604
816691
  const providerType = _token_TokenStandard_js__WEBPACK_IMPORTED_MODULE_13__/* .TOKEN_STANDARD_TO_PROVIDER_TYPE */ .ro[originToken.standard];
815605
816692
  const adapter = originToken.getHypAdapter(this.multiProvider, destinationName);
815606
816693
  (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)((0,_token_adapters_ITokenAdapter_js__WEBPACK_IMPORTED_MODULE_7__/* .isHypCrossCollateralAdapter */ .I)(adapter), 'Adapter does not implement IHypCrossCollateralAdapter');
815607
- const transferQuote = await adapter.quoteTransferRemoteToGas({
815608
- destination: this.multiProvider.getDomainId(destination),
815609
- recipient,
815610
- amount,
815611
- targetRouter: resolvedDestinationToken.addressOrDenom,
815612
- sender,
815613
- });
816694
+ // Use pre-computed fees when provided (e.g. when attestation is present and the
816695
+ // msg_value was signed over the original quote). Re-quoting could produce a
816696
+ // different value and cause the attestation check to fail on-chain.
816697
+ // Mirror the standard path (line ~517): only re-quote when interchainFee is absent.
816698
+ // tokenFeeQuote may legitimately be undefined (no token fee on this route) and that
816699
+ // is not a reason to re-quote — doing so would overwrite a valid pinned interchainFee.
816700
+ let transferQuote;
816701
+ if (interchainFee) {
816702
+ transferQuote = {
816703
+ igpQuote: {
816704
+ amount: interchainFee.amount,
816705
+ addressOrDenom: interchainFee.token.addressOrDenom,
816706
+ },
816707
+ ...(tokenFeeQuote && {
816708
+ tokenFeeQuote: {
816709
+ amount: tokenFeeQuote.amount,
816710
+ addressOrDenom: tokenFeeQuote.token.addressOrDenom,
816711
+ },
816712
+ }),
816713
+ };
816714
+ }
816715
+ else {
816716
+ transferQuote = await adapter.quoteTransferRemoteToGas({
816717
+ destination: this.multiProvider.getDomainId(destination),
816718
+ recipient,
816719
+ amount,
816720
+ targetRouter: resolvedDestinationToken.addressOrDenom,
816721
+ sender,
816722
+ });
816723
+ }
815614
816724
  (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!transferQuote.igpQuote.addressOrDenom ||
815615
816725
  (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .isZeroishAddress */ .Hi)(transferQuote.igpQuote.addressOrDenom), `CrossCollateralRouter transferRemoteTo requires native IGP fee; got ${transferQuote.igpQuote.addressOrDenom}`);
815616
816726
  const tokenFeeAmount = transferQuote.tokenFeeQuote?.amount ?? 0n;
@@ -815657,6 +816767,7 @@ class WarpCore {
815657
816767
  interchainGas: transferQuote,
815658
816768
  fromAccountOwner: sender,
815659
816769
  extraSigners: extraSignerKeypairs,
816770
+ attestation,
815660
816771
  });
815661
816772
  transactions.push({
815662
816773
  category: _types_js__WEBPACK_IMPORTED_MODULE_2__/* .WarpTxCategory */ .b.Transfer,
@@ -815843,7 +816954,7 @@ class WarpCore {
815843
816954
  /**
815844
816955
  * Fetch local and interchain fee estimates for a remote transfer
815845
816956
  */
815846
- async estimateTransferRemoteFees({ originTokenAmount, destination, recipient, sender, senderPubKey, destinationToken, }) {
816957
+ async estimateTransferRemoteFees({ originTokenAmount, destination, recipient, sender, senderPubKey, attestation, destinationToken, }) {
815847
816958
  this.logger.debug('Fetching remote transfer fee estimates');
815848
816959
  const { token: originToken } = originTokenAmount;
815849
816960
  // Handle CrossCollateralRouter fee estimation
@@ -815855,6 +816966,7 @@ class WarpCore {
815855
816966
  recipient,
815856
816967
  sender,
815857
816968
  senderPubKey,
816969
+ attestation,
815858
816970
  });
815859
816971
  }
815860
816972
  // First get interchain gas quote (aka IGP quote)
@@ -815873,6 +816985,8 @@ class WarpCore {
815873
816985
  senderPubKey,
815874
816986
  interchainFee: igpQuote,
815875
816987
  tokenFeeQuote,
816988
+ attestation,
816989
+ amount: originTokenAmount.amount,
815876
816990
  });
815877
816991
  return {
815878
816992
  interchainQuote: igpQuote,
@@ -815883,7 +816997,7 @@ class WarpCore {
815883
816997
  /**
815884
816998
  * Estimate fees for a CrossCollateralRouter transfer.
815885
816999
  */
815886
- async estimateCrossCollateralFees({ originTokenAmount, destination, destinationToken, recipient, sender, senderPubKey, }) {
817000
+ async estimateCrossCollateralFees({ originTokenAmount, destination, destinationToken, recipient, sender, senderPubKey, attestation, }) {
815887
817001
  const { token: originToken } = originTokenAmount;
815888
817002
  const resolvedDestinationToken = this.resolveDestinationToken({
815889
817003
  originToken,
@@ -815904,6 +817018,8 @@ class WarpCore {
815904
817018
  senderPubKey,
815905
817019
  interchainFee: interchainQuote,
815906
817020
  tokenFeeQuote,
817021
+ attestation,
817022
+ amount: originTokenAmount.amount,
815907
817023
  destinationToken: resolvedDestinationToken,
815908
817024
  });
815909
817025
  return {
@@ -816016,7 +817132,7 @@ class WarpCore {
816016
817132
  /**
816017
817133
  * Ensure the remote token transfer would be valid for the given chains, amount, sender, and recipient
816018
817134
  */
816019
- async validateTransfer({ originTokenAmount, destination, recipient, sender, senderPubKey, destinationToken, }) {
817135
+ async validateTransfer({ originTokenAmount, destination, recipient, sender, senderPubKey, attestation, destinationToken, }) {
816020
817136
  const chainError = this.validateChains(originTokenAmount.token.chainName, destination);
816021
817137
  if (chainError)
816022
817138
  return chainError;
@@ -816051,7 +817167,7 @@ class WarpCore {
816051
817167
  const originCollateralError = await this.validateOriginCollateral(originTokenAmount);
816052
817168
  if (originCollateralError)
816053
817169
  return originCollateralError;
816054
- const balancesError = await this.validateTokenBalances(originTokenAmount, destination, sender, recipient, senderPubKey, resolvedDestinationToken);
817170
+ const balancesError = await this.validateTokenBalances(originTokenAmount, destination, sender, recipient, senderPubKey, attestation, resolvedDestinationToken);
816055
817171
  if (balancesError)
816056
817172
  return balancesError;
816057
817173
  return null;
@@ -816129,7 +817245,7 @@ class WarpCore {
816129
817245
  /**
816130
817246
  * Ensure the sender has sufficient balances for transfer and interchain gas
816131
817247
  */
816132
- async validateTokenBalances(originTokenAmount, destination, sender, recipient, senderPubKey, destinationToken) {
817248
+ async validateTokenBalances(originTokenAmount, destination, sender, recipient, senderPubKey, attestation, destinationToken) {
816133
817249
  const { token: originToken, amount } = originTokenAmount;
816134
817250
  const { amount: senderBalance } = await originToken.getBalance(this.multiProvider, sender);
816135
817251
  const senderBalanceAmount = originTokenAmount.token.amount(senderBalance);
@@ -816170,6 +817286,8 @@ class WarpCore {
816170
817286
  senderPubKey,
816171
817287
  interchainFee: interchainQuote,
816172
817288
  tokenFeeQuote,
817289
+ attestation,
817290
+ amount,
816173
817291
  destinationToken,
816174
817292
  });
816175
817293
  const feeEstimate = { interchainQuote, localQuote };
@@ -816188,60 +817306,6 @@ class WarpCore {
816188
817306
  }
816189
817307
  return null;
816190
817308
  }
816191
- resolveDestinationToken({ originToken, destination, destinationToken, }) {
816192
- const destinationName = this.multiProvider.getChainName(destination);
816193
- const destinationCandidates = originToken
816194
- .getConnections()
816195
- .filter((connection) => connection.token.chainName === destinationName)
816196
- .map((connection) => connection.token);
816197
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationCandidates.length > 0, `No connection found for ${destinationName}`);
816198
- if (destinationToken) {
816199
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationToken.chainName === destinationName, `Destination token chain mismatch for ${destinationName}`);
816200
- const matchedToken = destinationCandidates.find((candidate) => candidate.equals(destinationToken) ||
816201
- (0,_token_TokenMetadata_js__WEBPACK_IMPORTED_MODULE_6__/* .tokenIdentifiersEqual */ .s)(candidate.addressOrDenom, destinationToken.addressOrDenom));
816202
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(matchedToken, `Destination token ${destinationToken.addressOrDenom} is not connected from ${originToken.chainName} to ${destinationName}`);
816203
- return matchedToken;
816204
- }
816205
- (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationCandidates.length === 1, `Ambiguous route to ${destinationName}; specify destination token`);
816206
- return destinationCandidates[0];
816207
- }
816208
- /**
816209
- * Search through token list to find token with matching chain and address
816210
- */
816211
- findToken(chainName, addressOrDenom) {
816212
- if (!addressOrDenom)
816213
- return null;
816214
- const results = this.tokens.filter((token) => token.chainName === chainName &&
816215
- (0,_token_TokenMetadata_js__WEBPACK_IMPORTED_MODULE_6__/* .tokenIdentifiersEqual */ .s)(token.addressOrDenom, addressOrDenom));
816216
- if (results.length === 1)
816217
- return results[0];
816218
- if (results.length > 1)
816219
- throw new Error(`Ambiguous token search results for ${addressOrDenom}`);
816220
- const chainMetadata = this.multiProvider.getChainMetadata(chainName);
816221
- if (chainMetadata.nativeToken?.denom === addressOrDenom) {
816222
- return _token_Token_js__WEBPACK_IMPORTED_MODULE_3__/* .Token */ .o.FromChainMetadataNativeToken(chainMetadata);
816223
- }
816224
- return null;
816225
- }
816226
- /**
816227
- * Get the list of chains referenced by the tokens in this WarpCore
816228
- */
816229
- getTokenChains() {
816230
- return [...new Set(this.tokens.map((token) => token.chainName)).values()];
816231
- }
816232
- /**
816233
- * Get the subset of tokens whose chain matches the given chainName
816234
- */
816235
- getTokensForChain(chainName) {
816236
- return this.tokens.filter((token) => token.chainName === chainName);
816237
- }
816238
- /**
816239
- * Get the subset of tokens whose chain matches the given chainName
816240
- * and which are connected to a token on the given destination chain
816241
- */
816242
- getTokensForRoute(origin, destination) {
816243
- return this.tokens.filter((token) => token.chainName === origin && token.getConnectionForChain(destination));
816244
- }
816245
817309
  /**
816246
817310
  * Ensure the sender has sufficient balances for transfer and interchain gas
816247
817311
  */
@@ -816314,6 +817378,75 @@ class WarpCore {
816314
817378
  }
816315
817379
  return null;
816316
817380
  }
817381
+ resolveDestinationToken({ originToken, destination, destinationToken, }) {
817382
+ const destinationName = this.multiProvider.getChainName(destination);
817383
+ const destinationCandidates = originToken
817384
+ .getConnections()
817385
+ .filter((connection) => connection.token.chainName === destinationName)
817386
+ .map((connection) => connection.token);
817387
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationCandidates.length > 0, `No connection found for ${destinationName}`);
817388
+ if (destinationToken) {
817389
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationToken.chainName === destinationName, `Destination token chain mismatch for ${destinationName}`);
817390
+ const matchedToken = destinationCandidates.find((candidate) => candidate.equals(destinationToken) ||
817391
+ (0,_token_TokenMetadata_js__WEBPACK_IMPORTED_MODULE_6__/* .tokenIdentifiersEqual */ .s)(candidate.addressOrDenom, destinationToken.addressOrDenom));
817392
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(matchedToken, `Destination token ${destinationToken.addressOrDenom} is not connected from ${originToken.chainName} to ${destinationName}`);
817393
+ return matchedToken;
817394
+ }
817395
+ (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(destinationCandidates.length === 1, `Ambiguous route to ${destinationName}; specify destination token`);
817396
+ return destinationCandidates[0];
817397
+ }
817398
+ /**
817399
+ * Search through token list to find token with matching chain and address
817400
+ */
817401
+ findToken(chainName, addressOrDenom) {
817402
+ if (!addressOrDenom)
817403
+ return null;
817404
+ const results = this.tokens.filter((token) => token.chainName === chainName &&
817405
+ (0,_token_TokenMetadata_js__WEBPACK_IMPORTED_MODULE_6__/* .tokenIdentifiersEqual */ .s)(token.addressOrDenom, addressOrDenom));
817406
+ if (results.length === 1)
817407
+ return results[0];
817408
+ if (results.length > 1)
817409
+ throw new Error(`Ambiguous token search results for ${addressOrDenom}`);
817410
+ // If the token is not found, check to see if it matches the denom of chain's native token
817411
+ // This is a convenience so WarpConfigs don't need to include definitions for native tokens
817412
+ const chainMetadata = this.multiProvider.getChainMetadata(chainName);
817413
+ if (chainMetadata.nativeToken?.denom === addressOrDenom) {
817414
+ return _token_Token_js__WEBPACK_IMPORTED_MODULE_3__/* .Token */ .o.FromChainMetadataNativeToken(chainMetadata);
817415
+ }
817416
+ return null;
817417
+ }
817418
+ /**
817419
+ * Get the list of chains referenced by the tokens in this WarpCore
817420
+ */
817421
+ getTokenChains() {
817422
+ return [...new Set(this.tokens.map((t) => t.chainName)).values()];
817423
+ }
817424
+ /**
817425
+ * Get the subset of tokens whose chain matches the given chainName
817426
+ */
817427
+ getTokensForChain(chainName) {
817428
+ return this.tokens.filter((t) => t.chainName === chainName);
817429
+ }
817430
+ /**
817431
+ * Get the subset of tokens whose chain matches the given chainName
817432
+ * and which are connected to a token on the given destination chain
817433
+ */
817434
+ getTokensForRoute(origin, destination) {
817435
+ return this.tokens.filter((t) => t.chainName === origin && t.getConnectionForChain(destination));
817436
+ }
817437
+ /**
817438
+ * Check if a token supports Predicate attestations
817439
+ * @param token The token to check
817440
+ * @param destination Optional destination chain for the route
817441
+ * @returns True if the token's warp route has a PredicateRouterWrapper configured
817442
+ */
817443
+ async isPredicateSupported(token, destination) {
817444
+ const adapter = token.getHypAdapter(this.multiProvider, destination);
817445
+ if (!(0,_token_adapters_ITokenAdapter_js__WEBPACK_IMPORTED_MODULE_7__/* .isPredicateCapableAdapter */ .R)(adapter)) {
817446
+ return false;
817447
+ }
817448
+ return adapter.supportsAttestation();
817449
+ }
816317
817450
  }
816318
817451
  //# sourceMappingURL=WarpCore.js.map
816319
817452
  __webpack_async_result__();
@@ -904343,7 +905476,7 @@ module.exports = /*#__PURE__*/JSON.parse('[{"type":"function","name":"proveL2Lea
904343
905476
  /***/ 99468:
904344
905477
  /***/ ((module) => {
904345
905478
 
904346
- module.exports = {"rE":"32.0.1"};
905479
+ module.exports = {"rE":"33.0.0"};
904347
905480
 
904348
905481
  /***/ })
904349
905482