S Price: $0.71774 (-1.35%)

Contract

0x07A1539155758C975a6099aBc15d1B66a227dBDB

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
102646522025-02-26 9:37:3930 hrs ago1740562659  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VoterGovernanceActions

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 333 runs

Other Settings:
cancun EvmVersion
File 1 of 28 : VoterGovernanceActions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {INonfungiblePositionManager} from "../CL/periphery/interfaces/INonfungiblePositionManager.sol";
import {IGauge} from "../interfaces/IGauge.sol";
import {IGaugeV3} from "../CL/gauge/interfaces/IGaugeV3.sol";
import {IClGaugeFactory} from "../CL/gauge/interfaces/IClGaugeFactory.sol";
import {IVoteModule} from "../interfaces/IVoteModule.sol";
import {IFeeDistributor} from "../interfaces/IFeeDistributor.sol";
import {IXShadow} from "contracts/interfaces/IXShadow.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Errors} from "contracts/libraries/Errors.sol";
import {IPair} from "contracts/interfaces/IPair.sol";
import {IPairFactory} from "contracts/interfaces/IPairFactory.sol";
import {IRouter} from "contracts/interfaces/IRouter.sol";
import {IVoter} from "contracts/interfaces/IVoter.sol";
import {IFeeRecipientFactory} from "contracts/interfaces/IFeeRecipientFactory.sol";

import {VoterStorage} from "contracts/libraries/VoterStorage.sol";

/// @title VoterGovernanceActions
/// @notice Governance logic for Voter
/// @dev Used to reduce Voter contract size by moving all governance related logic to a library
library VoterGovernanceActions {
    using EnumerableSet for EnumerableSet.AddressSet;

    uint256 internal constant DURATION = 7 days;
    uint256 public constant BASIS = 1_000_000;

    function setGlobalRatio(uint256 _xRatio) external {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        require(_xRatio <= BASIS, Errors.RATIO_TOO_HIGH(_xRatio));

        emit IVoter.EmissionsRatio(msg.sender, $.xRatio, _xRatio);
        $.xRatio = _xRatio;
    }

    function setGovernor(address _governor) external {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        if ($.governor != _governor) {
            $.governor = _governor;
            emit IVoter.NewGovernor(msg.sender, _governor);
        }
    }

    function whitelist(address _token) public {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        require(!$.isWhitelisted[_token], Errors.ALREADY_WHITELISTED(_token));
        $.isWhitelisted[_token] = true;
        emit IVoter.Whitelisted(msg.sender, _token);
    }

    function revokeWhitelist(address _token) public {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        require($.isWhitelisted[_token], Errors.NOT_WHITELISTED(_token));
        $.isWhitelisted[_token] = false;
        emit IVoter.WhitelistRevoked(msg.sender, _token, true);
    }

    function killGauge(address _gauge) public {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        /// @dev ensure the gauge is alive already, and exists
        require($.isAlive[_gauge] && $.gauges.contains(_gauge), Errors.GAUGE_INACTIVE(_gauge));
        /// @dev set the gauge to dead
        $.isAlive[_gauge] = false;
        address pool = $.poolForGauge[_gauge];
        /// @dev check if it's a legacy gauge
        if ($.isLegacyGauge[_gauge]) {
            /// @dev revert back to the default feeSplit
            uint256 feeSplit = IPairFactory($.legacyFactory).feeSplit();
            IPairFactory($.legacyFactory).setPairFeeSplit(pool, feeSplit);

            /// @dev killed legacy gauges behave the same whether it has a main gauge or not
            bool feeSplitWhenNoGauge = IPairFactory($.legacyFactory).feeSplitWhenNoGauge();
            if (feeSplitWhenNoGauge) {
                /// @dev What used to go to FeeRecipient will go to treasury
                /// @dev we are assuming voter.governor is the intended receiver (== factory.treasury)
                IPairFactory($.legacyFactory).setFeeRecipient(pool, $.governor);
            } else {
                /// @dev the fees are handed to LPs instead of FeeRecipient
                IPairFactory($.legacyFactory).setFeeRecipient(pool, address(0));
            }
        }
        /// @dev fetch the last distribution
        uint256 _lastDistro = $.lastDistro[_gauge];
        /// @dev fetch the current period
        uint256 currentPeriod = getPeriod();
        /// @dev placeholder
        uint256 _claimable;
        /// @dev loop through the last distribution period up to and including the current period
        for (uint256 period = _lastDistro; period <= currentPeriod; ++period) {
            /// @dev if the gauge isn't distributed for the period
            if (!$.gaugePeriodDistributed[_gauge][period]) {
                uint256 additionalClaimable = _claimablePerPeriod(pool, period);
                _claimable += additionalClaimable;

                /// @dev prevent gaugePeriodDistributed being marked true when the minter hasn't updated yet
                if (additionalClaimable > 0) {
                    $.gaugePeriodDistributed[_gauge][period] = true;
                }
            }
        }
        /// @dev if there is anything claimable left
        if (_claimable > 0) {
            /// @dev send to the governor contract
            IERC20($.shadow).transfer($.governor, _claimable);
        }

        /// @dev we dont update lastDistro here so distribute can still be called to pass if revived

        emit IVoter.GaugeKilled(_gauge);
    }

    function reviveGauge(address _gauge) public {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        /// @dev ensure the gauge is dead and exists
        require(!$.isAlive[_gauge] && $.gauges.contains(_gauge), Errors.ACTIVE_GAUGE(_gauge));
        /// @dev set the gauge to alive
        $.isAlive[_gauge] = true;
        /// @dev check if it's a legacy gauge
        if ($.isLegacyGauge[_gauge]) {
            address pool = $.poolForGauge[_gauge];
            address feeRecipient = IFeeRecipientFactory($.feeRecipientFactory).feeRecipientForPair(pool);
            IPairFactory($.legacyFactory).setFeeRecipient(pool, feeRecipient);

            /// @dev revert back to the 100% feeSplit going to feeRecipient
            IPairFactory($.legacyFactory).setPairFeeSplit(pool, BASIS);
        }

        /// @dev we dont update lastDistro here so distribute can still be called to pass fees

        emit IVoter.GaugeRevived(_gauge);
    }

    /// @dev in case of emission stuck due to killed gauges and unsupported operations
    function stuckEmissionsRecovery(address _gauge, uint256 _period) external {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        /// @dev require gauge is dead
        require(!$.isAlive[_gauge], Errors.ACTIVE_GAUGE(_gauge));

        /// @dev ensure the gauge exists
        require($.gauges.contains(_gauge), Errors.GAUGE_INACTIVE(_gauge));

        /// @dev check if the period has been distributed already
        if (!$.gaugePeriodDistributed[_gauge][_period]) {
            address pool = $.poolForGauge[_gauge];
            uint256 _claimable = _claimablePerPeriod(pool, _period);
            /// @dev if there is gt 0 emissions, send to governor
            if (_claimable > 0) {
                IERC20($.shadow).transfer($.governor, _claimable);
                /// @dev mark period as distributed
                $.gaugePeriodDistributed[_gauge][_period] = true;
            }
        }
    }

    function removeFeeDistributorReward(address _feeDistributor, address reward) external {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        /// @dev ensure the feeDist exists
        require($.feeDistributors.contains(_feeDistributor));
        IFeeDistributor(_feeDistributor).removeReward(reward);
    }

    function setNfpManager(address _newNfpManager) external {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        $.nfpManager = _newNfpManager;
        IClGaugeFactory($.clGaugeFactory).setNfpManager(_newNfpManager);
    }

    function getPeriod() private view returns (uint256 period) {
        return (block.timestamp / 1 weeks);
    }

    /// @dev shows how much is claimable per period
    function _claimablePerPeriod(address pool, uint256 period) private view returns (uint256) {
        VoterStorage.VoterState storage $ = VoterStorage.getStorage();

        uint256 numerator = ($.totalRewardPerPeriod[period] * $.poolTotalVotesPerPeriod[pool][period]) * 1e18;

        /// @dev return 0 if this happens, or else there could be a divide by zero next
        return (numerator == 0 ? 0 : (numerator / $.totalVotesPerPeriod[period] / 1e18));
    }
}

File 2 of 28 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }
}

File 3 of 28 : INonfungiblePositionManager.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import {IPoolInitializer} from './IPoolInitializer.sol';
import {IPeripheryPayments} from './IPeripheryPayments.sol';
import {IPeripheryImmutableState} from './IPeripheryImmutableState.sol';
import {PoolAddress} from '../libraries/PoolAddress.sol';

import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import {IERC721Metadata} from '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import {IERC721Enumerable} from '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';

import {IPeripheryErrors} from './IPeripheryErrors.sol';

/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is
    IPeripheryErrors,
    IPoolInitializer,
    IPeripheryPayments,
    IPeripheryImmutableState,
    IERC721,
    IERC721Metadata,
    IERC721Enumerable
{
    /// @notice Emitted when liquidity is increased for a position NFT
    /// @dev Also emitted when a token is minted
    /// @param tokenId The ID of the token for which liquidity was increased
    /// @param liquidity The amount by which liquidity for the NFT position was increased
    /// @param amount0 The amount of token0 that was paid for the increase in liquidity
    /// @param amount1 The amount of token1 that was paid for the increase in liquidity
    event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when liquidity is decreased for a position NFT
    /// @param tokenId The ID of the token for which liquidity was decreased
    /// @param liquidity The amount by which liquidity for the NFT position was decreased
    /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity
    /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity
    event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when tokens are collected for a position NFT
    /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior
    /// @param tokenId The ID of the token for which underlying tokens were collected
    /// @param recipient The address of the account that received the collected tokens
    /// @param amount0 The amount of token0 owed to the position that was collected
    /// @param amount1 The amount of token1 owed to the position that was collected
    event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);

    /// @notice Returns the position information associated with a given token ID.
    /// @dev Throws if the token ID is not valid.
    /// @param tokenId The ID of the token that represents the position
    /// @return token0 The address of the token0 for a specific pool
    /// @return token1 The address of the token1 for a specific pool
    /// @return tickSpacing The tickSpacing the pool
    /// @return tickLower The lower end of the tick range for the position
    /// @return tickUpper The higher end of the tick range for the position
    /// @return liquidity The liquidity of the position
    /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
    /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
    /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
    /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
    function positions(
        uint256 tokenId
    )
        external
        view
        returns (
            address token0,
            address token1,
            int24 tickSpacing,
            int24 tickLower,
            int24 tickUpper,
            uint128 liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    struct MintParams {
        address token0;
        address token1;
        int24 tickSpacing;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        address recipient;
        uint256 deadline;
    }

    /// @notice Creates a new position wrapped in a NFT
    /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
    /// a method does not exist, i.e. the pool is assumed to be initialized.
    /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
    /// @return tokenId The ID of the token that represents the minted position
    /// @return liquidity The amount of liquidity for this position
    /// @return amount0 The amount of token0
    /// @return amount1 The amount of token1
    function mint(
        MintParams calldata params
    ) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);

    struct IncreaseLiquidityParams {
        uint256 tokenId;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
    /// @param params tokenId The ID of the token for which liquidity is being increased,
    /// amount0Desired The desired amount of token0 to be spent,
    /// amount1Desired The desired amount of token1 to be spent,
    /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
    /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return liquidity The new liquidity amount as a result of the increase
    /// @return amount0 The amount of token0 to acheive resulting liquidity
    /// @return amount1 The amount of token1 to acheive resulting liquidity
    function increaseLiquidity(
        IncreaseLiquidityParams calldata params
    ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);

    struct DecreaseLiquidityParams {
        uint256 tokenId;
        uint128 liquidity;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Decreases the amount of liquidity in a position and accounts it to the position
    /// @param params tokenId The ID of the token for which liquidity is being decreased,
    /// amount The amount by which liquidity will be decreased,
    /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
    /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return amount0 The amount of token0 accounted to the position's tokens owed
    /// @return amount1 The amount of token1 accounted to the position's tokens owed
    function decreaseLiquidity(
        DecreaseLiquidityParams calldata params
    ) external payable returns (uint256 amount0, uint256 amount1);

    struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

    /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
    /// @param params tokenId The ID of the NFT for which tokens are being collected,
    /// recipient The account that should receive the tokens,
    /// amount0Max The maximum amount of token0 to collect,
    /// amount1Max The maximum amount of token1 to collect
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);

    /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
    /// must be collected first.
    /// @param tokenId The ID of the token that is being burned
    function burn(uint256 tokenId) external payable;

    /// @notice Claims gauge rewards from liquidity incentives for a specific tokenId
    /// @param tokenId The ID of the token to claim rewards from
    /// @param tokens an array of reward tokens to claim
    function getReward(uint256 tokenId, address[] calldata tokens) external;
}

File 4 of 28 : IGauge.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IGauge {
    event Deposit(address indexed from, uint256 amount);

    event Withdraw(address indexed from, uint256 amount);

    event NotifyReward(address indexed from, address indexed reward, uint256 amount);

    event ClaimRewards(address indexed from, address indexed reward, uint256 amount);

    event RewardWhitelisted(address indexed reward, bool whitelisted);

    /// @notice returns an array with all the addresses of the rewards
    /// @return _rewards array of addresses for rewards
    function rewardsList() external view returns (address[] memory _rewards);

    /// @notice number of different rewards the gauge has facilitated that are 'active'
    /// @return _length the number of individual rewards
    function rewardsListLength() external view returns (uint256 _length);

    /// @notice returns the last time the reward was modified or periodFinish if the reward has ended
    /// @param token address of the token
    /// @return ltra last time reward applicable
    function lastTimeRewardApplicable(address token) external view returns (uint256 ltra);

    /// @notice displays the data struct of rewards for a token
    /// @param token the address of the token
    /// @return data rewards struct
    function rewardData(address token) external view returns (Reward memory data);

    /// @notice calculates the amount of tokens earned for an address
    /// @param token address of the token to check
    /// @param account address to check
    /// @return _reward amount of token claimable
    function earned(address token, address account) external view returns (uint256 _reward);
    /// @notice claims rewards (shadow + any external LP Incentives)
    /// @param account the address to claim for
    /// @param tokens an array of the tokens to claim
    function getReward(address account, address[] calldata tokens) external;

    /// @notice claims all rewards and instant exits xshadow into shadow
    function getRewardAndExit(address account, address[] calldata tokens) external;

    /// @notice calculates the token amounts earned per lp token
    /// @param token address of the token to check
    /// @return rpt reward per token
    function rewardPerToken(address token) external view returns (uint256 rpt);

    /// @notice deposit all LP tokens from msg.sender's wallet to the gauge
    function depositAll() external;
    /// @param recipient the address of who to deposit on behalf of
    /// @param amount the amount of LP tokens to withdraw
    function depositFor(address recipient, uint256 amount) external;

    /// @notice deposit LP tokens to the gauge
    /// @param amount the amount of LP tokens to withdraw
    function deposit(uint256 amount) external;

    /// @notice withdraws all fungible LP tokens from legacy gauges
    function withdrawAll() external;

    /// @notice withdraws fungible LP tokens from legacy gauges
    /// @param amount the amount of LP tokens to withdraw
    function withdraw(uint256 amount) external;

    function unstakeAndClaimAll(address[] calldata tokens) external;

    /// @notice calculates how many tokens are left to be distributed
    /// @dev reduces per second
    /// @param token the address of the token
    function left(address token) external view returns (uint256);

    /**
     * @notice amount must be greater than left() for the token, this is to prevent griefing attacks
     * @notice notifying rewards is completely permissionless
     * @notice if nobody registers for a newly added reward for the period it will remain in the contract indefinitely
     */
    function notifyRewardAmount(address token, uint256 amount) external;

    struct Reward {
        /// @dev tokens per second
        uint256 rewardRate;
        /// @dev 7 days after start
        uint256 periodFinish;
        uint256 lastUpdateTime;
        uint256 rewardPerTokenStored;
    }

    /// @notice checks if a reward is whitelisted
    /// @param reward the address of the reward
    /// @return true if the reward is whitelisted, false otherwise
    function isWhitelisted(address reward) external view returns (bool);
}

File 5 of 28 : IGaugeV3.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface IGaugeV3 {
    /// @notice Emitted when the NFP Manager is changed
    /// @param newNfpManager The address of the new NFP Manager
    /// @param oldNfpManager The address of the old NFP Manager
    event NfpManagerChanged(address indexed newNfpManager, address indexed oldNfpManager);

    /// @notice Emitted when a reward notification is made.
    /// @param from The address from which the reward is notified.
    /// @param reward The address of the reward token.
    /// @param amount The amount of rewards notified.
    /// @param period The period for which the rewards are notified.
    event NotifyReward(address indexed from, address indexed reward, uint256 amount, uint256 period);

    /// @notice Emitted when a bribe is made.
    /// @param from The address from which the bribe is made.
    /// @param reward The address of the reward token.
    /// @param amount The amount of tokens bribed.
    /// @param period The period for which the bribe is made.
    event Bribe(address indexed from, address indexed reward, uint256 amount, uint256 period);

    /// @notice Emitted when rewards are claimed.
    /// @param period The period for which the rewards are claimed.
    /// @param _positionHash The identifier of the NFP for which rewards are claimed.
    /// @param receiver The address of the receiver of the claimed rewards.
    /// @param reward The address of the reward token.
    /// @param amount The amount of rewards claimed.
    event ClaimRewards(uint256 period, bytes32 _positionHash, address receiver, address reward, uint256 amount);

    /// @notice Emitted when a new reward token was pushed to the rewards array
    event RewardAdded(address reward);

    /// @notice Emitted when a reward token was removed from the rewards array
    event RewardRemoved(address reward);

    /// @notice Returns the NFP Manager
    function nfpManager() external view returns (address);

    /// @notice updates pool data after period flip
    function updatePool() external;

    /// @notice Syncs NFP Manager from the voter
    function syncNfpManager() external;

    /// @notice returns an array of all nfpManagers in this gauge
    function getNfpManagers() external view returns (address[] memory);

    /// @notice returns the pool of this gauge
    function pool() external view returns (address);

    /// @notice Retrieves the value of the firstPeriod variable.
    /// @return The value of the firstPeriod variable.
    function firstPeriod() external returns (uint256);

    /// @notice Retrieves the total supply of a specific token for a given period.
    /// @param period The period for which to retrieve the total supply.
    /// @param token The address of the token for which to retrieve the total supply.
    /// @return The total supply of the specified token for the given period.
    function tokenTotalSupplyByPeriod(uint256 period, address token) external view returns (uint256);

    /// @notice Retrieves the getTokenTotalSupplyByPeriod of the current period.
    /// @dev included to support voter's left() check during distribute().
    /// @param token The address of the token for which to retrieve the remaining amount.
    /// @return The amount of tokens left to distribute in this period.
    function left(address token) external view returns (uint256);

    /// @notice Retrieves the reward rate for a specific reward address.
    /// @dev this method returns the base rate without boost
    /// @param token The address of the reward for which to retrieve the reward rate.
    /// @return The reward rate for the specified reward address.
    function rewardRate(address token) external view returns (uint256);

    /// @notice Retrieves the claimed amount for a specific period, position hash, and user address.
    /// @param period The period for which to retrieve the claimed amount.
    /// @param _positionHash The identifier of the NFP for which to retrieve the claimed amount.
    /// @param reward The address of the token for the claimed amount.
    /// @return The claimed amount for the specified period, token ID, and user address.
    function periodClaimedAmount(uint256 period, bytes32 _positionHash, address reward)
        external
        view
        returns (uint256);

    /// @notice Retrieves the last claimed period for a specific token, token ID combination.
    /// @param token The address of the reward token for which to retrieve the last claimed period.
    /// @param _positionHash The identifier of the NFP for which to retrieve the last claimed period.
    /// @return The last claimed period for the specified token and token ID.
    function lastClaimByToken(address token, bytes32 _positionHash) external view returns (uint256);

    /// @notice Checks if a given address is a valid reward.
    /// @param reward The address to check.
    /// @return A boolean indicating whether the address is a valid reward.
    function isGaugeReward(address reward) external view returns (bool);

    /// @notice Returns an array of reward token addresses.
    /// @return An array of reward token addresses.
    function getRewardTokens() external view returns (address[] memory);

    /// @notice Returns the hash used to store positions in a mapping
    /// @param owner The address of the position owner
    /// @param index The index of the position
    /// @param tickLower The lower tick boundary of the position
    /// @param tickUpper The upper tick boundary of the position
    /// @return _hash The hash used to store positions in a mapping
    function positionHash(address owner, uint256 index, int24 tickLower, int24 tickUpper)
        external
        pure
        returns (bytes32);

    /*
    /// @notice Retrieves the liquidity and boosted liquidity for a specific NFP.
    /// @param tokenId The identifier of the NFP.
    /// @return liquidity The liquidity of the position token.
    function positionInfo(
        uint256 tokenId
    ) external view returns (uint128 liquidity);
    */

    /// @notice Returns the amount of rewards earned for an NFP.
    /// @param token The address of the token for which to retrieve the earned rewards.
    /// @param tokenId The identifier of the specific NFP for which to retrieve the earned rewards.
    /// @return reward The amount of rewards earned for the specified NFP and tokens.
    function earned(address token, uint256 tokenId) external view returns (uint256 reward);

    /// @notice Returns the amount of rewards earned during a period for an NFP.
    /// @param period The period for which to retrieve the earned rewards.
    /// @param token The address of the token for which to retrieve the earned rewards.
    /// @param tokenId The identifier of the specific NFP for which to retrieve the earned rewards.
    /// @return reward The amount of rewards earned for the specified NFP and tokens.
    function periodEarned(uint256 period, address token, uint256 tokenId) external view returns (uint256);

    /// @notice Retrieves the earned rewards for a specific period, token, owner, index, tickLower, and tickUpper.
    /// @param period The period for which to retrieve the earned rewards.
    /// @param token The address of the token for which to retrieve the earned rewards.
    /// @param owner The address of the owner for which to retrieve the earned rewards.
    /// @param index The index for which to retrieve the earned rewards.
    /// @param tickLower The tick lower bound for which to retrieve the earned rewards.
    /// @param tickUpper The tick upper bound for which to retrieve the earned rewards.
    /// @return The earned rewards for the specified period, token, owner, index, tickLower, and tickUpper.
    function periodEarned(uint256 period, address token, address owner, uint256 index, int24 tickLower, int24 tickUpper)
        external
        view
        returns (uint256);

    /// @notice Retrieves the earned rewards for a specific period, token, owner, index, tickLower, and tickUpper.
    /// @dev used by getReward() and saves gas by saving states
    /// @param period The period for which to retrieve the earned rewards.
    /// @param token The address of the token for which to retrieve the earned rewards.
    /// @param owner The address of the owner for which to retrieve the earned rewards.
    /// @param index The index for which to retrieve the earned rewards.
    /// @param tickLower The tick lower bound for which to retrieve the earned rewards.
    /// @param tickUpper The tick upper bound for which to retrieve the earned rewards.
    /// @param caching Whether to cache the results or not.
    /// @return The earned rewards for the specified period, token, owner, index, tickLower, and tickUpper.
    function cachePeriodEarned(
        uint256 period,
        address token,
        address owner,
        uint256 index,
        int24 tickLower,
        int24 tickUpper,
        bool caching
    ) external returns (uint256);

    /// @notice Notifies the contract about the amount of rewards to be distributed for a specific token.
    /// @param token The address of the token for which to notify the reward amount.
    /// @param amount The amount of rewards to be distributed.
    function notifyRewardAmount(address token, uint256 amount) external;

    /// @notice Retrieves the reward amount for a specific period, NFP, and token addresses.
    /// @param period The period for which to retrieve the reward amount.
    /// @param tokens The addresses of the tokens for which to retrieve the reward amount.
    /// @param tokenId The identifier of the specific NFP for which to retrieve the reward amount.
    /// @param receiver The address of the receiver of the reward amount.
    function getPeriodReward(uint256 period, address[] calldata tokens, uint256 tokenId, address receiver) external;

    /// @notice Retrieves the reward amount for a specific NFP Manager, period, NFP, and token addresses.
    /// @param __nfpManager The NFP Manager.
    /// @param period The period for which to retrieve the reward amount.
    /// @param tokens The addresses of the tokens for which to retrieve the reward amount.
    /// @param tokenId The identifier of the specific NFP for which to retrieve the reward amount.
    /// @param receiver The address of the receiver of the reward amount.
    function getNfpPeriodReward(
        address __nfpManager,
        uint256 period,
        address[] calldata tokens,
        uint256 tokenId,
        address receiver
    ) external;

    /// @notice Retrieves the rewards for a specific period, set of tokens, owner, index, tickLower, tickUpper, and receiver.
    /// @param period The period for which to retrieve the rewards.
    /// @param tokens An array of token addresses for which to retrieve the rewards.
    /// @param owner The address of the owner for which to retrieve the rewards.
    /// @param index The index for which to retrieve the rewards.
    /// @param tickLower The tick lower bound for which to retrieve the rewards.
    /// @param tickUpper The tick upper bound for which to retrieve the rewards.
    /// @param receiver The address of the receiver of the rewards.
    function getPeriodReward(
        uint256 period,
        address[] calldata tokens,
        address owner,
        uint256 index,
        int24 tickLower,
        int24 tickUpper,
        address receiver
    ) external;

    /// @notice retrieves rewards based on an NFP id and an array of tokens
    function getReward(uint256 tokenId, address[] memory tokens) external;
    /// @notice retrieves rewards based on an array of NFP ids and an array of tokens
    function getReward(uint256[] calldata tokenIds, address[] memory tokens) external;
    /// @notice get reward for an owner of an NFP
    function getRewardForOwner(uint256 tokenId, address[] memory tokens) external;
    /// @notice get xShadow reward for an owner of an NFP
    function getXShadowRewardForOwner(uint256 tokenId) external;

    /// @notice Notifies rewards for periods greater than current period
    /// @dev does not push fees
    /// @dev requires reward token to be whitelisted
    function notifyRewardAmountForPeriod(address token, uint256 amount, uint256 period) external;
}

File 6 of 28 : IClGaugeFactory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @title The interface for the CL gauge Factory
/// @notice Deploys CL gauges
interface IClGaugeFactory {
    /// @dev Emitted when the implementation returned by the beacon is changed.
    event Upgraded(address indexed implementation);

    /// @notice Emitted when a gauge is created
    /// @param pool The address of the pool
    /// @param pool The address of the created gauge
    event GaugeCreated(address indexed pool, address gauge);

    /// @notice Emitted when the NFP Manager is changed
    /// @param newNfpManager The address of the new NFP Manager
    /// @param oldNfpManager The address of the old NFP Manager
    event NfpManagerChanged(address indexed newNfpManager, address indexed oldNfpManager);

    /// @notice Emitted when the Fee Collector is changed
    /// @param newFeeCollector The address of the new NFP Manager
    /// @param oldFeeCollector The address of the old NFP Manager
    event FeeCollectorChanged(address indexed newFeeCollector, address indexed oldFeeCollector);

    /// @notice Emitted when the Voter is changed
    /// @param newVoter The address of the new NFP Manager
    /// @param oldVoter The address of the old NFP Manager
    event VoterChanged(address indexed newVoter, address indexed oldVoter);

    /// @notice Returns the NFP Manager address
    function nfpManager() external view returns (address);

    /// @notice Set new NFP Manager
    function setNfpManager(address _nfpManager) external;

    /// @notice Returns Voter
    function voter() external view returns (address);

    /// @notice Returns the gauge address for a given pool, or address 0 if it does not exist
    /// @param pool The pool address
    /// @return gauge The gauge address
    function getGauge(address pool) external view returns (address gauge);

    /// @notice Returns the address of the fee collector contract
    /// @dev Fee collector decides where the protocol fees go (fee distributor, treasury, etc.)
    function feeCollector() external view returns (address);

    /// @notice Creates a gauge for the given pool
    /// @param pool One of the desired gauge
    /// @return gauge The address of the newly created gauge
    function createGauge(address pool) external returns (address gauge);
}

File 7 of 28 : IVoteModule.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IVoteModule {
    /**
     * Events
     */
    event Deposit(address indexed from, uint256 amount);

    event Withdraw(address indexed from, uint256 amount);

    event NotifyReward(address indexed from, uint256 amount);

    event ClaimRewards(address indexed from, uint256 amount);

    event ExemptedFromCooldown(address indexed candidate, bool status);

    event NewDuration(uint256 oldDuration, uint256 newDuration);

    event NewCooldown(uint256 oldCooldown, uint256 newCooldown);

    event Delegate(address indexed delegator, address indexed delegatee, bool indexed isAdded);

    event SetAdmin(address indexed owner, address indexed operator, bool indexed isAdded);

    /**
     * Functions
     */
    function delegates(address) external view returns (address);
    /// @notice mapping for admins for a specific address
    /// @param owner the owner to check against
    /// @return operator the address that is designated as an admin/operator
    function admins(address owner) external view returns (address operator);

    function accessHub() external view returns (address);

    /// @notice reward supply for a period
    function rewardSupply(uint256 period) external view returns (uint256);

    /// @notice user claimed reward amount for a period
    /// @dev same mapping order as FeeDistributor so the name is a bit odd
    function userClaimed(uint256 period, address owner) external view returns (uint256);

    /// @notice last claimed period for a user
    function userLastClaimPeriod(address owner) external view returns (uint256);

    /// @notice returns the current period
    function getPeriod() external view returns (uint256);

    /// @notice returns the amount of unclaimed rebase earned by the user
    function earned(address account) external view returns (uint256 _reward);

    /// @notice returns the amount of unclaimed rebase earned by the user for a period
    function periodEarned(uint256 period, address user) external view returns (uint256 amount);

    /// @notice the time which users can deposit and withdraw
    function unlockTime() external view returns (uint256 _timestamp);

    /// @notice claims pending rebase rewards
    function getReward() external;

    /// @notice claims pending rebase rewards for a period
    function getPeriodReward(uint256 period) external;

    /// @notice allows users to set their own last claimed period in case they haven't claimed in a while
    /// @param period the new period to start loops from
    function setUserLastClaimPeriod(uint256 period) external;

    /// @notice deposits all xShadow in the caller's wallet
    function depositAll() external;

    /// @notice deposit a specified amount of xShadow
    function deposit(uint256 amount) external;

    /// @notice withdraw all xShadow
    function withdrawAll() external;

    /// @notice withdraw a specified amount of xShadow
    function withdraw(uint256 amount) external;

    /// @notice check for admin perms
    /// @param operator the address to check
    /// @param owner the owner to check against for permissions
    function isAdminFor(address operator, address owner) external view returns (bool approved);

    /// @notice check for delegations
    /// @param delegate the address to check
    /// @param owner the owner to check against for permissions
    function isDelegateFor(address delegate, address owner) external view returns (bool approved);

    /// @notice used by the xShadow contract to notify pending rebases
    /// @param amount the amount of Shadow to be notified from exit penalties
    function notifyRewardAmount(uint256 amount) external;

    /// @notice the address of the xShadow token (staking/voting token)
    /// @return _xShadow the address
    function xShadow() external view returns (address _xShadow);

    /// @notice address of the voter contract
    /// @return _voter the voter contract address
    function voter() external view returns (address _voter);

    /// @notice returns the total voting power (equal to total supply in the VoteModule)
    /// @return _totalSupply the total voting power
    function totalSupply() external view returns (uint256 _totalSupply);

    /// @notice voting power
    /// @param user the address to check
    /// @return amount the staked balance
    function balanceOf(address user) external view returns (uint256 amount);

    /// @notice delegate voting perms to another address
    /// @param delegatee who you delegate to
    /// @dev set address(0) to revoke
    function delegate(address delegatee) external;

    /// @notice give admin permissions to a another address
    /// @param operator the address to give administrative perms to
    /// @dev set address(0) to revoke
    function setAdmin(address operator) external;

    function cooldownExempt(address) external view returns (bool);

    function setCooldownExemption(address, bool) external;

    /// @notice lock period after rebase starts accruing
    function cooldown() external returns (uint256);

    function setNewCooldown(uint256) external;
}

File 8 of 28 : IFeeDistributor.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {IVoter} from "../interfaces/IVoter.sol";
import {IVoteModule} from "../interfaces/IVoteModule.sol";

interface IFeeDistributor {
    event Deposit(address owner, uint256 amount);

    event Withdraw(address owner, uint256 amount);

    event NotifyReward(address indexed from, address indexed reward, uint256 amount, uint256 period);

    event VotesIncentivized(address indexed from, address indexed reward, uint256 amount, uint256 period);

    event ClaimRewards(uint256 period, address owner, address receiver, address reward, uint256 amount);

    event RewardsRedirected(address indexed destination, address indexed _reward, uint256 _amount);

    event RewardsRemoved(address _reward);

    /// @notice the address of the voter contract
    function voter() external view returns (IVoter);
    /// @notice the address of the voting module
    function voteModule() external view returns (IVoteModule);
    /// @notice the address of the feeRecipient contract
    function feeRecipient() external view returns (address);

    /// @notice the first period (epoch) that this contract was deployed
    function firstPeriod() external view returns (uint256);

    /// @notice balance of the voting power for a user
    /// @param owner the owner
    /// @return amount the amount of voting share
    function balanceOf(address owner) external view returns (uint256 amount);

    /// @notice total cumulative amount of voting power per epoch
    /// @param period the period to check
    /// @return weight the amount of total voting power
    function votes(uint256 period) external view returns (uint256 weight);

    /// @notice "internal" function gated to voter to add votes
    /// @dev internal notation inherited from original solidly, kept for continuity
    function _deposit(uint256 amount, address owner) external;
    /// @notice "internal" function gated to voter to remove votes
    /// @dev internal notation inherited from original solidly, kept for continuity
    function _withdraw(uint256 amount, address owner) external;

    /// @notice function to claim rewards on behalf of another
    /// @param owner owner's address
    /// @param tokens an array of the tokens
    function getRewardForOwner(address owner, address[] memory tokens) external;

    /// @notice function to claim rewards on behalf of another
    /// @param owner owner's address
    /// @param tokens an array of the tokens
    /// @param destination destination of the rewards
    function getRewardForOwnerTo(address owner, address[] memory tokens, address destination) external;

    /// @notice function for sending fees directly to be claimable (in system where fees are distro'd through the week)
    /// @dev for lumpsum - this would operate similarly to incentivize
    /// @param token the address of the token to send for notifying
    /// @param amount the amount of token to send
    function notifyRewardAmount(address token, uint256 amount) external;

    /// @notice gives an array of reward tokens for the feedist
    /// @return _rewards array of rewards
    function getRewardTokens() external view returns (address[] memory _rewards);

    /// @notice shows the earned incentives in the feedist
    /// @param token the token address to check
    /// @param owner owner's address
    /// @return reward the amount earned/claimable
    function earned(address token, address owner) external view returns (uint256 reward);

    /// @notice function to submit incentives to voters for the upcoming flip
    /// @param token the address of the token to send for incentivization
    /// @param amount the amount of token to send
    function incentivize(address token, uint256 amount) external;

    /// @notice get the rewards for a specific period
    /// @param owner owner's address
    function getPeriodReward(uint256 period, address owner, address token) external;
    /// @notice get the fees and incentives
    function getReward(address owner, address[] memory tokens) external;

    /// @notice remove a reward from the set
    function removeReward(address _token) external;

    /// @notice claws back rewards
    function clawbackRewards(address token, address destination) external;
}

File 9 of 28 : IXShadow.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IVoter} from "./IVoter.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";

interface IXShadow is IERC20 {
    struct VestPosition {
        /// @dev amount of xShadow
        uint256 amount;
        /// @dev start unix timestamp
        uint256 start;
        /// @dev start + MAX_VEST (end timestamp)
        uint256 maxEnd;
        /// @dev vest identifier (starting from 0)
        uint256 vestID;
    }

    event CancelVesting(address indexed user, uint256 indexed vestId, uint256 amount);
    event ExitVesting(address indexed user, uint256 indexed vestId, uint256 amount);
    event InstantExit(address indexed user, uint256);

    event NewSlashingPenalty(uint256 penalty);

    event NewVest(address indexed user, uint256 indexed vestId, uint256 indexed amount);
    event NewVestingTimes(uint256 min, uint256 max);

    event Converted(address indexed user, uint256);

    event Exemption(address indexed candidate, bool status, bool success);

    event XShadowRedeemed(address indexed user, uint256);

    event NewOperator(address indexed o, address indexed n);

    event Rebase(address indexed caller, uint256 amount);

    event NewRebaseThreshold(uint256 threshold);

    /// @notice returns info on a user's vests
    function vestInfo(address user, uint256)
        external
        view
        returns (uint256 amount, uint256 start, uint256 maxEnd, uint256 vestID);

    /// @notice address of the shadow token
    function SHADOW() external view returns (IERC20);

    /// @notice address of the voter
    function VOTER() external view returns (IVoter);

    function MINTER() external view returns (address);

    function ACCESS_HUB() external view returns (address);

    /// @notice address of the operator
    function operator() external view returns (address);

    /// @notice address of the VoteModule
    function VOTE_MODULE() external view returns (address);

    /// @notice max slashing amount
    function SLASHING_PENALTY() external view returns (uint256);

    /// @notice denominator
    function BASIS() external view returns (uint256);

    /// @notice the minimum vesting length
    function MIN_VEST() external view returns (uint256);

    /// @notice the maximum vesting length
    function MAX_VEST() external view returns (uint256);

    function shadow() external view returns (address);

    /// @notice the last period rebases were distributed
    function lastDistributedPeriod() external view returns (uint256);

    /// @notice amount of pvp rebase penalties accumulated pending to be distributed
    function pendingRebase() external view returns (uint256);

    /// @notice dust threshold before a rebase can happen
    function rebaseThreshold() external view returns (uint256);

    /// @notice pauses the contract
    function pause() external;

    /// @notice unpauses the contract
    function unpause() external;

    /**
     *
     */
    // General use functions
    /**
     *
     */

    /// @dev mints xShadows for each shadow.
    function convertEmissionsToken(uint256 _amount) external;

    /// @notice function called by the minter to send the rebases once a week
    function rebase() external;
    /**
     * @dev exit instantly with a penalty
     * @param _amount amount of xShadows to exit
     */
    function exit(uint256 _amount) external returns (uint256 _exitedAmount);

    /// @dev vesting xShadows --> emissionToken functionality
    function createVest(uint256 _amount) external;

    /// @dev handles all situations regarding exiting vests
    function exitVest(uint256 _vestID) external;

    /**
     *
     */
    // Permissioned functions, timelock/operator gated
    /**
     *
     */

    /// @dev allows the operator to redeem collected xShadows
    function operatorRedeem(uint256 _amount) external;

    /// @dev allows rescue of any non-stake token
    function rescueTrappedTokens(address[] calldata _tokens, uint256[] calldata _amounts) external;

    /// @notice migrates the operator to another contract
    function migrateOperator(address _operator) external;

    /// @notice set exemption status for an address
    function setExemption(address[] calldata _exemptee, bool[] calldata _exempt) external;

    function setExemptionTo(address[] calldata _exemptee, bool[] calldata _exempt) external;

    /// @notice set dust threshold before a rebase can happen
    function setRebaseThreshold(uint256 _newThreshold) external;

    /**
     *
     */
    // Getter functions
    /**
     *
     */

    /// @notice returns the amount of SHADOW within the contract
    function getBalanceResiding() external view returns (uint256);
    /// @notice returns the total number of individual vests the user has
    function usersTotalVests(address _who) external view returns (uint256 _numOfVests);

    /// @notice whether the address is exempt
    /// @param _who who to check
    /// @return _exempt whether it's exempt
    function isExempt(address _who) external view returns (bool _exempt);

    /// @notice returns the vest info for a user
    /// @param _who who to check
    /// @param _vestID vest ID to check
    /// @return VestPosition vest info
    function getVestInfo(address _who, uint256 _vestID) external view returns (VestPosition memory);
}

File 10 of 28 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 11 of 28 : Errors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Central Errors Library
/// @notice Contains all custom errors used across the protocol
/// @dev Centralized error definitions to prevent redundancy
library Errors {
    /*//////////////////////////////////////////////////////////////
                                VOTER ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when attempting to interact with an already active gauge
    /// @param gauge The address of the gauge
    error ACTIVE_GAUGE(address gauge);

    /// @notice Thrown when attempting to interact with an inactive gauge
    /// @param gauge The address of the gauge
    error GAUGE_INACTIVE(address gauge);

    /// @notice Thrown when attempting to whitelist an already whitelisted token
    /// @param token The address of the token
    error ALREADY_WHITELISTED(address token);

    /// @notice Thrown when caller is not authorized to perform an action
    /// @param caller The address of the unauthorized caller
    error NOT_AUTHORIZED(address caller);

    /// @notice Thrown when token is not whitelisted
    /// @param token The address of the non-whitelisted token
    error NOT_WHITELISTED(address token);

    /// @notice Thrown when both tokens in a pair are not whitelisted
    error BOTH_NOT_WHITELISTED();

    /// @notice Thrown when address is not a valid pool
    /// @param pool The invalid pool address
    error NOT_POOL(address pool);

    /// @notice Thrown when pool is not seeded in PoolUpdater
    /// @param pool The invalid pool address
    error NOT_SEEDED(address pool);

    /// @notice Thrown when contract is not initialized
    error NOT_INIT();

    /// @notice Thrown when array lengths don't match
    error LENGTH_MISMATCH();

    /// @notice Thrown when pool doesn't have an associated gauge
    /// @param pool The address of the pool
    error NO_GAUGE(address pool);

    /// @notice Thrown when rewards are already distributed for a period
    /// @param gauge The gauge address
    /// @param period The distribution period
    error ALREADY_DISTRIBUTED(address gauge, uint256 period);

    /// @notice Thrown when attempting to vote with zero amount
    /// @param pool The pool address
    error ZERO_VOTE(address pool);

    /// @notice Thrown when ratio exceeds maximum allowed
    /// @param _xRatio The excessive ratio value
    error RATIO_TOO_HIGH(uint256 _xRatio);

    /// @notice Thrown when vote operation fails
    error VOTE_UNSUCCESSFUL();

    /*//////////////////////////////////////////////////////////////
                            GAUGE V3 ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when the pool already has a gauge
    /// @param pool The address of the pool
    error GAUGE_EXISTS(address pool);

    /// @notice Thrown when caller is not the voter
    /// @param caller The address of the invalid caller
    error NOT_VOTER(address caller);

    /// @notice Thrown when amount is not greater than zero
    /// @param amt The invalid amount
    error NOT_GT_ZERO(uint256 amt);

    /// @notice Thrown when attempting to claim future rewards
    error CANT_CLAIM_FUTURE();

    /// @notice Throw when gauge can't determine if using secondsInRange from the pool is safe
    error NEED_TEAM_TO_UPDATE();

    /*//////////////////////////////////////////////////////////////
                            GAUGE ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when amount is zero
    error ZERO_AMOUNT();

    /// @notice Thrown when stake notification fails
    error CANT_NOTIFY_STAKE();

    /// @notice Thrown when reward amount is too high
    error REWARD_TOO_HIGH();

    /// @notice Thrown when amount exceeds remaining balance
    /// @param amount The requested amount
    /// @param remaining The remaining balance
    error NOT_GREATER_THAN_REMAINING(uint256 amount, uint256 remaining);

    /// @notice Thrown when token operation fails
    /// @param token The address of the problematic token
    error TOKEN_ERROR(address token);

    /// @notice Thrown when an address is not an NfpManager
    error NOT_NFP_MANAGER(address nfpManager);

    /*//////////////////////////////////////////////////////////////
                        FEE DISTRIBUTOR ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when period is not finalized
    /// @param period The unfinalized period
    error NOT_FINALIZED(uint256 period);

    /// @notice Thrown when the destination of a redirect is not a feeDistributor
    /// @param destination Destination of the redirect
    error NOT_FEE_DISTRIBUTOR(address destination);

    /// @notice Thrown when the destination of a redirect's pool/pair has completely different tokens
    error DIFFERENT_DESTINATION_TOKENS();

    /*//////////////////////////////////////////////////////////////
                            PAIR ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when ratio is unstable
    error UNSTABLE_RATIO();

    /// @notice Thrown when safe transfer fails
    error SAFE_TRANSFER_FAILED();

    /// @notice Thrown on arithmetic overflow
    error OVERFLOW();

    /// @notice Thrown when skim operation is disabled
    error SKIM_DISABLED();

    /// @notice Thrown when insufficient liquidity is minted
    error INSUFFICIENT_LIQUIDITY_MINTED();

    /// @notice Thrown when insufficient liquidity is burned
    error INSUFFICIENT_LIQUIDITY_BURNED();

    /// @notice Thrown when output amount is insufficient
    error INSUFFICIENT_OUTPUT_AMOUNT();

    /// @notice Thrown when input amount is insufficient
    error INSUFFICIENT_INPUT_AMOUNT();

    /// @notice Generic insufficient liquidity error
    error INSUFFICIENT_LIQUIDITY();

    /// @notice Invalid transfer error
    error INVALID_TRANSFER();

    /// @notice K value error in AMM
    error K();

    /*//////////////////////////////////////////////////////////////
                        PAIR FACTORY ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when fee is too high
    error FEE_TOO_HIGH();

    /// @notice Thrown when fee is zero
    error ZERO_FEE();

    /// @notice Thrown when token assortment is invalid
    error INVALID_ASSORTMENT();

    /// @notice Thrown when address is zero
    error ZERO_ADDRESS();

    /// @notice Thrown when pair already exists
    error PAIR_EXISTS();

    /// @notice Thrown when fee split is invalid
    error INVALID_FEE_SPLIT();

    /*//////////////////////////////////////////////////////////////
                    FEE RECIPIENT FACTORY ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when treasury fee is invalid
    error INVALID_TREASURY_FEE();

    /*//////////////////////////////////////////////////////////////
                            ROUTER ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when deadline has expired
    error EXPIRED();

    /// @notice Thrown when tokens are identical
    error IDENTICAL();

    /// @notice Thrown when amount is insufficient
    error INSUFFICIENT_AMOUNT();

    /// @notice Thrown when path is invalid
    error INVALID_PATH();

    /// @notice Thrown when token B amount is insufficient
    error INSUFFICIENT_B_AMOUNT();

    /// @notice Thrown when token A amount is insufficient
    error INSUFFICIENT_A_AMOUNT();

    /// @notice Thrown when input amount is excessive
    error EXCESSIVE_INPUT_AMOUNT();

    /// @notice Thrown when ETH transfer fails
    error ETH_TRANSFER_FAILED();

    /// @notice Thrown when reserves are invalid
    error INVALID_RESERVES();

    /*//////////////////////////////////////////////////////////////
                            MINTER ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when epoch 0 has already started
    error STARTED();

    /// @notice Thrown when emissions haven't started
    error EMISSIONS_NOT_STARTED();

    /// @notice Thrown when deviation is too high
    error TOO_HIGH();

    /// @notice Thrown when no value change detected
    error NO_CHANGE();

    /// @notice Thrown when updating emissions in same period
    error SAME_PERIOD();

    /// @notice Thrown when contract setup is invalid
    error INVALID_CONTRACT();

    /// @notice Thrown when legacy factory doesn't have feeSplitWhenNoGauge on
    error FEE_SPLIT_WHEN_NO_GAUGE_IS_OFF();

    /*//////////////////////////////////////////////////////////////
                        ACCESS HUB ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when addresses are identical
    error SAME_ADDRESS();

    /// @notice Thrown when caller is not timelock
    /// @param caller The invalid caller address
    error NOT_TIMELOCK(address caller);

    /// @notice Thrown when manual execution fails
    /// @param reason The failure reason
    error MANUAL_EXECUTION_FAILURE(bytes reason);

    /// @notice Thrown when kick operation is forbidden
    /// @param target The target address
    error KICK_FORBIDDEN(address target);

    /*//////////////////////////////////////////////////////////////
                        VOTE MODULE ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when caller is not xShadow
    error NOT_XSHADOW();

    /// @notice Thrown when cooldown period is still active
    error COOLDOWN_ACTIVE();

    /// @notice Thrown when caller is not vote module
    error NOT_VOTEMODULE();

    /// @notice Thrown when caller is unauthorized
    error UNAUTHORIZED();

    /// @notice Thrown when caller is not access hub
    error NOT_ACCESSHUB();

    /// @notice Thrown when address is invalid
    error INVALID_ADDRESS();

    /*//////////////////////////////////////////////////////////////
                        LAUNCHER PLUGIN ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when caller is not authority
    error NOT_AUTHORITY();

    /// @notice Thrown when already an authority
    error ALREADY_AUTHORITY();

    /// @notice Thrown when caller is not operator
    error NOT_OPERATOR();

    /// @notice Thrown when already an operator
    error ALREADY_OPERATOR();

    /// @notice Thrown when pool is not enabled
    /// @param pool The disabled pool address
    error NOT_ENABLED(address pool);

    /// @notice Thrown when fee distributor is missing
    error NO_FEEDIST();

    /// @notice Thrown when already enabled
    error ENABLED();

    /// @notice Thrown when take value is invalid
    error INVALID_TAKE();

    /*//////////////////////////////////////////////////////////////
                            X33 ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when value is zero
    error ZERO();

    /// @notice Thrown when amount is insufficient
    error NOT_ENOUGH();

    /// @notice Thrown when value doesn't conform to scale
    /// @param value The non-conforming value
    error NOT_CONFORMED_TO_SCALE(uint256 value);

    /// @notice Thrown when contract is locked
    error LOCKED();

    /// @notice Thrown when rebase is in progress
    error REBASE_IN_PROGRESS();

    /// @notice Thrown when aggregator reverts
    /// @param reason The revert reason
    error AGGREGATOR_REVERTED(bytes reason);

    /// @notice Thrown when output amount is too low
    /// @param amount The insufficient amount
    error AMOUNT_OUT_TOO_LOW(uint256 amount);

    /// @notice Thrown when aggregator is not whitelisted
    /// @param aggregator The non-whitelisted aggregator address
    error AGGREGATOR_NOT_WHITELISTED(address aggregator);

    /// @notice Thrown when token is forbidden
    /// @param token The forbidden token address
    error FORBIDDEN_TOKEN(address token);

    /*//////////////////////////////////////////////////////////////
                            XSHADOW ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when caller is not minter
    error NOT_MINTER();

    /// @notice Thrown when no vest exists
    error NO_VEST();

    /// @notice Thrown when already exempt
    error ALREADY_EXEMPT();

    /// @notice Thrown when not exempt
    error NOT_EXEMPT();

    /// @notice Thrown when rescue operation is not allowed
    error CANT_RESCUE();

    /// @notice Thrown when array lengths mismatch
    error ARRAY_LENGTHS();

    /// @notice Thrown when vesting periods overlap
    error VEST_OVERLAP();

    /*//////////////////////////////////////////////////////////////
                            V3 FACTORY ERRORS
    //////////////////////////////////////////////////////////////*/

    /// @notice Thrown when tokens are identical
    error IDENTICAL_TOKENS();

    /// @notice Thrown when fee is too large
    error FEE_TOO_LARGE();

    /// @notice Address zero error
    error ADDRESS_ZERO();

    /// @notice Fee zero error
    error F0();

    /// @notice Thrown when value is out of bounds
    /// @param value The out of bounds value
    error OOB(uint8 value);

    /*//////////////////////////////////////////////////////////////
                            POOL UPDATER ERRORS
    //////////////////////////////////////////////////////////////*/
    /// @notice Thrown when seeding for a pool fails
    error TRANSFER_FROM_FOR_SEEDING_FAILED(address token, uint256 amount);

    /// @notice Thrown when seeding for a pool fails
    error SEEDING_FAILED();

    /// @notice Thrown when updatePools is called too early
    error TOO_EARLY();

    /// @notice Thrown when a callback is called when an update isn't running
    error NOT_RUNNING();

    /// @notice Thrown when updatePools didn't perform any updates
    error NO_UPDATES();
}

File 12 of 28 : IPair.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IPair {
    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    /// @notice initialize the pool, called only once programatically
    function initialize(address _token0, address _token1, bool _stable) external;

    /// @notice calculate the current reserves of the pool and their last 'seen' timestamp
    /// @return _reserve0 amount of token0 in reserves
    /// @return _reserve1 amount of token1 in reserves
    /// @return _blockTimestampLast the timestamp when the pool was last updated
    function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);

    /// @notice mint the pair tokens (LPs)
    /// @param to where to mint the LP tokens to
    /// @return liquidity amount of LP tokens to mint
    function mint(address to) external returns (uint256 liquidity);

    /// @notice burn the pair tokens (LPs)
    /// @param to where to send the underlying
    /// @return amount0 amount of amount0
    /// @return amount1 amount of amount1
    function burn(address to) external returns (uint256 amount0, uint256 amount1);

    /// @notice direct swap through the pool
    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;

    /// @notice force balances to match reserves, can be used to harvest rebases from rebasing tokens or other external factors
    /// @param to where to send the excess tokens to
    function skim(address to) external;

    /// @notice force reserves to match balances, prevents skim excess if skim is enabled
    function sync() external;

    /// @notice set the pair fees contract address
    function setFeeRecipient(address _pairFees) external;

    /// @notice set the feesplit variable
    function setFeeSplit(uint256 _feeSplit) external;

    /// @notice sets the swap fee of the pair
    /// @dev scaled to a max of 50% (500_000/1_000_000)
    /// @param _fee the fee
    function setFee(uint256 _fee) external;

    /// @notice 'mint' the fees as LP tokens
    /// @dev this is used for protocol/voter fees
    function mintFee() external;

    /// @notice calculates the amount of tokens to receive post swap
    /// @param amountIn the token amount
    /// @param tokenIn the address of the token
    function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256 amountOut);

    /// @notice returns various metadata about the pair
    function metadata()
        external
        view
        returns (
            uint256 _decimals0,
            uint256 _decimals1,
            uint256 _reserve0,
            uint256 _reserve1,
            bool _stable,
            address _token0,
            address _token1
        );

    /// @notice returns the feeSplit of the pair
    function feeSplit() external view returns (uint256);

    /// @notice returns the fee of the pair
    function fee() external view returns (uint256);

    /// @notice returns the feeRecipient of the pair
    function feeRecipient() external view returns (address);

    /// @notice returns the token0 of the pair
    function token0() external view returns (address);

    /// @notice returns the token1 of the pair
    function token1() external view returns (address);

    /// @notice returns if pair is stable
    function stable() external view returns (bool);

    /// @notice returns kLast
    function kLast() external view returns (uint256);
}

File 13 of 28 : IPairFactory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IPairFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint256);

    event SetFee(uint256 indexed fee);

    event SetPairFee(address indexed pair, uint256 indexed fee);

    event SetFeeSplit(uint256 indexed _feeSplit);

    event SetPairFeeSplit(address indexed pair, uint256 indexed _feeSplit);

    event SkimStatus(address indexed _pair, bool indexed _status);

    event NewTreasury(address indexed _caller, address indexed _newTreasury);

    event FeeSplitWhenNoGauge(address indexed _caller, bool indexed _status);

    event SetFeeRecipient(address indexed pair, address indexed feeRecipient);

    /// @notice returns the total length of legacy pairs
    /// @return _length the length
    function allPairsLength() external view returns (uint256 _length);

    /// @notice calculates if the address is a legacy pair
    /// @param pair the address to check
    /// @return _boolean the bool return
    function isPair(address pair) external view returns (bool _boolean);

    /// @notice calculates the pairCodeHash
    /// @return _hash the pair code hash
    function pairCodeHash() external view returns (bytes32 _hash);

    /// @param tokenA address of tokenA
    /// @param tokenB address of tokenB
    /// @param stable whether it uses the stable curve
    /// @return _pair the address of the pair
    function getPair(address tokenA, address tokenB, bool stable) external view returns (address _pair);

    /// @notice creates a new legacy pair
    /// @param tokenA address of tokenA
    /// @param tokenB address of tokenB
    /// @param stable whether it uses the stable curve
    /// @return pair the address of the created pair
    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair);

    /// @notice the address of the voter
    /// @return _voter the address of the voter
    function voter() external view returns (address _voter);

    /// @notice returns the address of a pair based on the index
    /// @param _index the index to check for a pair
    /// @return _pair the address of the pair at the index
    function allPairs(uint256 _index) external view returns (address _pair);

    /// @notice the swap fee of a pair
    /// @param _pair the address of the pair
    /// @return _fee the fee
    function pairFee(address _pair) external view returns (uint256 _fee);

    /// @notice the split of fees
    /// @return _split the feeSplit
    function feeSplit() external view returns (uint256 _split);

    /// @notice sets the swap fee for a pair
    /// @param _pair the address of the pair
    /// @param _fee the fee for the pair
    function setPairFee(address _pair, uint256 _fee) external;

    /// @notice set the swap fees of the pair
    /// @param _fee the fee, scaled to MAX 500_000 = 50%
    function setFee(uint256 _fee) external;

    /// @notice the address for the treasury
    /// @return _treasury address of the treasury
    function treasury() external view returns (address _treasury);

    /// @notice sets the pairFees contract
    /// @param _pair the address of the pair
    /// @param _pairFees the address of the new Pair Fees
    function setFeeRecipient(address _pair, address _pairFees) external;

    /// @notice sets the feeSplit for a pair
    /// @param _pair the address of the pair
    /// @param _feeSplit the feeSplit
    function setPairFeeSplit(address _pair, uint256 _feeSplit) external;

    /// @notice whether there is feeSplit when there's no gauge
    /// @return _boolean whether there is a feesplit when no gauge
    function feeSplitWhenNoGauge() external view returns (bool _boolean);

    /// @notice whether a pair can be skimmed
    /// @param _pair the pair address
    /// @return _boolean whether skim is enabled
    function skimEnabled(address _pair) external view returns (bool _boolean);

    /// @notice set whether skim is enabled for a specific pair
    function setSkimEnabled(address _pair, bool _status) external;

    /// @notice sets a new treasury address
    /// @param _treasury the new treasury address
    function setTreasury(address _treasury) external;

    /// @notice set whether there should be a feesplit without gauges
    /// @param status whether enabled or not
    function setFeeSplitWhenNoGauge(bool status) external;

    /// @notice sets the feesSplit globally
    /// @param _feeSplit the fee split
    function setFeeSplit(uint256 _feeSplit) external;
}

File 14 of 28 : IRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IRouter {
    struct route {
        /// @dev token from
        address from;
        /// @dev token to
        address to;
        /// @dev is stable route
        bool stable;
    }

    /// @notice sorts the tokens to see what the expected LP output would be for token0 and token1 (A/B)
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @return token0 address of which becomes token0
    /// @return token1 address of which becomes token1
    function sortTokens(address tokenA, address tokenB) external pure returns (address token0, address token1);

    /// @notice calculates the CREATE2 address for a pair without making any external calls
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @return pair address of the pair
    function pairFor(address tokenA, address tokenB, bool stable) external view returns (address pair);

    /// @notice fetches and sorts the reserves for a pair
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @return reserveA get the reserves for tokenA
    /// @return reserveB get the reserves for tokenB
    function getReserves(address tokenA, address tokenB, bool stable)
        external
        view
        returns (uint256 reserveA, uint256 reserveB);

    /// @notice performs chained getAmountOut calculations on any number of pairs
    /// @param amountIn the amount of tokens of routes[0] to swap
    /// @param routes the struct of the hops the swap should take
    /// @return amounts uint array of the amounts out
    function getAmountsOut(uint256 amountIn, route[] memory routes) external view returns (uint256[] memory amounts);

    /// @notice performs chained getAmountOut calculations on any number of pairs
    /// @param amountIn amount of tokenIn
    /// @param tokenIn address of the token going in
    /// @param tokenOut address of the token coming out
    /// @return amount uint amount out
    /// @return stable if the curve used is stable or not
    function getAmountOut(uint256 amountIn, address tokenIn, address tokenOut)
        external
        view
        returns (uint256 amount, bool stable);

    /// @notice performs calculations to determine the expected state when adding liquidity
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @return amountA amount of tokenA added
    /// @return amountB amount of tokenB added
    /// @return liquidity liquidity value added
    function quoteAddLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired
    ) external view returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param liquidity liquidity value to remove
    /// @return amountA amount of tokenA removed
    /// @return amountB amount of tokenB removed
    function quoteRemoveLiquidity(address tokenA, address tokenB, bool stable, uint256 liquidity)
        external
        view
        returns (uint256 amountA, uint256 amountB);

    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @param amountAMin slippage for tokenA calculated from this param
    /// @param amountBMin slippage for tokenB calculated from this param
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @param token the address of token
    /// @param stable if the pair is using the stable curve
    /// @param amountTokenDesired desired amount for token
    /// @param amountTokenMin slippage for token
    /// @param amountETHMin minimum amount of ETH added (slippage)
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of the token used
    /// @return amountETH amount of ETH used
    /// @return liquidity amount of liquidity minted
    function addLiquidityETH(
        address token,
        bool stable,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @param amountAMin slippage for tokenA calculated from this param
    /// @param amountBMin slippage for tokenB calculated from this param
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidityAndStake(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @notice adds liquidity to a legacy pair using ETH, and stakes it into a gauge on "to's" behalf
    /// @param token the address of token
    /// @param stable if the pair is using the stable curve
    /// @param amountTokenDesired amount of token to be used
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidityETHAndStake(
        address token,
        bool stable,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external payable returns (uint256 amountA, uint256 amountB, uint256 liquidity);
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param liquidity amount of LP tokens to remove
    /// @param amountAMin slippage of tokenA
    /// @param amountBMin slippage of tokenB
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    function removeLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);
    /// @param token address of the token
    /// @param stable if the pair is using the stable curve
    /// @param liquidity liquidity tokens to remove
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of token used
    /// @return amountETH amount of ETH used
    function removeLiquidityETH(
        address token,
        bool stable,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
    /// @param amountIn amount to send ideally
    /// @param amountOutMin slippage of amount out
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        route[] memory routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactETHForTokens(uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);
    /// @param amountOut amount of tokens to get out
    /// @param amountInMax max amount of tokens to put in to achieve amountOut (slippage)
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountIn amount of tokens to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountOut exact amount out or revert
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapETHForExactTokens(uint256 amountOut, route[] calldata routes, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);

    /// @param amountIn token amount to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external;

    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external payable;

    /// @param amountIn token amount to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external;

    /// @notice **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens)****
    /// @param token address of the token
    /// @param stable if the swap curve is stable
    /// @param liquidity liquidity value (lp tokens)
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to address to send to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of token received
    /// @return amountETH amount of ETH received
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        bool stable,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
}

File 15 of 28 : IVoter.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
pragma abicoder v2;

interface IVoter {
    event GaugeCreated(address indexed gauge, address creator, address feeDistributor, address indexed pool);

    event GaugeKilled(address indexed gauge);

    event GaugeRevived(address indexed gauge);

    event Voted(address indexed owner, uint256 weight, address indexed pool);

    event Abstained(address indexed owner, uint256 weight);

    event Deposit(address indexed lp, address indexed gauge, address indexed owner, uint256 amount);

    event Withdraw(address indexed lp, address indexed gauge, address indexed owner, uint256 amount);

    event NotifyReward(address indexed sender, address indexed reward, uint256 amount);

    event DistributeReward(address indexed sender, address indexed gauge, uint256 amount);

    event EmissionsRatio(address indexed caller, uint256 oldRatio, uint256 newRatio);

    event NewGovernor(address indexed sender, address indexed governor);

    event Whitelisted(address indexed whitelister, address indexed token);

    event WhitelistRevoked(address indexed forbidder, address indexed token, bool status);

    event MainTickSpacingChanged(address indexed token0, address indexed token1, int24 indexed newMainTickSpacing);

    event Poke(address indexed user);

    event EmissionsRedirected(address indexed sourceGauge, address indexed destinationGauge);

    struct InitializationParams {
        address shadow;
        address legacyFactory;
        address gauges;
        address feeDistributorFactory;
        address minter;
        address msig;
        address xShadow;
        address clFactory;
        address clGaugeFactory;
        address nfpManager;
        address feeRecipientFactory;
        address voteModule;
        address launcherPlugin;
        address poolUpdater;
    }

    function initialize(InitializationParams memory inputs) external;

    /// @notice denominator basis
    function BASIS() external view returns (uint256);

    /// @notice ratio of xShadow emissions globally
    function xRatio() external view returns (uint256);

    /// @notice xShadow contract address
    function xShadow() external view returns (address);

    /// @notice legacy factory address (uni-v2/stableswap)
    function legacyFactory() external view returns (address);

    /// @notice concentrated liquidity factory
    function clFactory() external view returns (address);

    /// @notice gauge factory for CL
    function clGaugeFactory() external view returns (address);

    /// @notice pool updater for CL
    function poolUpdater() external view returns (address);

    /// @notice legacy fee recipient factory
    function feeRecipientFactory() external view returns (address);

    /// @notice peripheral NFPManager contract
    function nfpManager() external view returns (address);

    /// @notice returns the address of the current governor
    /// @return _governor address of the governor
    function governor() external view returns (address _governor);

    /// @notice the address of the vote module
    /// @return _voteModule the vote module contract address
    function voteModule() external view returns (address _voteModule);

    /// @notice address of the central access Hub
    function accessHub() external view returns (address);

    /// @notice the address of the shadow launcher plugin to enable third party launchers
    /// @return _launcherPlugin the address of the plugin
    function launcherPlugin() external view returns (address _launcherPlugin);

    /// @notice distributes emissions from the minter to the voter
    /// @param amount the amount of tokens to notify
    function notifyRewardAmount(uint256 amount) external;

    /// @notice distributes the emissions for a specific gauge
    /// @param _gauge the gauge address
    function distribute(address _gauge) external;

    /// @notice returns the address of the gauge factory
    /// @param _gaugeFactory gauge factory address
    function gaugeFactory() external view returns (address _gaugeFactory);

    /// @notice returns the address of the feeDistributor factory
    /// @return _feeDistributorFactory feeDist factory address
    function feeDistributorFactory() external view returns (address _feeDistributorFactory);

    /// @notice returns the address of the minter contract
    /// @return _minter address of the minter
    function minter() external view returns (address _minter);

    /// @notice check if the gauge is active for governance use
    /// @param _gauge address of the gauge
    /// @return _trueOrFalse if the gauge is alive
    function isAlive(address _gauge) external view returns (bool _trueOrFalse);

    /// @notice allows the token to be paired with other whitelisted assets to participate in governance
    /// @param _token the address of the token
    function whitelist(address _token) external;

    /// @notice effectively disqualifies a token from governance
    /// @param _token the address of the token
    function revokeWhitelist(address _token) external;

    /// @notice returns if the address is a gauge
    /// @param gauge address of the gauge
    /// @return _trueOrFalse boolean if the address is a gauge
    function isGauge(address gauge) external view returns (bool _trueOrFalse);

    /// @notice disable a gauge from governance
    /// @param _gauge address of the gauge
    function killGauge(address _gauge) external;

    /// @notice re-activate a dead gauge
    /// @param _gauge address of the gauge
    function reviveGauge(address _gauge) external;

    /// @notice re-cast a tokenID's votes
    /// @param owner address of the owner
    function poke(address owner) external;

    /// @notice sets the main destinationGauge of a token pairing
    /// @param tokenA address of tokenA
    /// @param tokenB address of tokenB
    /// @param destinationGauge the main gauge to set to
    function redirectEmissions(address tokenA, address tokenB, address destinationGauge) external;

    /// @notice returns if the address is a fee distributor
    /// @param _feeDistributor address of the feeDist
    /// @return _trueOrFalse if the address is a fee distributor
    function isFeeDistributor(address _feeDistributor) external view returns (bool _trueOrFalse);

    /// @notice returns the address of the emission's token
    /// @return _shadow emissions token contract address
    function shadow() external view returns (address _shadow);

    /// @notice returns the address of the pool's gauge, if any
    /// @param _pool pool address
    /// @return _gauge gauge address
    function gaugeForPool(address _pool) external view returns (address _gauge);

    /// @notice returns the address of the pool's feeDistributor, if any
    /// @param _gauge address of the gauge
    /// @return _feeDistributor address of the pool's feedist
    function feeDistributorForGauge(address _gauge) external view returns (address _feeDistributor);

    /// @notice returns the gauge address of a CL pool
    /// @param tokenA address of token A in the pair
    /// @param tokenB address of token B in the pair
    /// @param tickSpacing tickspacing of the pool
    /// @return gauge address of the gauge
    function gaugeForClPool(address tokenA, address tokenB, int24 tickSpacing) external view returns (address gauge);

    /// @notice returns the array of all tickspacings for the tokenA/tokenB combination
    /// @param tokenA address of token A in the pair
    /// @param tokenB address of token B in the pair
    /// @return _ts array of all the tickspacings
    function tickSpacingsForPair(address tokenA, address tokenB) external view returns (int24[] memory _ts);

    /// @notice returns the destination of a gauge redirect
    /// @param gauge address of gauge
    function gaugeRedirect(address gauge) external view returns (address);

    /// @notice returns the block.timestamp divided by 1 week in seconds
    /// @return period the period used for gauges
    function getPeriod() external view returns (uint256 period);

    /// @notice cast a vote to direct emissions to gauges and earn incentives
    /// @param owner address of the owner
    /// @param _pools the list of pools to vote on
    /// @param _weights an arbitrary weight per pool which will be normalized to 100% regardless of numerical inputs
    function vote(address owner, address[] calldata _pools, uint256[] calldata _weights) external;

    /// @notice reset the vote of an address
    /// @param owner address of the owner
    function reset(address owner) external;

    /// @notice set the governor address
    /// @param _governor the new governor address
    function setGovernor(address _governor) external;

    /// @notice recover stuck emissions
    /// @param _gauge the gauge address
    /// @param _period the period
    function stuckEmissionsRecovery(address _gauge, uint256 _period) external;

    /// @notice creates a legacy gauge for the pool
    /// @param _pool pool's address
    /// @return _gauge address of the new gauge
    function createGauge(address _pool) external returns (address _gauge);

    /// @notice create a concentrated liquidity gauge
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param tickSpacing the tickspacing of the pool
    /// @return _clGauge address of the new gauge
    function createCLGauge(address tokenA, address tokenB, int24 tickSpacing) external returns (address _clGauge);

    /// @notice claim concentrated liquidity gauge rewards for specific NFP token ids
    /// @param _gauges array of gauges
    /// @param _tokens two dimensional array for the tokens to claim
    /// @param _nfpTokenIds two dimensional array for the NFPs
    function claimClGaugeRewards(
        address[] calldata _gauges,
        address[][] calldata _tokens,
        uint256[][] calldata _nfpTokenIds
    ) external;

    /// @notice claim arbitrary rewards from specific feeDists
    /// @param owner address of the owner
    /// @param _feeDistributors address of the feeDists
    /// @param _tokens two dimensional array for the tokens to claim
    function claimIncentives(address owner, address[] calldata _feeDistributors, address[][] calldata _tokens)
        external;

    /// @notice claim arbitrary rewards from specific feeDists and break up legacy pairs
    /// @param owner address of the owner
    /// @param _feeDistributors address of the feeDists
    /// @param _tokens two dimensional array for the tokens to claim
    function claimLegacyIncentives(address owner, address[] calldata _feeDistributors, address[][] calldata _tokens)
        external;

    /// @notice claim arbitrary rewards from specific gauges
    /// @param _gauges address of the gauges
    /// @param _tokens two dimensional array for the tokens to claim
    function claimRewards(address[] calldata _gauges, address[][] calldata _tokens) external;

    /// @notice claim arbitrary rewards from specific legacy gauges, and exit to shadow
    /// @param _gauges address of the gauges
    /// @param _tokens two dimensional array for the tokens to claim
    function claimLegacyRewardsAndExit(address[] calldata _gauges, address[][] calldata _tokens) external;

    /// @notice claim arbitrary rewards from specific cl gauges, and exit to shadow
    /// @param _gauges address of the gauges
    /// @param _tokens two dimensional array for the tokens to claim
    /// @param _nfpTokenIds two dimensional array for the nfp to claim
    function claimClGaugeRewardsAndExit(
        address[] memory _gauges,
        address[][] memory _tokens,
        uint256[][] memory _nfpTokenIds
    ) external;

    /// @notice distribute emissions to a gauge for a specific period
    /// @param _gauge address of the gauge
    /// @param _period value of the period
    function distributeForPeriod(address _gauge, uint256 _period) external;

    /// @notice attempt distribution of emissions to all gauges
    function distributeAll() external;

    /// @notice distribute emissions to gauges by index
    /// @param startIndex start of the loop
    /// @param endIndex end of the loop
    function batchDistributeByIndex(uint256 startIndex, uint256 endIndex) external;

    /// @notice lets governance update lastDistro period for a gauge
    /// @dev should only be used if distribute() is running out of gas
    /// @dev gaugePeriodDistributed will stop double claiming
    /// @param _gauge gauge to update
    /// @param _period period to update to
    function updateLastDistro(address _gauge, uint256 _period) external;

    /// @notice returns the votes cast for a tokenID
    /// @param owner address of the owner
    /// @return votes an array of votes casted
    /// @return weights an array of the weights casted per pool
    function getVotes(address owner, uint256 period)
        external
        view
        returns (address[] memory votes, uint256[] memory weights);

    /// @notice returns an array of all the pools
    /// @return _pools the array of pools
    function getAllPools() external view returns (address[] memory _pools);

    /// @notice returns the length of pools
    function getPoolsLength() external view returns (uint256);

    /// @notice returns the pool at index
    function getPool(uint256 index) external view returns (address);

    /// @notice returns an array of all the gauges
    /// @return _gauges the array of gauges
    function getAllGauges() external view returns (address[] memory _gauges);

    /// @notice returns the length of gauges
    function getGaugesLength() external view returns (uint256);

    /// @notice returns the gauge at index
    function getGauge(uint256 index) external view returns (address);

    /// @notice returns an array of all the feeDists
    /// @return _feeDistributors the array of feeDists
    function getAllFeeDistributors() external view returns (address[] memory _feeDistributors);

    /// @notice sets the xShadowRatio default
    function setGlobalRatio(uint256 _xRatio) external;

    /// @notice whether the token is whitelisted in governance
    function isWhitelisted(address _token) external view returns (bool _tf);

    /// @notice function for removing malicious or stuffed tokens
    function removeFeeDistributorReward(address _feeDist, address _token) external;

    /// @notice returns the total votes for a pool in a specific period
    /// @param pool the pool address to check
    /// @param period the period to check
    /// @return votes the total votes for the pool in that period
    function poolTotalVotesPerPeriod(address pool, uint256 period) external view returns (uint256 votes);

    /// @notice returns the pool address for a given gauge
    /// @param gauge address of the gauge
    /// @return pool address of the pool
    function poolForGauge(address gauge) external view returns (address pool);

    /// @notice returns the pool address for a given feeDistributor
    /// @param feeDistributor address of the feeDistributor
    /// @return pool address of the pool
    function poolForFeeDistributor(address feeDistributor) external view returns (address pool);

    /// @notice returns the voting power used by a voter for a period
    /// @param user address of the user
    /// @param period the period to check
    function userVotingPowerPerPeriod(address user, uint256 period) external view returns (uint256 votingPower);

    /// @notice returns the total votes for a specific period
    /// @param period the period to check
    /// @return weight the total votes for that period
    function totalVotesPerPeriod(uint256 period) external view returns (uint256 weight);

    /// @notice returns the total rewards allocated for a specific period
    /// @param period the period to check
    /// @return amount the total rewards for that period
    function totalRewardPerPeriod(uint256 period) external view returns (uint256 amount);

    /// @notice returns the last distribution period for a gauge
    /// @param _gauge address of the gauge
    /// @return period the last period distributions occurred
    function lastDistro(address _gauge) external view returns (uint256 period);

    /// @notice returns if the gauge is a Cl gauge
    /// @param gauge the gauge to check
    function isClGauge(address gauge) external view returns (bool);

    /// @notice returns if the gauge is a legacy gauge
    /// @param gauge the gauge to check
    function isLegacyGauge(address gauge) external view returns (bool);

    /// @notice sets a new NFP manager
    function setNfpManager(address _nfpManager) external;
}

File 16 of 28 : IFeeRecipientFactory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IFeeRecipientFactory {
    /// @notice the pair fees for a specific pair
    /// @param pair the pair to check
    /// @return feeRecipient the feeRecipient contract address for the pair
    function feeRecipientForPair(address pair) external view returns (address feeRecipient);

    /// @notice the last feeRecipient address created
    /// @return _feeRecipient the address of the last pair fees contract
    function lastFeeRecipient() external view returns (address _feeRecipient);
    /// @notice create the pair fees for a pair
    /// @param pair the address of the pair
    /// @return _feeRecipient the address of the newly created feeRecipient
    function createFeeRecipient(address pair) external returns (address _feeRecipient);

    /// @notice the fee % going to the treasury
    /// @return _feeToTreasury the fee %
    function feeToTreasury() external view returns (uint256 _feeToTreasury);

    /// @notice get the treasury address
    /// @return _treasury address of the treasury
    function treasury() external view returns (address _treasury);

    /// @notice set the fee % to be sent to the treasury
    /// @param _feeToTreasury the fee % to be sent to the treasury
    function setFeeToTreasury(uint256 _feeToTreasury) external;

    /// @notice set a new treasury address
    /// @param _treasury the new address
    function setTreasury(address _treasury) external;
}

File 17 of 28 : VoterStorage.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

library VoterStorage {
    using EnumerableSet for EnumerableSet.AddressSet;

    /// @dev keccak256(abi.encode(uint256(keccak256("voter.storage")) - 1)) & ~bytes32(uint256(0xff));
    bytes32 public constant VOTER_STORAGE_LOCATION = 0x1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e9500;

    /// @custom꞉storage‑location erc7201꞉voter.storage
    struct VoterState {
        /// @inheritdoc IVoter
        address legacyFactory;
        /// @inheritdoc IVoter
        address shadow;
        /// @inheritdoc IVoter
        address gaugeFactory;
        /// @inheritdoc IVoter
        address feeDistributorFactory;
        /// @inheritdoc IVoter
        address minter;
        /// @inheritdoc IVoter
        address accessHub;
        /// @inheritdoc IVoter
        address governor;
        /// @inheritdoc IVoter
        address clFactory;
        /// @inheritdoc IVoter
        address clGaugeFactory;
        /// @inheritdoc IVoter
        address poolUpdater;
        /// @inheritdoc IVoter
        address nfpManager;
        /// @inheritdoc IVoter
        address feeRecipientFactory;
        /// @inheritdoc IVoter
        address xShadow;
        /// @inheritdoc IVoter
        address voteModule;
        /// @inheritdoc IVoter
        address launcherPlugin;
        /// @inheritdoc IVoter
        uint256 xRatio;
        bool voterOwnsLegacyFactory;
        EnumerableSet.AddressSet pools;
        EnumerableSet.AddressSet gauges;
        EnumerableSet.AddressSet feeDistributors;
        mapping(address pool => address gauge) gaugeForPool;
        mapping(address gauge => address pool) poolForGauge;
        mapping(address gauge => address feeDistributor) feeDistributorForGauge;
        mapping(address token0 => mapping(address token1 => address feeDistributor)) feeDistributorForClPair;
        mapping(address token0 => mapping(address token1 => EnumerableSet.AddressSet gauges)) gaugesForClPair;
        mapping(address sourceGauge => address destinationGauge) gaugeRedirect;
        mapping(address pool => mapping(uint256 period => uint256 totalVotes)) poolTotalVotesPerPeriod;
        mapping(address user => mapping(uint256 period => mapping(address pool => uint256 totalVote)))
            userVotesForPoolPerPeriod;
        mapping(address user => mapping(uint256 period => address[] pools)) userVotedPoolsPerPeriod;
        mapping(address user => mapping(uint256 period => uint256 votingPower)) userVotingPowerPerPeriod;
        mapping(address user => uint256 period) lastVoted;
        mapping(uint256 period => uint256 rewards) totalRewardPerPeriod;
        mapping(uint256 period => uint256 weight) totalVotesPerPeriod;
        mapping(address gauge => mapping(uint256 period => uint256 reward)) gaugeRewardsPerPeriod;
        mapping(address gauge => mapping(uint256 period => bool distributed)) gaugePeriodDistributed;
        mapping(address gauge => uint256 period) lastDistro;
        mapping(address gauge => bool legacyGauge) isLegacyGauge;
        mapping(address gauge => bool clGauge) isClGauge;
        mapping(address => bool) isWhitelisted;
        mapping(address => bool) isAlive;
        /// @dev How many different CL pools there are for the same token pair
        mapping(address token0 => mapping(address token1 => int24[])) _tickSpacingsForPair;
        /// @dev specific gauge based on tickspacing
        mapping(address token0 => mapping(address token1 => mapping(int24 tickSpacing => address gauge)))
            _gaugeForClPool;
        mapping(address clGauge => address feeDist) originalFeeDistributorForGauge;
        mapping(address feeDist => address pool) poolForFeeDistributor;
    }

    /// @dev Return state storage struct for reading and writing
    function getStorage() internal pure returns (VoterState storage $) {
        assembly {
            $.slot := VOTER_STORAGE_LOCATION
        }
    }
}

File 18 of 28 : IPoolInitializer.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
    /// @notice Creates a new pool if it does not exist, then initializes if not initialized
    /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
    /// @param token0 The contract address of token0 of the pool
    /// @param token1 The contract address of token1 of the pool
    /// @param tickSpacing The tickSpacing of the v3 pool for the specified token pair
    /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
    /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
    function createAndInitializePoolIfNecessary(
        address token0,
        address token1,
        int24 tickSpacing,
        uint160 sqrtPriceX96
    ) external payable returns (address pool);
}

File 19 of 28 : IPeripheryPayments.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
    /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
    /// @param amountMinimum The minimum amount of WETH9 to unwrap
    /// @param recipient The address receiving ETH
    function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;

    /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
    /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
    /// that use ether for the input amount
    function refundETH() external payable;

    /// @notice Transfers the full amount of a token held by this contract to recipient
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
    /// @param token The contract address of the token which will be transferred to `recipient`
    /// @param amountMinimum The minimum amount of token required for a transfer
    /// @param recipient The destination address of the token
    function sweepToken(
        address token,
        uint256 amountMinimum,
        address recipient
    ) external payable;
}

File 20 of 28 : IPeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
    /// @return Returns the address of the Uniswap V3 deployer
    function deployer() external view returns (address);

    /// @return Returns the address of WETH9
    function WETH9() external view returns (address);
}

File 21 of 28 : PoolAddress.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Provides functions for deriving a pool address from the deployer, tokens, and the fee
library PoolAddress {
    bytes32 internal constant POOL_INIT_CODE_HASH = 0x892f127ed4b26ca352056c8fb54585a3268f76f97fdd84d5836ef4bda8d8c685;

    /// @notice The identifying key of the pool
    struct PoolKey {
        address token0;
        address token1;
        int24 tickSpacing;
    }

    /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
    /// @param tokenA The first token of a pool, unsorted
    /// @param tokenB The second token of a pool, unsorted
    /// @param tickSpacing The tickSpacing of the pool
    /// @return Poolkey The pool details with ordered token0 and token1 assignments
    function getPoolKey(address tokenA, address tokenB, int24 tickSpacing) internal pure returns (PoolKey memory) {
        if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
        return PoolKey({token0: tokenA, token1: tokenB, tickSpacing: tickSpacing});
    }

    /// @notice Deterministically computes the pool address given the deployer and PoolKey
    /// @param deployer The Uniswap V3 deployer contract address
    /// @param key The PoolKey
    /// @return pool The contract address of the V3 pool
    function computeAddress(address deployer, PoolKey memory key) internal pure returns (address pool) {
        require(key.token0 < key.token1, "!TokenOrder");
        pool = address(
            uint160(
                uint256(
                    keccak256(
                        abi.encodePacked(
                            hex'ff',
                            deployer,
                            keccak256(abi.encode(key.token0, key.token1, key.tickSpacing)),
                            POOL_INIT_CODE_HASH
                        )
                    )
                )
            )
        );
    }
}

File 22 of 28 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC-721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 23 of 28 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 24 of 28 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 25 of 28 : IPeripheryErrors.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Errors emitted by the NonFungiblePositionManager
/// @notice Contains all events emitted by the NfpManager
interface IPeripheryErrors {
    error InvalidTokenId(uint256 tokenId);
    error CheckSlippage();
    error NotCleared();
}

File 26 of 28 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 27 of 28 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 28 of 28 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Settings
{
  "remappings": [
    "@layerzerolabs/=node_modules/@layerzerolabs/",
    "@layerzerolabs/lz-evm-protocol-v2/=node_modules/@layerzerolabs/lz-evm-protocol-v2/",
    "@openzeppelin-contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/",
    "@openzeppelin-contracts/contracts/=dependencies/@openzeppelin-contracts-5.1.0/",
    "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.1.0/",
    "erc4626-tests/=dependencies/erc4626-property-tests-1.0/",
    "forge-std/=dependencies/forge-std-1.9.4/src/",
    "permit2/=lib/permit2/",
    "@axelar-network/=node_modules/@axelar-network/",
    "@chainlink/=node_modules/@chainlink/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@openzeppelin-3.4.2/=node_modules/@openzeppelin-3.4.2/",
    "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/",
    "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/",
    "@uniswap/=node_modules/@uniswap/",
    "base64-sol/=node_modules/base64-sol/",
    "erc4626-property-tests-1.0/=dependencies/erc4626-property-tests-1.0/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std-1.9.4/=dependencies/forge-std-1.9.4/src/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "solmate/=node_modules/solmate/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 333
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {
    "contracts/libraries/VoterGovernanceActions.sol": {
      "VoterGovernanceActions": "0x07A1539155758C975a6099aBc15d1B66a227dBDB"
    },
    "contracts/libraries/VoterRewardClaimers.sol": {
      "VoterRewardClaimers": "0x6D1E0D075A013bD5080Be66A717A322F39eACC87"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"gauge","type":"address"}],"name":"ACTIVE_GAUGE","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"ALREADY_WHITELISTED","type":"error"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"}],"name":"GAUGE_INACTIVE","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"NOT_WHITELISTED","type":"error"},{"inputs":[{"internalType":"uint256","name":"_xRatio","type":"uint256"}],"name":"RATIO_TOO_HIGH","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRatio","type":"uint256"}],"name":"EmissionsRatio","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"}],"name":"GaugeKilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"}],"name":"GaugeRevived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"governor","type":"address"}],"name":"NewGovernor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"forbidder","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"WhitelistRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"whitelister","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"Whitelisted","type":"event"},{"inputs":[],"name":"BASIS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6110eb610034600b8282823980515f1a607314602857634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100a6575f3560e01c8063992a79331161006e578063992a7933146101445780639b19251a146101635780639c7f3315146101825780639f06247b146101a1578063c42cf535146101c0575f5ffd5b80630f147632146100aa578063234823d7146100cb578063320e6840146100ea578063528cfa98146101095780635824780d14610125575b5f5ffd5b8180156100b5575f5ffd5b506100c96100c4366004610f1e565b6101df565b005b8180156100d6575f5ffd5b506100c96100e5366004610f4c565b610265565b8180156100f5575f5ffd5b506100c9610104366004610f83565b610300565b610113620f424081565b60405190815260200160405180910390f35b818015610130575f5ffd5b506100c961013f366004610fa5565b610389565b81801561014f575f5ffd5b506100c961015e366004610f83565b610548565b81801561016e575f5ffd5b506100c961017d366004610f83565b61099d565b81801561018d575f5ffd5b506100c961019c366004610f83565b610a62565b8180156101ac575f5ffd5b506100c96101bb366004610f83565b610b33565b8180156101cb575f5ffd5b506100c96101da366004610f83565b610d7a565b5f5160206110965f395f51905f5281620f424081111561021e57604051630216804b60e61b815260040161021591815260200190565b60405180910390fd5b50600f810154604080519182526020820184905233917fbf0e71132a05dec6f7baee9d3684132ceaf80effcca49bd225f7856604f38f7d910160405180910390a2600f0155565b5f5160206110965f395f51905f5261029d7f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e951584610e0c565b6102a5575f5ffd5b604051632935799f60e21b81526001600160a01b03838116600483015284169063a4d5e67c906024015f604051808303815f87803b1580156102e5575f5ffd5b505af11580156102f7573d5f5f3e3d5ffd5b50505050505050565b5f5f5160206110965f395f51905f52600a810180546001600160a01b0319166001600160a01b03858116918217909255600883015460405162c839a160e61b8152600481019290925292935091169063320e6840906024015f604051808303815f87803b15801561036f575f5ffd5b505af1158015610381573d5f5f3e3d5ffd5b505050505050565b6001600160a01b0382165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f5290839060ff16156103fe5760405163bbfeed9360e01b81526001600160a01b039091166004820152602401610215565b5061040c6013820184610e0c565b83906104375760405163c5491e0f60e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0383165f908152602582016020908152604080832085845290915290205460ff16610543576001600160a01b038084165f9081526018830160205260408120549091169061048d8285610e2f565b90508015610540576001830154600684015460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af11580156104eb573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061050f9190610fcf565b506001600160a01b0385165f90815260258401602090815260408083208784529091529020805460ff191660011790555b50505b505050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f529060ff1680156105a557506105a56013820183610e0c565b82906105d05760405163c5491e0f60e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b038083165f908152602a830160209081526040808320805460ff1916905560188501825280832054602786019092529091205491169060ff161561082357815460408051636373ea6960e01b815290515f926001600160a01b031691636373ea699160048083019260209291908290030181865afa15801561065c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106809190610fee565b835460405163203e180f60e11b81526001600160a01b0385811660048301526024820184905292935091169063407c301e906044015f604051808303815f87803b1580156106cc575f5ffd5b505af11580156106de573d5f5f3e3d5ffd5b50508454604080516341d93a7960e11b815290515f94506001600160a01b0390921692506383b274f29160048083019260209291908290030181865afa15801561072a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074e9190610fcf565b905080156107c0578354600685015460405163270401cb60e01b81526001600160a01b038681166004830152918216602482015291169063270401cb906044015f604051808303815f87803b1580156107a5575f5ffd5b505af11580156107b7573d5f5f3e3d5ffd5b50505050610820565b835460405163270401cb60e01b81526001600160a01b0385811660048301525f60248301529091169063270401cb906044015f604051808303815f87803b158015610809575f5ffd5b505af115801561081b573d5f5f3e3d5ffd5b505050505b50505b6001600160a01b0383165f90815260268301602052604081205490610846610f0b565b90505f825b8281116108df576001600160a01b0387165f908152602587016020908152604080832084845290915290205460ff166108cf575f6108898683610e2f565b90506108958184611019565b925080156108cd576001600160a01b0388165f90815260258801602090815260408083208584529091529020805460ff191660011790555b505b6108d88161102c565b905061084b565b508015610962576001850154600686015460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af115801561093c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109609190610fcf565b505b6040516001600160a01b038716907f04a5d3f5d80d22d9345acc80618f4a4e7e663cf9e1aed23b57d975acec002ba7905f90a2505050505050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952960205260409020545f5160206110965f395f51905f5290829060ff1615610a12576040516352af0d9160e11b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f818152602983016020526040808220805460ff191660011790555133917f6661a7108aecd07864384529117d96c319c1163e3010c01390f6b704726e07de91a35050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952960205260409020545f5160206110965f395f51905f5290829060ff16610ad657604051630b7b234960e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f818152602983016020908152604091829020805460ff1916905590516001815233917f85abc05b04dbd37a6324d72db47d565d98bfa5cafc40ba85ff9747c857cc4661910160405180910390a35050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f529060ff16158015610b915750610b916013820183610e0c565b8290610bbc5760405163bbfeed9360e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f908152602a820160209081526040808320805460ff191660011790556027840190915290205460ff1615610d43576001600160a01b038281165f90815260188301602052604080822054600b85015491516308a3a6ad60e11b8152908416600482018190529391909116906311474d5a90602401602060405180830381865afa158015610c57573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611044565b835460405163270401cb60e01b81526001600160a01b038581166004830152808416602483015292935091169063270401cb906044015f604051808303815f87803b158015610cc8575f5ffd5b505af1158015610cda573d5f5f3e3d5ffd5b5050845460405163203e180f60e11b81526001600160a01b038681166004830152620f42406024830152909116925063407c301e91506044015f604051808303815f87803b158015610d2a575f5ffd5b505af1158015610d3c573d5f5f3e3d5ffd5b5050505050505b6040516001600160a01b038316907fed18e9faa3dccfd8aa45f69c4de40546b2ca9cccc4538a2323531656516db1aa905f90a25050565b7f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e9506545f5160206110965f395f51905f52906001600160a01b03838116911614610e08576006810180546001600160a01b0319166001600160a01b03841690811790915560405133907f1ba669d4a78521f2ad26e8e0fcbcdd626a63f34d68f326bc232a3abe2a5d042a905f90a35b5050565b6001600160a01b0381165f90815260018301602052604090205415155b92915050565b6001600160a01b0382165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e951d602090815260408083208484528252808320547f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e95229092528220545f5160206110965f395f51905f52918391610eb3919061105f565b610ec590670de0b6b3a764000061105f565b90508015610f00575f848152602383016020526040902054670de0b6b3a764000090610ef19083611076565b610efb9190611076565b610f02565b5f5b95945050505050565b5f610f1962093a8042611076565b905090565b5f60208284031215610f2e575f5ffd5b5035919050565b6001600160a01b0381168114610f49575f5ffd5b50565b5f5f60408385031215610f5d575f5ffd5b8235610f6881610f35565b91506020830135610f7881610f35565b809150509250929050565b5f60208284031215610f93575f5ffd5b8135610f9e81610f35565b9392505050565b5f5f60408385031215610fb6575f5ffd5b8235610fc181610f35565b946020939093013593505050565b5f60208284031215610fdf575f5ffd5b81518015158114610f9e575f5ffd5b5f60208284031215610ffe575f5ffd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610e2957610e29611005565b5f6001820161103d5761103d611005565b5060010190565b5f60208284031215611054575f5ffd5b8151610f9e81610f35565b8082028115828204841417610e2957610e29611005565b5f8261109057634e487b7160e01b5f52601260045260245ffd5b50049056fe1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e9500a264697066735822122078af341ca97edb006d98f36865c7b67d52500b8a22c1df7c78973f56f4c32ed364736f6c634300081c0033

Deployed Bytecode

0x7307a1539155758c975a6099abc15d1b66a227dbdb30146080604052600436106100a6575f3560e01c8063992a79331161006e578063992a7933146101445780639b19251a146101635780639c7f3315146101825780639f06247b146101a1578063c42cf535146101c0575f5ffd5b80630f147632146100aa578063234823d7146100cb578063320e6840146100ea578063528cfa98146101095780635824780d14610125575b5f5ffd5b8180156100b5575f5ffd5b506100c96100c4366004610f1e565b6101df565b005b8180156100d6575f5ffd5b506100c96100e5366004610f4c565b610265565b8180156100f5575f5ffd5b506100c9610104366004610f83565b610300565b610113620f424081565b60405190815260200160405180910390f35b818015610130575f5ffd5b506100c961013f366004610fa5565b610389565b81801561014f575f5ffd5b506100c961015e366004610f83565b610548565b81801561016e575f5ffd5b506100c961017d366004610f83565b61099d565b81801561018d575f5ffd5b506100c961019c366004610f83565b610a62565b8180156101ac575f5ffd5b506100c96101bb366004610f83565b610b33565b8180156101cb575f5ffd5b506100c96101da366004610f83565b610d7a565b5f5160206110965f395f51905f5281620f424081111561021e57604051630216804b60e61b815260040161021591815260200190565b60405180910390fd5b50600f810154604080519182526020820184905233917fbf0e71132a05dec6f7baee9d3684132ceaf80effcca49bd225f7856604f38f7d910160405180910390a2600f0155565b5f5160206110965f395f51905f5261029d7f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e951584610e0c565b6102a5575f5ffd5b604051632935799f60e21b81526001600160a01b03838116600483015284169063a4d5e67c906024015f604051808303815f87803b1580156102e5575f5ffd5b505af11580156102f7573d5f5f3e3d5ffd5b50505050505050565b5f5f5160206110965f395f51905f52600a810180546001600160a01b0319166001600160a01b03858116918217909255600883015460405162c839a160e61b8152600481019290925292935091169063320e6840906024015f604051808303815f87803b15801561036f575f5ffd5b505af1158015610381573d5f5f3e3d5ffd5b505050505050565b6001600160a01b0382165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f5290839060ff16156103fe5760405163bbfeed9360e01b81526001600160a01b039091166004820152602401610215565b5061040c6013820184610e0c565b83906104375760405163c5491e0f60e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0383165f908152602582016020908152604080832085845290915290205460ff16610543576001600160a01b038084165f9081526018830160205260408120549091169061048d8285610e2f565b90508015610540576001830154600684015460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af11580156104eb573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061050f9190610fcf565b506001600160a01b0385165f90815260258401602090815260408083208784529091529020805460ff191660011790555b50505b505050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f529060ff1680156105a557506105a56013820183610e0c565b82906105d05760405163c5491e0f60e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b038083165f908152602a830160209081526040808320805460ff1916905560188501825280832054602786019092529091205491169060ff161561082357815460408051636373ea6960e01b815290515f926001600160a01b031691636373ea699160048083019260209291908290030181865afa15801561065c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106809190610fee565b835460405163203e180f60e11b81526001600160a01b0385811660048301526024820184905292935091169063407c301e906044015f604051808303815f87803b1580156106cc575f5ffd5b505af11580156106de573d5f5f3e3d5ffd5b50508454604080516341d93a7960e11b815290515f94506001600160a01b0390921692506383b274f29160048083019260209291908290030181865afa15801561072a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074e9190610fcf565b905080156107c0578354600685015460405163270401cb60e01b81526001600160a01b038681166004830152918216602482015291169063270401cb906044015f604051808303815f87803b1580156107a5575f5ffd5b505af11580156107b7573d5f5f3e3d5ffd5b50505050610820565b835460405163270401cb60e01b81526001600160a01b0385811660048301525f60248301529091169063270401cb906044015f604051808303815f87803b158015610809575f5ffd5b505af115801561081b573d5f5f3e3d5ffd5b505050505b50505b6001600160a01b0383165f90815260268301602052604081205490610846610f0b565b90505f825b8281116108df576001600160a01b0387165f908152602587016020908152604080832084845290915290205460ff166108cf575f6108898683610e2f565b90506108958184611019565b925080156108cd576001600160a01b0388165f90815260258801602090815260408083208584529091529020805460ff191660011790555b505b6108d88161102c565b905061084b565b508015610962576001850154600686015460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303815f875af115801561093c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109609190610fcf565b505b6040516001600160a01b038716907f04a5d3f5d80d22d9345acc80618f4a4e7e663cf9e1aed23b57d975acec002ba7905f90a2505050505050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952960205260409020545f5160206110965f395f51905f5290829060ff1615610a12576040516352af0d9160e11b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f818152602983016020526040808220805460ff191660011790555133917f6661a7108aecd07864384529117d96c319c1163e3010c01390f6b704726e07de91a35050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952960205260409020545f5160206110965f395f51905f5290829060ff16610ad657604051630b7b234960e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f818152602983016020908152604091829020805460ff1916905590516001815233917f85abc05b04dbd37a6324d72db47d565d98bfa5cafc40ba85ff9747c857cc4661910160405180910390a35050565b6001600160a01b0381165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e952a60205260409020545f5160206110965f395f51905f529060ff16158015610b915750610b916013820183610e0c565b8290610bbc5760405163bbfeed9360e01b81526001600160a01b039091166004820152602401610215565b506001600160a01b0382165f908152602a820160209081526040808320805460ff191660011790556027840190915290205460ff1615610d43576001600160a01b038281165f90815260188301602052604080822054600b85015491516308a3a6ad60e11b8152908416600482018190529391909116906311474d5a90602401602060405180830381865afa158015610c57573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611044565b835460405163270401cb60e01b81526001600160a01b038581166004830152808416602483015292935091169063270401cb906044015f604051808303815f87803b158015610cc8575f5ffd5b505af1158015610cda573d5f5f3e3d5ffd5b5050845460405163203e180f60e11b81526001600160a01b038681166004830152620f42406024830152909116925063407c301e91506044015f604051808303815f87803b158015610d2a575f5ffd5b505af1158015610d3c573d5f5f3e3d5ffd5b5050505050505b6040516001600160a01b038316907fed18e9faa3dccfd8aa45f69c4de40546b2ca9cccc4538a2323531656516db1aa905f90a25050565b7f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e9506545f5160206110965f395f51905f52906001600160a01b03838116911614610e08576006810180546001600160a01b0319166001600160a01b03841690811790915560405133907f1ba669d4a78521f2ad26e8e0fcbcdd626a63f34d68f326bc232a3abe2a5d042a905f90a35b5050565b6001600160a01b0381165f90815260018301602052604090205415155b92915050565b6001600160a01b0382165f9081527f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e951d602090815260408083208484528252808320547f1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e95229092528220545f5160206110965f395f51905f52918391610eb3919061105f565b610ec590670de0b6b3a764000061105f565b90508015610f00575f848152602383016020526040902054670de0b6b3a764000090610ef19083611076565b610efb9190611076565b610f02565b5f5b95945050505050565b5f610f1962093a8042611076565b905090565b5f60208284031215610f2e575f5ffd5b5035919050565b6001600160a01b0381168114610f49575f5ffd5b50565b5f5f60408385031215610f5d575f5ffd5b8235610f6881610f35565b91506020830135610f7881610f35565b809150509250929050565b5f60208284031215610f93575f5ffd5b8135610f9e81610f35565b9392505050565b5f5f60408385031215610fb6575f5ffd5b8235610fc181610f35565b946020939093013593505050565b5f60208284031215610fdf575f5ffd5b81518015158114610f9e575f5ffd5b5f60208284031215610ffe575f5ffd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610e2957610e29611005565b5f6001820161103d5761103d611005565b5060010190565b5f60208284031215611054575f5ffd5b8151610f9e81610f35565b8082028115828204841417610e2957610e29611005565b5f8261109057634e487b7160e01b5f52601260045260245ffd5b50049056fe1756ff67afd71ca1c6aec4fe909f6cf0de32bed30949be9d2e1860a94e6e9500a264697066735822122078af341ca97edb006d98f36865c7b67d52500b8a22c1df7c78973f56f4c32ed364736f6c634300081c0033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.