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
4 changes: 2 additions & 2 deletions contracts/AcrossConfigStore.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@uma/core/contracts/common/implementation/MultiCaller.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "contracts/external/uma/core/contracts/common/implementation/MultiCaller.sol";
import "@openzeppelin/contracts-v4/access/Ownable.sol";

/**
* @title Allows admin to set and update configuration settings for full contract system. These settings are designed
Expand Down
2 changes: 1 addition & 1 deletion contracts/AdapterStore.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Ownable } from "@openzeppelin/contracts-v4/access/Ownable.sol";
import { IOFT } from "./interfaces/IOFT.sol";

/**
Expand Down
12 changes: 4 additions & 8 deletions contracts/Blast_DaiRetriever.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pragma solidity ^0.8.0;

import "./Lockable.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@uma/core/contracts/common/implementation/MultiCaller.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "contracts/external/uma/core/contracts/common/implementation/MultiCaller.sol";

interface USDYieldManager {
function claimWithdrawal(uint256 _requestId, uint256 _hintId) external returns (bool success);
Expand Down Expand Up @@ -36,11 +36,7 @@ contract Blast_DaiRetriever is Lockable, MultiCaller {
* @param _usdYieldManager USDCYieldManager contract on Ethereum.
* @param _dai DAI token to be retrieved.
*/
constructor(
address _hubPool,
USDYieldManager _usdYieldManager,
IERC20Upgradeable _dai
) {
constructor(address _hubPool, USDYieldManager _usdYieldManager, IERC20Upgradeable _dai) {
//slither-disable-next-line missing-zero-check
hubPool = _hubPool;
usdYieldManager = _usdYieldManager;
Expand Down
10 changes: 3 additions & 7 deletions contracts/BondToken.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts-v4/access/Ownable.sol";
import "@openzeppelin/contracts-v4/utils/Address.sol";

import "./interfaces/HubPoolInterface.sol";
import "./external/WETH9.sol";
Expand Down Expand Up @@ -71,11 +71,7 @@ contract BondToken is WETH9, Ownable {
* @param amt Amount to transfer.
* @return True on success.
*/
function transferFrom(
address src,
address dst,
uint256 amt
) public override returns (bool) {
function transferFrom(address src, address dst, uint256 amt) public override returns (bool) {
if (dst == address(HUB_POOL)) {
require(proposers[src] || HUB_POOL.rootBundleProposal().proposer != src, "Transfer not permitted");
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/Ethereum_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

import "./SpokePool.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/access/OwnableUpgradeable.sol";

/**
* @notice Ethereum L1 specific SpokePool. Used on Ethereum L1 to facilitate L2->L1 transfers.
Expand Down
84 changes: 36 additions & 48 deletions contracts/HubPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import "./Lockable.sol";
import "./interfaces/LpTokenFactoryInterface.sol";
import "./external/interfaces/WETH9Interface.sol";

import "@uma/core/contracts/common/implementation/Testable.sol";
import "@uma/core/contracts/common/implementation/MultiCaller.sol";
import "@uma/core/contracts/common/interfaces/AddressWhitelistInterface.sol";
import "contracts/external/uma/core/contracts/common/implementation/Testable.sol";
import "contracts/external/uma/core/contracts/common/implementation/MultiCaller.sol";
import "contracts/external/uma/core/contracts/common/interfaces/AddressWhitelistInterface.sol";

import "@uma/core/contracts/data-verification-mechanism/interfaces/FinderInterface.sol";
import "@uma/core/contracts/data-verification-mechanism/interfaces/IdentifierWhitelistInterface.sol";
import "@uma/core/contracts/data-verification-mechanism/interfaces/StoreInterface.sol";
import "@uma/core/contracts/data-verification-mechanism/implementation/Constants.sol";
import "contracts/external/uma/core/contracts/data-verification-mechanism/interfaces/FinderInterface.sol";
import "contracts/external/uma/core/contracts/data-verification-mechanism/interfaces/IdentifierWhitelistInterface.sol";
import "contracts/external/uma/core/contracts/data-verification-mechanism/interfaces/StoreInterface.sol";
import "contracts/external/uma/core/contracts/data-verification-mechanism/implementation/Constants.sol";

import "@uma/core/contracts/optimistic-oracle-v2/interfaces/SkinnyOptimisticOracleInterface.sol";
import "@uma/core/contracts/common/interfaces/ExpandedIERC20.sol";
import "contracts/external/uma/core/contracts/optimistic-oracle-v2/interfaces/SkinnyOptimisticOracleInterface.sol";
import "contracts/external/uma/core/contracts/common/interfaces/ExpandedIERC20.sol";

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts-v4/access/Ownable.sol";
import "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-v4/utils/Address.sol";

/**
* @notice Contract deployed on Ethereum that houses L1 token liquidity for all SpokePools. A dataworker can interact
Expand Down Expand Up @@ -246,12 +246,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
* @param chainId Chain with SpokePool to send message to.
* @param functionData ABI encoded function call to send to SpokePool, but can be any arbitrary data technically.
*/
function relaySpokePoolAdminFunction(uint256 chainId, bytes memory functionData)
public
override
onlyOwner
nonReentrant
{
function relaySpokePoolAdminFunction(
uint256 chainId,
bytes memory functionData
) public override onlyOwner nonReentrant {
_relaySpokePoolAdminFunction(chainId, functionData);
}

Expand All @@ -260,12 +258,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
* @param newProtocolFeeCaptureAddress New protocol fee capture address.
* @param newProtocolFeeCapturePct New protocol fee capture %.
*/
function setProtocolFeeCapture(address newProtocolFeeCaptureAddress, uint256 newProtocolFeeCapturePct)
public
override
onlyOwner
nonReentrant
{
function setProtocolFeeCapture(
address newProtocolFeeCaptureAddress,
uint256 newProtocolFeeCapturePct
) public override onlyOwner nonReentrant {
require(newProtocolFeeCapturePct <= 1e18, "Bad protocolFeeCapturePct");
require(newProtocolFeeCaptureAddress != address(0), "Bad protocolFeeCaptureAddress");
protocolFeeCaptureAddress = newProtocolFeeCaptureAddress;
Expand All @@ -278,13 +274,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
* @param newBondToken New bond currency.
* @param newBondAmount New bond amount.
*/
function setBond(IERC20 newBondToken, uint256 newBondAmount)
public
override
onlyOwner
noActiveRequests
nonReentrant
{
function setBond(
IERC20 newBondToken,
uint256 newBondAmount
) public override onlyOwner noActiveRequests nonReentrant {
// Bond should not equal final fee otherwise every proposal will get cancelled in a dispute.
// In practice we expect that bond amounts are set >> final fees so this shouldn't be an inconvenience.
// The only way for the bond amount to be equal to the final fee is if the newBondAmount == 0.
Expand Down Expand Up @@ -527,11 +520,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
* @param relayedAmount The higher this amount, the higher the utilization.
* @return % of liquid reserves currently being "used" and sitting in SpokePools plus the relayedAmount.
*/
function liquidityUtilizationPostRelay(address l1Token, uint256 relayedAmount)
public
nonReentrant
returns (uint256)
{
function liquidityUtilizationPostRelay(
address l1Token,
uint256 relayedAmount
) public nonReentrant returns (uint256) {
return _liquidityUtilizationPostRelay(l1Token, relayedAmount);
}

Expand Down Expand Up @@ -826,12 +818,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
* @return destinationToken address The destination token that is sent to spoke pools after this contract bridges
* the l1Token to the destination chain.
*/
function poolRebalanceRoute(uint256 destinationChainId, address l1Token)
external
view
override
returns (address destinationToken)
{
function poolRebalanceRoute(
uint256 destinationChainId,
address l1Token
) external view override returns (address destinationToken) {
return poolRebalanceRoutes[_poolRebalanceRouteKey(l1Token, destinationChainId)];
}

Expand Down Expand Up @@ -1043,11 +1033,9 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
return keccak256(abi.encode(l1Token, destinationChainId));
}

function _getInitializedCrossChainContracts(uint256 chainId)
internal
view
returns (address adapter, address spokePool)
{
function _getInitializedCrossChainContracts(
uint256 chainId
) internal view returns (address adapter, address spokePool) {
adapter = crossChainContracts[chainId].adapter;
spokePool = crossChainContracts[chainId].spokePool;
require(spokePool != address(0), "SpokePool not initialized");
Expand Down
4 changes: 2 additions & 2 deletions contracts/Linea_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pragma solidity ^0.8.19;
import "./SpokePool.sol";
import "./libraries/CircleCCTPAdapter.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 "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";

/**
* @notice Linea specific SpokePool.
Expand Down
8 changes: 2 additions & 6 deletions contracts/LpTokenFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import "./interfaces/LpTokenFactoryInterface.sol";

import "@uma/core/contracts/common/implementation/ExpandedERC20.sol";
import "contracts/external/uma/core/contracts/common/implementation/ExpandedERC20.sol";

/**
* @notice Factory to create new LP ERC20 tokens that represent a liquidity provider's position. HubPool is the
Expand All @@ -30,11 +30,7 @@ contract LpTokenFactory is LpTokenFactoryInterface {
return address(lpToken);
}

function _concatenate(
string memory a,
string memory b,
string memory c
) internal pure returns (string memory) {
function _concatenate(string memory a, string memory b, string memory c) internal pure returns (string memory) {
return string(abi.encodePacked(a, b, c));
}
}
2 changes: 1 addition & 1 deletion contracts/MerkleLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "./interfaces/SpokePoolInterface.sol";
import "./interfaces/V3SpokePoolInterface.sol";
import "./interfaces/HubPoolInterface.sol";

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts-v4/utils/cryptography/MerkleProof.sol";

/**
* @notice Library to help with merkle roots, proofs, and claims.
Expand Down
2 changes: 1 addition & 1 deletion contracts/Ovm_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "./SpokePool.sol";
import "./external/interfaces/WETH9Interface.sol";
import "./libraries/CircleCCTPAdapter.sol";

import "@openzeppelin/contracts-upgradeable/crosschain/optimism/LibOptimismUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/crosschain/optimism/LibOptimismUpgradeable.sol";
import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol";

// https://github.com/ethereum-optimism/optimism/blob/bf51c4935261634120f31827c3910aa631f6bf9c/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol
Expand Down
4 changes: 2 additions & 2 deletions contracts/PermissionSplitterProxy.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

import "@uma/core/contracts/common/implementation/MultiCaller.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "contracts/external/uma/core/contracts/common/implementation/MultiCaller.sol";
import "@openzeppelin/contracts-v4/access/AccessControl.sol";

/**
* @notice This contract is designed to own an Ownable "target" contract and gate access to specific
Expand Down
4 changes: 2 additions & 2 deletions contracts/PolygonTokenBridger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.0;
import "./Lockable.sol";
import "./external/interfaces/WETH9Interface.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/utils/SafeERC20Upgradeable.sol";

// Polygon Registry contract that stores their addresses.
interface PolygonRegistry {
Expand Down
10 changes: 3 additions & 7 deletions contracts/PolygonZkEVM_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.0;
import "./SpokePool.sol";
import "./external/interfaces/IPolygonZkEVMBridge.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";

/**
* @notice Define interface for PolygonZkEVM Bridge message receiver
Expand All @@ -18,11 +18,7 @@ interface IBridgeMessageReceiver {
* @param originNetwork Polygon zkEVM's internal network id of source chain.
* @param data Data to be received and executed on this contract.
*/
function onMessageReceived(
address originAddress,
uint32 originNetwork,
bytes memory data
) external payable;
function onMessageReceived(address originAddress, uint32 originNetwork, bytes memory data) external payable;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import "./libraries/AddressConverters.sol";
import { IOFT, SendParam, MessagingFee } from "./interfaces/IOFT.sol";
import { OFTTransportAdapter } from "./libraries/OFTTransportAdapter.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts/utils/math/SignedMath.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-v4/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts-upgradeable-v4/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-v4/utils/math/SignedMath.sol";

/**
* @title SpokePool
Expand Down
16 changes: 8 additions & 8 deletions contracts/SpokePoolPeriphery.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { MultiCaller } from "@uma/core/contracts/common/implementation/MultiCaller.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import { EIP712 } from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import { IERC20 } from "@openzeppelin/contracts-v4/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";
import { IERC20Permit } from "@openzeppelin/contracts-v4/token/ERC20/extensions/IERC20Permit.sol";
import { Address } from "@openzeppelin/contracts-v4/utils/Address.sol";
import { MultiCaller } from "contracts/external/uma/core/contracts/common/implementation/MultiCaller.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-v4/security/ReentrancyGuard.sol";
import { SignatureChecker } from "@openzeppelin/contracts-v4/utils/cryptography/SignatureChecker.sol";
import { EIP712 } from "@openzeppelin/contracts-v4/utils/cryptography/EIP712.sol";
import { V3SpokePoolInterface } from "./interfaces/V3SpokePoolInterface.sol";
import { IERC20Auth } from "./external/interfaces/IERC20Auth.sol";
import { WETH9Interface } from "./external/interfaces/WETH9Interface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/SpokePoolVerifier.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts-v4/utils/Address.sol";
import "./interfaces/V3SpokePoolInterface.sol";
import { AddressToBytes32 } from "./libraries/AddressConverters.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Universal_SpokePool.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable-v4/access/OwnableUpgradeable.sol";

import { IHelios } from "./external/interfaces/IHelios.sol";
import "./libraries/CircleCCTPAdapter.sol";
Expand Down
8 changes: 2 additions & 6 deletions contracts/ZkSync_SpokePool.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-v4/token/ERC20/utils/SafeERC20.sol";
import { CircleCCTPAdapter, CircleDomainIds, ITokenMessenger } from "./libraries/CircleCCTPAdapter.sol";
import { CrossDomainAddressUtils } from "./libraries/CrossDomainAddressUtils.sol";
import "./SpokePool.sol";

// https://github.com/matter-labs/era-contracts/blob/6391c0d7bf6184d7f6718060e3991ba6f0efe4a7/zksync/contracts/bridge/L2ERC20Bridge.sol#L104
interface ZkBridgeLike {
function withdraw(
address _l1Receiver,
address _l2Token,
uint256 _amount
) external;
function withdraw(address _l1Receiver, address _l2Token, uint256 _amount) external;
}

interface IL2ETH {
Expand Down
Loading
Loading