Skip to content

Commit 42a4459

Browse files
authored
feat: remove XERC20 code (#991)
* remove Xerc20 code This reverts most of commit 62c4d96. * storage layouts
1 parent 62c4d96 commit 42a4459

File tree

98 files changed

+210
-4120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+210
-4120
lines changed

contracts/AlephZero_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ contract AlephZero_SpokePool is Arbitrum_SpokePool {
1919
IERC20 _l2Usdc,
2020
ITokenMessenger _cctpTokenMessenger,
2121
uint32 _oftDstEid,
22-
uint256 _oftFeeCap,
23-
uint32 _hypXERC20DstDomain,
24-
uint256 _hypXERC20FeeCap
22+
uint256 _oftFeeCap
2523
)
2624
Arbitrum_SpokePool(
2725
_wrappedNativeTokenAddress,
@@ -30,9 +28,7 @@ contract AlephZero_SpokePool is Arbitrum_SpokePool {
3028
_l2Usdc,
3129
_cctpTokenMessenger,
3230
_oftDstEid,
33-
_oftFeeCap,
34-
_hypXERC20DstDomain,
35-
_hypXERC20FeeCap
31+
_oftFeeCap
3632
)
3733
{} // solhint-disable-line no-empty-blocks
3834
}

contracts/Arbitrum_SpokePool.sol

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity ^0.8.0;
33

44
import "./SpokePool.sol";
55
import "./libraries/CircleCCTPAdapter.sol";
6-
import "./libraries/HypXERC20Adapter.sol";
76
import { CrossDomainAddressUtils } from "./libraries/CrossDomainAddressUtils.sol";
87
import { ArbitrumL2ERC20GatewayLike } from "./interfaces/ArbitrumBridge.sol";
98

@@ -30,19 +29,9 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {
3029
IERC20 _l2Usdc,
3130
ITokenMessenger _cctpTokenMessenger,
3231
uint32 _oftDstEid,
33-
uint256 _oftFeeCap,
34-
uint32 _hypXERC20DstDomain,
35-
uint256 _hypXERC20FeeCap
32+
uint256 _oftFeeCap
3633
)
37-
SpokePool(
38-
_wrappedNativeTokenAddress,
39-
_depositQuoteTimeBuffer,
40-
_fillDeadlineBuffer,
41-
_oftDstEid,
42-
_oftFeeCap,
43-
_hypXERC20DstDomain,
44-
_hypXERC20FeeCap
45-
)
34+
SpokePool(_wrappedNativeTokenAddress, _depositQuoteTimeBuffer, _fillDeadlineBuffer, _oftDstEid, _oftFeeCap)
4635
CircleCCTPAdapter(_l2Usdc, _cctpTokenMessenger, CircleDomainIds.Ethereum)
4736
{} // solhint-disable-line no-empty-blocks
4837

@@ -97,20 +86,12 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {
9786

9887
function _bridgeTokensToHubPool(uint256 amountToReturn, address l2TokenAddress) internal override {
9988
address oftMessenger = _getOftMessenger(l2TokenAddress);
100-
address hypRouter = _getXERC20HypRouter(l2TokenAddress);
10189

10290
// If the l2TokenAddress is UDSC, we need to use the CCTP bridge.
10391
if (_isCCTPEnabled() && l2TokenAddress == address(usdcToken)) {
10492
_transferUsdc(withdrawalRecipient, amountToReturn);
10593
} else if (oftMessenger != address(0)) {
10694
_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-
);
11495
} else {
11596
// Check that the Ethereum counterpart of the L2 token is stored on this contract.
11697
address ethereumTokenToBridge = whitelistedTokens[l2TokenAddress];

contracts/Base_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ contract Base_SpokePool is Ovm_SpokePool {
1616
uint32 _depositQuoteTimeBuffer,
1717
uint32 _fillDeadlineBuffer,
1818
IERC20 _l2Usdc,
19-
ITokenMessenger _cctpTokenMessenger,
20-
uint32 _hypXERC20DstDomain,
21-
uint256 _hypXERC20FeeCap
19+
ITokenMessenger _cctpTokenMessenger
2220
)
2321
Ovm_SpokePool(
2422
_wrappedNativeTokenAddress,
2523
_depositQuoteTimeBuffer,
2624
_fillDeadlineBuffer,
2725
_l2Usdc,
28-
_cctpTokenMessenger,
29-
_hypXERC20DstDomain,
30-
_hypXERC20FeeCap
26+
_cctpTokenMessenger
3127
)
3228
{} // solhint-disable-line no-empty-blocks
3329

contracts/Blast_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,14 @@ contract Blast_SpokePool is Ovm_SpokePool {
7575
address usdb,
7676
address l1Usdb,
7777
address yieldRecipient,
78-
address blastRetriever,
79-
uint32 _hypXERC20DstDomain,
80-
uint256 _hypXERC20FeeCap
78+
address blastRetriever
8179
)
8280
Ovm_SpokePool(
8381
_wrappedNativeTokenAddress,
8482
_depositQuoteTimeBuffer,
8583
_fillDeadlineBuffer,
8684
_l2Usdc,
87-
_cctpTokenMessenger,
88-
_hypXERC20DstDomain,
89-
_hypXERC20FeeCap
85+
_cctpTokenMessenger
9086
)
9187
{
9288
USDB = usdb;

contracts/Boba_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ contract Boba_SpokePool is Ovm_SpokePool {
1111
constructor(
1212
address _wrappedNativeTokenAddress,
1313
uint32 _depositQuoteTimeBuffer,
14-
uint32 _fillDeadlineBuffer,
15-
uint32 _hypXERC20DstDomain,
16-
uint256 _hypXERC20FeeCap
14+
uint32 _fillDeadlineBuffer
1715
)
1816
Ovm_SpokePool(
1917
_wrappedNativeTokenAddress,
2018
_depositQuoteTimeBuffer,
2119
_fillDeadlineBuffer,
2220
IERC20(address(0)),
23-
ITokenMessenger(address(0)),
24-
_hypXERC20DstDomain,
25-
_hypXERC20FeeCap
21+
ITokenMessenger(address(0))
2622
)
2723
{} // solhint-disable-line no-empty-blocks
2824

contracts/Cher_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ contract Cher_SpokePool is Ovm_SpokePool {
2222
uint32 _depositQuoteTimeBuffer,
2323
uint32 _fillDeadlineBuffer,
2424
IERC20 _l2Usdc,
25-
ITokenMessenger _cctpTokenMessenger,
26-
uint32 _hypXERC20DstDomain,
27-
uint256 _hypXERC20FeeCap
25+
ITokenMessenger _cctpTokenMessenger
2826
)
2927
Ovm_SpokePool(
3028
_wrappedNativeTokenAddress,
3129
_depositQuoteTimeBuffer,
3230
_fillDeadlineBuffer,
3331
_l2Usdc,
34-
_cctpTokenMessenger,
35-
_hypXERC20DstDomain,
36-
_hypXERC20FeeCap
32+
_cctpTokenMessenger
3733
)
3834
{} // solhint-disable-line no-empty-blocks
3935

contracts/DoctorWho_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ contract DoctorWho_SpokePool is Ovm_SpokePool {
1616
uint32 _depositQuoteTimeBuffer,
1717
uint32 _fillDeadlineBuffer,
1818
IERC20 _l2Usdc,
19-
ITokenMessenger _cctpTokenMessenger,
20-
uint32 _hypXERC20DstDomain,
21-
uint256 _hypXERC20FeeCap
19+
ITokenMessenger _cctpTokenMessenger
2220
)
2321
Ovm_SpokePool(
2422
_wrappedNativeTokenAddress,
2523
_depositQuoteTimeBuffer,
2624
_fillDeadlineBuffer,
2725
_l2Usdc,
28-
_cctpTokenMessenger,
29-
_hypXERC20DstDomain,
30-
_hypXERC20FeeCap
26+
_cctpTokenMessenger
3127
)
3228
{} // solhint-disable-line no-empty-blocks
3329

contracts/Ethereum_SpokePool.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ contract Ethereum_SpokePool is SpokePool, OwnableUpgradeable {
2323
_fillDeadlineBuffer,
2424
// Ethereum_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
2525
0,
26-
0,
27-
// Ethereum_SpokePool does not use Hyperlane xERC20 messaging; setting destination eid and fee cap to 0
28-
0,
2926
0
3027
)
3128
{} // solhint-disable-line no-empty-blocks

contracts/Ink_SpokePool.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ contract Ink_SpokePool is Ovm_SpokePool {
2222
uint32 _depositQuoteTimeBuffer,
2323
uint32 _fillDeadlineBuffer,
2424
IERC20 _l2Usdc,
25-
ITokenMessenger _cctpTokenMessenger,
26-
uint32 _hypXERC20DstDomain,
27-
uint256 _hypXERC20FeeCap
25+
ITokenMessenger _cctpTokenMessenger
2826
)
2927
Ovm_SpokePool(
3028
_wrappedNativeTokenAddress,
3129
_depositQuoteTimeBuffer,
3230
_fillDeadlineBuffer,
3331
_l2Usdc,
34-
_cctpTokenMessenger,
35-
_hypXERC20DstDomain,
36-
_hypXERC20FeeCap
32+
_cctpTokenMessenger
3733
)
3834
{} // solhint-disable-line no-empty-blocks
3935

contracts/Linea_SpokePool.sol

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import "./SpokePool.sol";
88
import { IMessageService, ITokenBridge, IUSDCBridge } from "./external/interfaces/LineaInterfaces.sol";
99
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
1010
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
11-
import "./libraries/HypXERC20Adapter.sol";
1211

1312
/**
1413
* @notice Linea specific SpokePool.
@@ -46,26 +45,20 @@ contract Linea_SpokePool is SpokePool {
4645
* into the past from the block time of the deposit.
4746
* @param _fillDeadlineBuffer Fill deadlines can't be set more than this amount
4847
* into the future from the block time of the deposit.
49-
* @param _hypXERC20DstDomain Destination domain id for Hyperlane XERC20 transfers.
50-
* @param _hypXERC20FeeCap Fee cap for Hyperlane XERC20 transfers.
5148
*/
5249
/// @custom:oz-upgrades-unsafe-allow constructor
5350
constructor(
5451
address _wrappedNativeTokenAddress,
5552
uint32 _depositQuoteTimeBuffer,
56-
uint32 _fillDeadlineBuffer,
57-
uint32 _hypXERC20DstDomain,
58-
uint256 _hypXERC20FeeCap
53+
uint32 _fillDeadlineBuffer
5954
)
6055
SpokePool(
6156
_wrappedNativeTokenAddress,
6257
_depositQuoteTimeBuffer,
6358
_fillDeadlineBuffer,
6459
// Linea_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
6560
0,
66-
0,
67-
_hypXERC20DstDomain,
68-
_hypXERC20FeeCap
61+
0
6962
)
7063
{} // solhint-disable-line no-empty-blocks
7164

@@ -153,19 +146,6 @@ contract Linea_SpokePool is SpokePool {
153146
}
154147

155148
function _bridgeTokensToHubPool(uint256 amountToReturn, address l2TokenAddress) internal override {
156-
// Check if this token has a Hyperlane XERC20 router set. If so, use it
157-
address hypRouter = _getXERC20HypRouter(l2TokenAddress);
158-
if (address(hypRouter) != address(0)) {
159-
_transferXERC20ViaHyperlane(
160-
IERC20(l2TokenAddress),
161-
IHypXERC20Router(hypRouter),
162-
withdrawalRecipient,
163-
amountToReturn
164-
);
165-
// Early return here saves us from nested if branches
166-
return;
167-
}
168-
169149
// Linea's L2 Canonical Message Service, requires a minimum fee to be set.
170150
uint256 minFee = minimumFeeInWei();
171151
// We require that the caller pass in the fees as msg.value instead of pulling ETH out of this contract's balance.

0 commit comments

Comments
 (0)