Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions contracts/AlephZero_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ contract AlephZero_SpokePool is Arbitrum_SpokePool {
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _oftDstEid,
uint256 _oftFeeCap,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
uint256 _oftFeeCap
)
Arbitrum_SpokePool(
_wrappedNativeTokenAddress,
Expand All @@ -30,9 +28,7 @@ contract AlephZero_SpokePool is Arbitrum_SpokePool {
_l2Usdc,
_cctpTokenMessenger,
_oftDstEid,
_oftFeeCap,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_oftFeeCap
)
{} // solhint-disable-line no-empty-blocks
}
23 changes: 2 additions & 21 deletions contracts/Arbitrum_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity ^0.8.0;

import "./SpokePool.sol";
import "./libraries/CircleCCTPAdapter.sol";
import "./libraries/HypXERC20Adapter.sol";
import { CrossDomainAddressUtils } from "./libraries/CrossDomainAddressUtils.sol";
import { ArbitrumL2ERC20GatewayLike } from "./interfaces/ArbitrumBridge.sol";

Expand All @@ -30,19 +29,9 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _oftDstEid,
uint256 _oftFeeCap,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
uint256 _oftFeeCap
)
SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_oftDstEid,
_oftFeeCap,
_hypXERC20DstDomain,
_hypXERC20FeeCap
)
SpokePool(_wrappedNativeTokenAddress, _depositQuoteTimeBuffer, _fillDeadlineBuffer, _oftDstEid, _oftFeeCap)
CircleCCTPAdapter(_l2Usdc, _cctpTokenMessenger, CircleDomainIds.Ethereum)
{} // solhint-disable-line no-empty-blocks

Expand Down Expand Up @@ -97,20 +86,12 @@ contract Arbitrum_SpokePool is SpokePool, CircleCCTPAdapter {

function _bridgeTokensToHubPool(uint256 amountToReturn, address l2TokenAddress) internal override {
address oftMessenger = _getOftMessenger(l2TokenAddress);
address hypRouter = _getXERC20HypRouter(l2TokenAddress);

// If the l2TokenAddress is UDSC, we need to use the CCTP bridge.
if (_isCCTPEnabled() && l2TokenAddress == address(usdcToken)) {
_transferUsdc(withdrawalRecipient, amountToReturn);
} else if (oftMessenger != address(0)) {
_transferViaOFT(IERC20(l2TokenAddress), IOFT(oftMessenger), withdrawalRecipient, amountToReturn);
} else if (hypRouter != address(0)) {
_transferXERC20ViaHyperlane(
IERC20(l2TokenAddress),
IHypXERC20Router(hypRouter),
withdrawalRecipient,
amountToReturn
);
} else {
// Check that the Ethereum counterpart of the L2 token is stored on this contract.
address ethereumTokenToBridge = whitelistedTokens[l2TokenAddress];
Expand Down
8 changes: 2 additions & 6 deletions contracts/Base_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ contract Base_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
8 changes: 2 additions & 6 deletions contracts/Blast_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,14 @@ contract Blast_SpokePool is Ovm_SpokePool {
address usdb,
address l1Usdb,
address yieldRecipient,
address blastRetriever,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
address blastRetriever
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{
USDB = usdb;
Expand Down
8 changes: 2 additions & 6 deletions contracts/Boba_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ contract Boba_SpokePool is Ovm_SpokePool {
constructor(
address _wrappedNativeTokenAddress,
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
uint32 _fillDeadlineBuffer
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
IERC20(address(0)),
ITokenMessenger(address(0)),
_hypXERC20DstDomain,
_hypXERC20FeeCap
ITokenMessenger(address(0))
)
{} // solhint-disable-line no-empty-blocks

Expand Down
8 changes: 2 additions & 6 deletions contracts/Cher_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ contract Cher_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
8 changes: 2 additions & 6 deletions contracts/DoctorWho_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ contract DoctorWho_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
3 changes: 0 additions & 3 deletions contracts/Ethereum_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ contract Ethereum_SpokePool is SpokePool, OwnableUpgradeable {
_fillDeadlineBuffer,
// Ethereum_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
0,
0,
// Ethereum_SpokePool does not use Hyperlane xERC20 messaging; setting destination eid and fee cap to 0
0,
0
)
{} // solhint-disable-line no-empty-blocks
Expand Down
8 changes: 2 additions & 6 deletions contracts/Ink_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ contract Ink_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
24 changes: 2 additions & 22 deletions contracts/Linea_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import "./SpokePool.sol";
import { IMessageService, ITokenBridge, IUSDCBridge } from "./external/interfaces/LineaInterfaces.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./libraries/HypXERC20Adapter.sol";

/**
* @notice Linea specific SpokePool.
Expand Down Expand Up @@ -46,26 +45,20 @@ contract Linea_SpokePool is SpokePool {
* into the past from the block time of the deposit.
* @param _fillDeadlineBuffer Fill deadlines can't be set more than this amount
* into the future from the block time of the deposit.
* @param _hypXERC20DstDomain Destination domain id for Hyperlane XERC20 transfers.
* @param _hypXERC20FeeCap Fee cap for Hyperlane XERC20 transfers.
*/
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(
address _wrappedNativeTokenAddress,
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
uint32 _fillDeadlineBuffer
)
SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
// Linea_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
0,
0,
_hypXERC20DstDomain,
_hypXERC20FeeCap
0
)
{} // solhint-disable-line no-empty-blocks

Expand Down Expand Up @@ -153,19 +146,6 @@ contract Linea_SpokePool is SpokePool {
}

function _bridgeTokensToHubPool(uint256 amountToReturn, address l2TokenAddress) internal override {
// Check if this token has a Hyperlane XERC20 router set. If so, use it
address hypRouter = _getXERC20HypRouter(l2TokenAddress);
if (address(hypRouter) != address(0)) {
_transferXERC20ViaHyperlane(
IERC20(l2TokenAddress),
IHypXERC20Router(hypRouter),
withdrawalRecipient,
amountToReturn
);
// Early return here saves us from nested if branches
return;
}

// Linea's L2 Canonical Message Service, requires a minimum fee to be set.
uint256 minFee = minimumFeeInWei();
// We require that the caller pass in the fees as msg.value instead of pulling ETH out of this contract's balance.
Expand Down
8 changes: 2 additions & 6 deletions contracts/Lisk_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ contract Lisk_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
8 changes: 2 additions & 6 deletions contracts/Mode_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ contract Mode_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
8 changes: 2 additions & 6 deletions contracts/Optimism_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ contract Optimism_SpokePool is Ovm_SpokePool {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
Ovm_SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
_l2Usdc,
_cctpTokenMessenger,
_hypXERC20DstDomain,
_hypXERC20FeeCap
_cctpTokenMessenger
)
{} // solhint-disable-line no-empty-blocks

Expand Down
20 changes: 2 additions & 18 deletions contracts/Ovm_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.0;
import "./SpokePool.sol";
import "./external/interfaces/WETH9Interface.sol";
import "./libraries/CircleCCTPAdapter.sol";
import "./libraries/HypXERC20Adapter.sol";

import "@openzeppelin/contracts-upgradeable/crosschain/optimism/LibOptimismUpgradeable.sol";
import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol";
Expand Down Expand Up @@ -71,19 +70,15 @@ contract Ovm_SpokePool is SpokePool, CircleCCTPAdapter {
uint32 _depositQuoteTimeBuffer,
uint32 _fillDeadlineBuffer,
IERC20 _l2Usdc,
ITokenMessenger _cctpTokenMessenger,
uint32 _hypXERC20DstDomain,
uint256 _hypXERC20FeeCap
ITokenMessenger _cctpTokenMessenger
)
SpokePool(
_wrappedNativeTokenAddress,
_depositQuoteTimeBuffer,
_fillDeadlineBuffer,
// Ovm_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
0,
0,
_hypXERC20DstDomain,
_hypXERC20FeeCap
0
)
CircleCCTPAdapter(_l2Usdc, _cctpTokenMessenger, CircleDomainIds.Ethereum)
{} // solhint-disable-line no-empty-blocks
Expand Down Expand Up @@ -160,8 +155,6 @@ contract Ovm_SpokePool is SpokePool, CircleCCTPAdapter {
}

function _bridgeTokensToHubPool(uint256 amountToReturn, address l2TokenAddress) internal virtual override {
address hypRouter = _getXERC20HypRouter(l2TokenAddress);

// If the token being bridged is WETH then we need to first unwrap it to ETH and then send ETH over the
// canonical bridge. On Optimism, this is address 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000.
if (l2TokenAddress == address(wrappedNativeToken)) {
Expand All @@ -179,15 +172,6 @@ contract Ovm_SpokePool is SpokePool, CircleCCTPAdapter {
else if (_isCCTPEnabled() && l2TokenAddress == address(usdcToken)) {
_transferUsdc(withdrawalRecipient, amountToReturn);
}
// If the token has a Hyperlane XERC20 router, use it for bridging
else if (hypRouter != address(0)) {
_transferXERC20ViaHyperlane(
IERC20(l2TokenAddress),
IHypXERC20Router(hypRouter),
withdrawalRecipient,
amountToReturn
);
}
// Note we'll default to withdrawTo instead of bridgeERC20To unless the remoteL1Tokens mapping is set for
// the l2TokenAddress. withdrawTo should be used to bridge back non-native L2 tokens
// (i.e. non-native L2 tokens have a canonical L1 token). If we should bridge "native L2" tokens then
Expand Down
3 changes: 0 additions & 3 deletions contracts/PolygonZkEVM_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ contract PolygonZkEVM_SpokePool is SpokePool, IBridgeMessageReceiver {
_fillDeadlineBuffer,
// PolygonZkEVM_SpokePool does not use OFT messaging; setting destination eid and fee cap to 0
0,
0,
// PolygonZkEVM_SpokePool does not use Hyperlane xERC20 messaging; setting destination eid and fee cap to 0
0,
0
)
{} // solhint-disable-line no-empty-blocks
Expand Down
Loading
Loading