diff --git a/contracts/gauge/LeafCLGauge.sol b/contracts/gauge/LeafCLGauge.sol index f5dc454..5d552ee 100644 --- a/contracts/gauge/LeafCLGauge.sol +++ b/contracts/gauge/LeafCLGauge.sol @@ -17,6 +17,33 @@ import {VelodromeTimeLibrary} from "contracts/libraries/VelodromeTimeLibrary.sol import {IReward} from "contracts/gauge/interfaces/IReward.sol"; import {ILeafMessageBridge} from "contracts/superchain/ILeafMessageBridge.sol"; +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██╗ ███████╗ █████╗ ███████╗ ██████╗██╗ ██████╗ █████╗ ██╗ ██╗ ██████╗ ███████╗ +██║ ██╔════╝██╔══██╗██╔════╝██╔════╝██║ ██╔════╝ ██╔══██╗██║ ██║██╔════╝ ██╔════╝ +██║ █████╗ ███████║█████╗ ██║ ██║ ██║ ███╗███████║██║ ██║██║ ███╗█████╗ +██║ ██╔══╝ ██╔══██║██╔══╝ ██║ ██║ ██║ ██║██╔══██║██║ ██║██║ ██║██╔══╝ +███████╗███████╗██║ ██║██║ ╚██████╗███████╗╚██████╔╝██║ ██║╚██████╔╝╚██████╔╝███████╗ +╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +*/ + +/// @title Velodrome Superchain Leaf CL Gauge Contracts +/// @notice Leaf gauge contract for distribution of emissions by address contract LeafCLGauge is ILeafCLGauge, ERC721Holder, ReentrancyGuard { using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; diff --git a/contracts/gauge/LeafCLGaugeFactory.sol b/contracts/gauge/LeafCLGaugeFactory.sol index 755362c..d9d6aac 100644 --- a/contracts/gauge/LeafCLGaugeFactory.sol +++ b/contracts/gauge/LeafCLGaugeFactory.sol @@ -6,7 +6,40 @@ import "./LeafCLGauge.sol"; import {CreateXLibrary} from "contracts/libraries/CreateXLibrary.sol"; -/// @notice Factory that creates leaf gauges on the superchain +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██╗ ███████╗ █████╗ ███████╗ ██████╗██╗ ██████╗ █████╗ ██╗ ██╗ ██████╗ ███████╗ +██║ ██╔════╝██╔══██╗██╔════╝██╔════╝██║ ██╔════╝ ██╔══██╗██║ ██║██╔════╝ ██╔════╝ +██║ █████╗ ███████║█████╗ ██║ ██║ ██║ ███╗███████║██║ ██║██║ ███╗█████╗ +██║ ██╔══╝ ██╔══██║██╔══╝ ██║ ██║ ██║ ██║██╔══██║██║ ██║██║ ██║██╔══╝ +███████╗███████╗██║ ██║██║ ╚██████╗███████╗╚██████╔╝██║ ██║╚██████╔╝╚██████╔╝███████╗ +╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +███████╗ █████╗ ██████╗████████╗ ██████╗ ██████╗ ██╗ ██╗ +██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝ +█████╗ ███████║██║ ██║ ██║ ██║██████╔╝ ╚████╔╝ +██╔══╝ ██╔══██║██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝ +██║ ██║ ██║╚██████╗ ██║ ╚██████╔╝██║ ██║ ██║ +╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ + +*/ + +/// @title Velodrome Superchain Leaf CL Gauge Factory +/// @notice Used to deploy Leaf CL Gauge contracts for distribution of emissions contract LeafCLGaugeFactory is ILeafCLGaugeFactory { using CreateXLibrary for bytes11; diff --git a/contracts/root/gauge/RootCLGauge.sol b/contracts/root/gauge/RootCLGauge.sol index bb1ab7d..65012a4 100644 --- a/contracts/root/gauge/RootCLGauge.sol +++ b/contracts/root/gauge/RootCLGauge.sol @@ -13,7 +13,33 @@ import {IVoter} from "../../core/interfaces/IVoter.sol"; import {VelodromeTimeLibrary} from "../../libraries/VelodromeTimeLibrary.sol"; import {Commands} from "../../libraries/Commands.sol"; -/// @notice RootGauge that forward emissions to the corresponding LeafGauge on the leaf chain +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██████╗ ██████╗ ██████╗ ████████╗ ██████╗██╗ ██████╗ █████╗ ██╗ ██╗ ██████╗ ███████╗ +██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██╔════╝██║ ██╔════╝ ██╔══██╗██║ ██║██╔════╝ ██╔════╝ +██████╔╝██║ ██║██║ ██║ ██║ ██║ ██║ ██║ ███╗███████║██║ ██║██║ ███╗█████╗ +██╔══██╗██║ ██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══██║██║ ██║██║ ██║██╔══╝ +██║ ██║╚██████╔╝╚██████╔╝ ██║ ╚██████╗███████╗╚██████╔╝██║ ██║╚██████╔╝╚██████╔╝███████╗ +╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +*/ + +/// @title Velodrome Superchain Root CL Gauge Contracts +/// @notice RootCLGauge contract that forwards emissions to the corresponding LeafCLGauge on the leaf chain contract RootCLGauge is IRootCLGauge { using SafeERC20 for IERC20; diff --git a/contracts/root/gauge/RootCLGaugeFactory.sol b/contracts/root/gauge/RootCLGaugeFactory.sol index f1df5a8..bb4e95e 100644 --- a/contracts/root/gauge/RootCLGaugeFactory.sol +++ b/contracts/root/gauge/RootCLGaugeFactory.sol @@ -15,7 +15,40 @@ import {IRootMessageBridge} from "../interfaces/bridge/IRootMessageBridge.sol"; import {IVoter} from "../../core/interfaces/IVoter.sol"; import {IMinter} from "../../core/interfaces/IMinter.sol"; -/// @notice Factory that creates root gauges on root +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██████╗ ██████╗ ██████╗ ████████╗ ██████╗██╗ ██████╗ █████╗ ██╗ ██╗ ██████╗ ███████╗ +██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██╔════╝██║ ██╔════╝ ██╔══██╗██║ ██║██╔════╝ ██╔════╝ +██████╔╝██║ ██║██║ ██║ ██║ ██║ ██║ ██║ ███╗███████║██║ ██║██║ ███╗█████╗ +██╔══██╗██║ ██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══██║██║ ██║██║ ██║██╔══╝ +██║ ██║╚██████╔╝╚██████╔╝ ██║ ╚██████╗███████╗╚██████╔╝██║ ██║╚██████╔╝╚██████╔╝███████╗ +╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +███████╗ █████╗ ██████╗████████╗ ██████╗ ██████╗ ██╗ ██╗ +██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝ +█████╗ ███████║██║ ██║ ██║ ██║██████╔╝ ╚████╔╝ +██╔══╝ ██╔══██║██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝ +██║ ██║ ██║╚██████╗ ██║ ╚██████╔╝██║ ██║ ██║ +╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ + +*/ + +/// @title Velodrome Superchain Root CL Gauge Factory +/// @notice Factory that creates Root CL Gauges on the root chain contract RootCLGaugeFactory is IRootCLGaugeFactory { using CreateXLibrary for bytes11; diff --git a/contracts/root/interfaces/bridge/IChainRegistry.sol b/contracts/root/interfaces/bridge/ICrossChainRegistry.sol similarity index 93% rename from contracts/root/interfaces/bridge/IChainRegistry.sol rename to contracts/root/interfaces/bridge/ICrossChainRegistry.sol index 8ced8b3..c9cf0cb 100644 --- a/contracts/root/interfaces/bridge/IChainRegistry.sol +++ b/contracts/root/interfaces/bridge/ICrossChainRegistry.sol @@ -1,10 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity =0.7.6; -interface IChainRegistry { - event ChainRegistered(uint256 indexed _chainid); - event ChainDeregistered(uint256 indexed _chainid); - +interface ICrossChainRegistry { /// @notice Add support for a chain with messages forwarded to a given module /// @dev Check module code if adding a new module for the first time /// @param _chainid Chain ID to add diff --git a/contracts/root/interfaces/bridge/IMessageSender.sol b/contracts/root/interfaces/bridge/IMessageSender.sol index 1309415..a4a4eef 100644 --- a/contracts/root/interfaces/bridge/IMessageSender.sol +++ b/contracts/root/interfaces/bridge/IMessageSender.sol @@ -2,7 +2,9 @@ pragma solidity =0.7.6; interface IMessageSender { - event SentMessage(uint32 indexed _destination, bytes32 indexed _recipient, uint256 _value, string _message); + event SentMessage( + uint32 indexed _destination, bytes32 indexed _recipient, uint256 _value, string _message, string _metadata + ); /// @notice Sends a message to the destination module /// @dev All message modules must implement this function @@ -14,5 +16,5 @@ interface IMessageSender { /// @param _destinationDomain The chain id of the destination chain /// @param _messageBody The message body to be dispatched /// @return The amount of native token required to dispatch the message - function quote(uint256 _destinationDomain, bytes calldata _messageBody) external payable returns (uint256); + function quote(uint256 _destinationDomain, bytes calldata _messageBody) external view returns (uint256); } diff --git a/contracts/root/interfaces/bridge/IRootMessageBridge.sol b/contracts/root/interfaces/bridge/IRootMessageBridge.sol index 3423a47..8620ab5 100644 --- a/contracts/root/interfaces/bridge/IRootMessageBridge.sol +++ b/contracts/root/interfaces/bridge/IRootMessageBridge.sol @@ -3,36 +3,25 @@ pragma solidity =0.7.6; interface IRootMessageBridge { // error InvalidCommand(); - // error ZeroAddress(); // error NotAuthorized(uint256 command); // error NotValidGauge(); - - event ModuleSet(address indexed _sender, address indexed _module); + // error NotWETH(); /// @notice Returns the address of the xERC20 token that is bridged by this contract function xerc20() external view returns (address); - /// @notice Returns the address of the module contract that is allowed to send messages x-chain - function module() external view returns (address); - - /// @notice Returns the address of the WETH contract - function weth() external view returns (address); - /// @notice Returns the address of the voter contract /// @dev Used to verify the sender of a message function voter() external view returns (address); - /// @notice Returns the address of the Gauge Factory associated with Bridge - /// @dev Gauge Factory maintains the same address across all Chains - function gaugeFactory() external view returns (address); + /// @notice Returns the address of the factory registry contract + function factoryRegistry() external view returns (address); - /// @notice Sets the address of the module contract that is allowed to send messages x-chain - /// @dev Module handles x-chain messages - /// @param _module The address of the new module contract - function setModule(address _module) external; + /// @notice Returns the address of the WETH contract + function weth() external view returns (address); /// @notice Sends a message to the msg.sender via the module contract /// @param _message The message /// @param _chainid The chain id of chain the recipient contract is on - function sendMessage(uint256 _chainid, bytes calldata _message) external payable; + function sendMessage(uint256 _chainid, bytes calldata _message) external; } diff --git a/contracts/root/interfaces/bridge/hyperlane/ILeafHLMessageModule.sol b/contracts/root/interfaces/bridge/hyperlane/ILeafHLMessageModule.sol index b7c662c..2648b13 100644 --- a/contracts/root/interfaces/bridge/hyperlane/ILeafHLMessageModule.sol +++ b/contracts/root/interfaces/bridge/hyperlane/ILeafHLMessageModule.sol @@ -17,7 +17,4 @@ interface ILeafHLMessageModule { /// @notice Returns the address of the security module contract used by the bridge function securityModule() external view returns (address); - - /// @notice Returns the nonce of the next message to be received - function receivingNonce() external view returns (uint256); } diff --git a/contracts/root/interfaces/bridge/hyperlane/IRootHLMessageModule.sol b/contracts/root/interfaces/bridge/hyperlane/IRootHLMessageModule.sol index 3c33288..44e0141 100644 --- a/contracts/root/interfaces/bridge/hyperlane/IRootHLMessageModule.sol +++ b/contracts/root/interfaces/bridge/hyperlane/IRootHLMessageModule.sol @@ -7,6 +7,21 @@ interface IRootHLMessageModule is IMessageSender { /// @notice Returns the address of the bridge contract that this module is associated with function bridge() external view returns (address); + /// @notice Returns the address of the xERC20 token that is bridged by this contract + function xerc20() external view returns (address); + /// @notice Returns the address of the mailbox contract that is used to bridge by this contract function mailbox() external view returns (address); + + /// @notice Returns the address of the voter contract that sets voting power + function voter() external view returns (address); + + /// @notice Returns the address of the hook contract used after dispatching a message + /// @dev If set to zero address, default hook will be used instead + function hook() external view returns (address); + + /// @notice Sets the address of the hook contract that will be used in x-chain messages + /// @dev Can use default hook by setting to zero address + /// @param _hook The address of the new hook contract + function setHook(address _hook) external; } diff --git a/contracts/root/interfaces/gauge/IRootCLGauge.sol b/contracts/root/interfaces/gauge/IRootCLGauge.sol index 6f974a0..b157759 100644 --- a/contracts/root/interfaces/gauge/IRootCLGauge.sol +++ b/contracts/root/interfaces/gauge/IRootCLGauge.sol @@ -32,8 +32,10 @@ interface IRootCLGauge { function left() external view returns (uint256); /// @notice Used by voter to deposit rewards to the gauge + /// @param _amount Amount of rewards to be deposited into gauge function notifyRewardAmount(uint256 _amount) external; /// @notice Used by notify admin to deposit rewards to the gauge without distributing fees + /// @param _amount Amount of rewards to be deposited into gauge function notifyRewardWithoutClaim(uint256 _amount) external; } diff --git a/contracts/root/interfaces/pool/IRootCLPoolFactory.sol b/contracts/root/interfaces/pool/IRootCLPoolFactory.sol index 0d2ab01..584a730 100644 --- a/contracts/root/interfaces/pool/IRootCLPoolFactory.sol +++ b/contracts/root/interfaces/pool/IRootCLPoolFactory.sol @@ -3,10 +3,8 @@ pragma solidity >=0.5.0; import {IVoter} from "../../../core/interfaces/IVoter.sol"; -/// @title Minimal CL Factory interface -/// @notice Used to support the integration with the core implementation -/// @notice The CL Factory facilitates creation of CL pools and control over the protocol fees -/// @dev For full context, please review the Uniswap implementation under GPL license. +/// @title Velodrome Superchain Root CL Pool Factory interface +/// @notice The Factory is used to create Root CL Pools interface IRootCLPoolFactory { event OwnerChanged(address indexed oldOwner, address indexed newOwner); @@ -50,7 +48,7 @@ interface IRootCLPoolFactory { /// @return List of enabled tick spacings function tickSpacings() external view returns (int24[] memory); - /// @notice Returns the root pool address for a given pair of tokens and a tick spacing, or address 0 if it does not exist + /// @notice Returns the root pool address for a given pair of tokens, a tick spacing and chainid, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param chainid Chain ID associated with pool /// @param tokenA The contract address of either token0 or token1 diff --git a/contracts/root/pool/RootCLPool.sol b/contracts/root/pool/RootCLPool.sol index 990618a..8b2353a 100644 --- a/contracts/root/pool/RootCLPool.sol +++ b/contracts/root/pool/RootCLPool.sol @@ -3,7 +3,33 @@ pragma solidity =0.7.6; import {IRootCLPool} from "../interfaces/pool/IRootCLPool.sol"; -/// @notice RootPool used as basis for creating RootGauges +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██████╗ ██████╗ ██████╗ ████████╗ ██████╗██╗ ██████╗ ██████╗ ██████╗ ██╗ +██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██╔════╝██║ ██╔══██╗██╔═══██╗██╔═══██╗██║ +██████╔╝██║ ██║██║ ██║ ██║ ██║ ██║ ██████╔╝██║ ██║██║ ██║██║ +██╔══██╗██║ ██║██║ ██║ ██║ ██║ ██║ ██╔═══╝ ██║ ██║██║ ██║██║ +██║ ██║╚██████╔╝╚██████╔╝ ██║ ╚██████╗███████╗██║ ╚██████╔╝╚██████╔╝███████╗ +╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +*/ + +/// @title Velodrome Superchain Root CL Pool Contracts +/// @notice RootCLPool used as basis for creating RootCLGauges /// @dev Not a real pool contract RootCLPool is IRootCLPool { /// @inheritdoc IRootCLPool diff --git a/contracts/root/pool/RootCLPoolFactory.sol b/contracts/root/pool/RootCLPoolFactory.sol index 927c1ea..8a4bec8 100644 --- a/contracts/root/pool/RootCLPoolFactory.sol +++ b/contracts/root/pool/RootCLPoolFactory.sol @@ -1,14 +1,46 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity =0.7.6; -import "@openzeppelin/contracts/proxy/Clones.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; import {IRootCLPoolFactory} from "../interfaces/pool/IRootCLPoolFactory.sol"; import {IRootCLPool} from "../interfaces/pool/IRootCLPool.sol"; -import {IChainRegistry} from "../interfaces/bridge/IChainRegistry.sol"; - -/// @notice Factory for creating RootPools +import {ICrossChainRegistry} from "../interfaces/bridge/ICrossChainRegistry.sol"; + +/* + +██╗ ██╗███████╗██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ +██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝ +██║ ██║█████╗ ██║ ██║ ██║██║ ██║██████╔╝██║ ██║██╔████╔██║█████╗ +╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██║ ██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝ + ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ + ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + +███████╗██╗ ██╗██████╗ ███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║ ██║██╔══██╗██║████╗ ██║ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝██║ ███████║███████║██║██╔██╗ ██║ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗██║ ██╔══██║██╔══██║██║██║╚██╗██║ +███████║╚██████╔╝██║ ███████╗██║ ██║╚██████╗██║ ██║██║ ██║██║██║ ╚████║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ + +██████╗ ██████╗ ██████╗ ████████╗ ██████╗██╗ ██████╗ ██████╗ ██████╗ ██╗ +██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██╔════╝██║ ██╔══██╗██╔═══██╗██╔═══██╗██║ +██████╔╝██║ ██║██║ ██║ ██║ ██║ ██║ ██████╔╝██║ ██║██║ ██║██║ +██╔══██╗██║ ██║██║ ██║ ██║ ██║ ██║ ██╔═══╝ ██║ ██║██║ ██║██║ +██║ ██║╚██████╔╝╚██████╔╝ ██║ ╚██████╗███████╗██║ ╚██████╔╝╚██████╔╝███████╗ +╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +███████╗ █████╗ ██████╗████████╗ ██████╗ ██████╗ ██╗ ██╗ +██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝ +█████╗ ███████║██║ ██║ ██║ ██║██████╔╝ ╚████╔╝ +██╔══╝ ██╔══██║██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝ +██║ ██║ ██║╚██████╗ ██║ ╚██████╔╝██║ ██║ ██║ +╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ + +*/ + +/// @title Velodrome Superchain Root CL Pool Factory +/// @notice Factory used to create RootCLPools contract RootCLPoolFactory is IRootCLPoolFactory { /// @inheritdoc IRootCLPoolFactory address public immutable override implementation; @@ -43,7 +75,7 @@ contract RootCLPoolFactory is IRootCLPoolFactory { override returns (address pool) { - require(IChainRegistry(bridge).containsChain(chainid), "NR"); + require(ICrossChainRegistry(bridge).containsChain(chainid), "NR"); require(tokenA != tokenB, "S_A"); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), "Z_A"); diff --git a/test/BaseForkFixture.sol b/test/BaseForkFixture.sol index e19d7ce..1fe7dee 100644 --- a/test/BaseForkFixture.sol +++ b/test/BaseForkFixture.sol @@ -41,8 +41,8 @@ import {Constants} from "script/constants/Constants.sol"; import {IXERC20} from "contracts/superchain/IXERC20.sol"; import {IXERC20Lockbox} from "contracts/superchain/IXERC20Lockbox.sol"; -import {IChainRegistry} from "contracts/root/interfaces/bridge/IChainRegistry.sol"; import {IRootMessageBridge} from "contracts/root/interfaces/bridge/IRootMessageBridge.sol"; +import {ICrossChainRegistry} from "contracts/root/interfaces/bridge/ICrossChainRegistry.sol"; import {IRootHLMessageModule} from "contracts/root/interfaces/bridge/hyperlane/IRootHLMessageModule.sol"; import {ILeafHLMessageModule} from "contracts/root/interfaces/bridge/hyperlane/ILeafHLMessageModule.sol"; import {RootCLPool} from "contracts/root/pool/RootCLPool.sol"; @@ -416,8 +416,8 @@ abstract contract BaseForkFixture is Test, TestConstants, Events, PoolUtils { vm.stopPrank(); vm.startPrank(Ownable(address(rootMessageBridge)).owner()); - IChainRegistry(address(rootMessageBridge)).addModule({_module: address(rootMessageModule)}); - IChainRegistry(address(rootMessageBridge)).registerChain({ + ICrossChainRegistry(address(rootMessageBridge)).addModule({_module: address(rootMessageModule)}); + ICrossChainRegistry(address(rootMessageBridge)).registerChain({ _chainid: leafChainId, _module: address(leafMessageModule) }); diff --git a/test/unit/concrete/root/pool/RootCLPoolFactory/createPool/createPool.t.sol b/test/unit/concrete/root/pool/RootCLPoolFactory/createPool/createPool.t.sol index c47092b..cddc583 100644 --- a/test/unit/concrete/root/pool/RootCLPoolFactory/createPool/createPool.t.sol +++ b/test/unit/concrete/root/pool/RootCLPoolFactory/createPool/createPool.t.sol @@ -32,7 +32,7 @@ contract CreatePoolIntegrationConcreteTest is RootCLPoolFactoryTest { modifier whenChainIdIsRegistered() { vm.startPrank(Ownable(address(rootMessageBridge)).owner()); - IChainRegistry(address(rootMessageBridge)).registerChain({ + ICrossChainRegistry(address(rootMessageBridge)).registerChain({ _chainid: _chainid, _module: address(rootMessageModule) });