@@ -3,6 +3,7 @@ pragma solidity ^0.8.0;
33
44import "./SpokePool.sol " ;
55import "./libraries/CircleCCTPAdapter.sol " ;
6+ import "./libraries/HypXERC20Adapter.sol " ;
67import { CrossDomainAddressUtils } from "./libraries/CrossDomainAddressUtils.sol " ;
78import { ArbitrumL2ERC20GatewayLike } from "./interfaces/ArbitrumBridge.sol " ;
89
@@ -28,10 +29,20 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {
2829 uint32 _fillDeadlineBuffer ,
2930 IERC20 _l2Usdc ,
3031 ITokenMessenger _cctpTokenMessenger ,
31- // _oftFeeCap can be set to 1 ether for Arbitrum, but has to be custom-set for other chains that might inherit this adapter, like AlephZero
32- uint256 _oftFeeCap
32+ uint32 _oftDstEid ,
33+ uint256 _oftFeeCap ,
34+ uint32 _hypXERC20DstDomain ,
35+ uint256 _hypXERC20FeeCap
3336 )
34- SpokePool (_wrappedNativeTokenAddress, _depositQuoteTimeBuffer, _fillDeadlineBuffer, _oftFeeCap)
37+ SpokePool (
38+ _wrappedNativeTokenAddress,
39+ _depositQuoteTimeBuffer,
40+ _fillDeadlineBuffer,
41+ _oftDstEid,
42+ _oftFeeCap,
43+ _hypXERC20DstDomain,
44+ _hypXERC20FeeCap
45+ )
3546 CircleCCTPAdapter (_l2Usdc, _cctpTokenMessenger, CircleDomainIds.Ethereum)
3647 {} // solhint-disable-line no-empty-blocks
3748
@@ -86,12 +97,20 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {
8697
8798 function _bridgeTokensToHubPool (uint256 amountToReturn , address l2TokenAddress ) internal override {
8899 address oftMessenger = _getOftMessenger (l2TokenAddress);
100+ address hypRouter = _getXERC20HypRouter (l2TokenAddress);
89101
90102 // If the l2TokenAddress is UDSC, we need to use the CCTP bridge.
91103 if (_isCCTPEnabled () && l2TokenAddress == address (usdcToken)) {
92104 _transferUsdc (withdrawalRecipient, amountToReturn);
93105 } else if (oftMessenger != address (0 )) {
94106 _transferViaOFT (IERC20 (l2TokenAddress), IOFT (oftMessenger), withdrawalRecipient, amountToReturn);
107+ } else if (hypRouter != address (0 )) {
108+ _transferXERC20ViaHyperlane (
109+ IERC20 (l2TokenAddress),
110+ IHypXERC20Router (hypRouter),
111+ withdrawalRecipient,
112+ amountToReturn
113+ );
95114 } else {
96115 // Check that the Ethereum counterpart of the L2 token is stored on this contract.
97116 address ethereumTokenToBridge = whitelistedTokens[l2TokenAddress];
0 commit comments