Skip to content

Commit

Permalink
chore: update contract docs (#70)
Browse files Browse the repository at this point in the history
* docs: add contract headers & ascii art, update interfaces

* chore: update bridge interfaces

* chore: update rootclfactory interface header
  • Loading branch information
airtoonricardo authored Nov 7, 2024
1 parent e404e3d commit 2b18759
Show file tree
Hide file tree
Showing 15 changed files with 221 additions and 44 deletions.
27 changes: 27 additions & 0 deletions contracts/gauge/LeafCLGauge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
35 changes: 34 additions & 1 deletion contracts/gauge/LeafCLGaugeFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
28 changes: 27 additions & 1 deletion contracts/root/gauge/RootCLGauge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
35 changes: 34 additions & 1 deletion contracts/root/gauge/RootCLGaugeFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 2b18759

Please sign in to comment.