MON Price: $0.018383 (+3.30%)

Contract

0x22cB7c9B3225d21521DdC76E490d7603AF0Fc22F

Overview

MON Balance

Monad Chain LogoMonad Chain LogoMonad Chain Logo0 MON

MON Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction and > 10 Token Transfers found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
372730792025-11-22 14:27:3465 days ago1763821654  Contract Creation0 MON
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xF5505532...ABbA75A05
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
TreasurySplitter

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000 runs

Other Settings:
shanghai EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: BUSL-1.1
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {PERCENTAGE_FACTOR} from "@gearbox-protocol/core-v3/contracts/libraries/Constants.sol";

import {ITreasurySplitter} from "../interfaces/ITreasurySplitter.sol";
import {IAddressProvider} from "../interfaces/IAddressProvider.sol";
import {Split, TwoAdminProposal} from "../interfaces/Types.sol";

import {
    AP_TREASURY, AP_TREASURY_PROXY, AP_TREASURY_SPLITTER, NO_VERSION_CONTROL
} from "../libraries/ContractLiterals.sol";

contract TreasurySplitter is ITreasurySplitter {
    using EnumerableSet for EnumerableSet.Bytes32Set;
    using SafeERC20 for IERC20;

    /// @notice Contract version
    uint256 public constant override version = 3_10;

    /// @notice Contract type
    bytes32 public constant override contractType = AP_TREASURY_SPLITTER;

    /// @notice Address of the market admin
    address public immutable override admin;

    /// @notice Address of the Treasury proxy
    address public immutable override treasuryProxy;

    /// @dev Default split for this splitter. Used when no specific split is set for the distributed token.
    Split internal _defaultSplit;

    /// @dev Mapping from token address to the associated split. Used to set specific splits for certain tokens.
    mapping(address token => Split) internal _tokenSplits;

    /// @notice Mapping from token address to the minimal amount kept on the splitter for insurance, before distribution starts
    mapping(address token => uint256) public override tokenInsuranceAmount;

    /// @dev Mapping from proposal calldata hash to whether either of the admins confirmed it
    mapping(bytes32 callDataHash => TwoAdminProposal) internal _proposals;

    /// @dev Set of all active proposals
    EnumerableSet.Bytes32Set internal _activeProposals;

    modifier onlySelf() {
        if (msg.sender != address(this)) revert OnlySelfException();
        _;
    }

    modifier onlyTreasuryProxyOrAdmin() {
        if (msg.sender != admin && msg.sender != treasuryProxy) revert OnlyAdminOrTreasuryProxyException();
        _;
    }

    constructor(address addressProvider_, address admin_, address adminFeeTreasury_) {
        admin = admin_;
        address treasury = IAddressProvider(addressProvider_).getAddressOrRevert(AP_TREASURY, NO_VERSION_CONTROL);
        treasuryProxy = IAddressProvider(addressProvider_).getAddressOrRevert(AP_TREASURY_PROXY, NO_VERSION_CONTROL);

        address[] memory receivers = new address[](2);

        receivers[0] = adminFeeTreasury_;
        receivers[1] = treasury;

        uint16[] memory proportions = new uint16[](2);
        proportions[0] = PERCENTAGE_FACTOR / 2;
        proportions[1] = PERCENTAGE_FACTOR / 2;

        _setSplit(_defaultSplit, receivers, proportions);

        emit SetDefaultSplit(receivers, proportions);
    }

    /// @notice Returns a Split struct for a particular token
    function tokenSplits(address token) external view override returns (Split memory split) {
        return _tokenSplits[token];
    }

    /// @notice Returns the default Split struct
    function defaultSplit() external view override returns (Split memory) {
        return _defaultSplit;
    }

    /// @notice Returns proposal info by hash of its call data
    function getProposal(bytes32 callDataHash) external view override returns (TwoAdminProposal memory) {
        return _proposals[callDataHash];
    }

    /// @notice Returns active proposals
    function activeProposals() external view override returns (TwoAdminProposal[] memory proposals) {
        bytes32[] memory _activeHashes = _activeProposals.values();

        uint256 len = _activeHashes.length;

        proposals = new TwoAdminProposal[](len);

        for (uint256 i = 0; i < len; ++i) {
            proposals[i] = _proposals[_activeHashes[i]];
        }
    }

    /// @notice Distributes any new amount sent to the contract according to either the token-specific or default split.
    /// @param token Token to distribute
    function distribute(address token) external override onlyTreasuryProxyOrAdmin {
        _distribute(token);
    }

    /// @dev Internal function for `distribute`.
    function _distribute(address token) internal {
        Split memory split = _tokenSplits[token].initialized ? _tokenSplits[token] : _defaultSplit;

        uint256 len = split.receivers.length;

        uint256 balance = IERC20(token).balanceOf(address(this));

        uint256 insuranceAmount = tokenInsuranceAmount[token];

        if (balance <= insuranceAmount) return;

        uint256 balanceDiff = balance - insuranceAmount;

        for (uint256 i = 0; i < len; ++i) {
            address receiver = split.receivers[i];
            uint16 proportion = split.proportions[i];

            if (receiver != address(this)) {
                IERC20(token).safeTransfer(receiver, proportion * balanceDiff / PERCENTAGE_FACTOR);
            }
        }

        emit DistributeToken(token, balanceDiff);
    }

    /// @notice Configures parameters for this splitter. Calldata must have a selector for one of the configuration functions.
    function configure(bytes memory callData) external override onlyTreasuryProxyOrAdmin {
        bytes4 selector = bytes4(callData);

        if (
            selector != ITreasurySplitter.setTokenInsuranceAmount.selector
                && selector != ITreasurySplitter.setDefaultSplit.selector
                && selector != ITreasurySplitter.setTokenSplit.selector
                && selector != ITreasurySplitter.withdrawToken.selector
        ) {
            revert IncorrectConfigureSelectorException();
        }

        bytes32 callDataHash = keccak256(callData);

        TwoAdminProposal storage _proposal = _proposals[callDataHash];

        if (!_activeProposals.contains(callDataHash)) {
            _activeProposals.add(callDataHash);
            _proposal.callData = callData;
        }

        if (msg.sender == admin) {
            _proposal.confirmedByAdmin = true;
        } else {
            _proposal.confirmedByTreasuryProxy = true;
        }

        if (_proposal.confirmedByAdmin && _proposal.confirmedByTreasuryProxy) {
            Address.functionCall(address(this), callData);
            _proposal.confirmedByAdmin = false;
            _proposal.confirmedByTreasuryProxy = false;
            _activeProposals.remove(callDataHash);
        }
    }

    /// @notice Cancels an active proposal
    function cancelConfigure(bytes memory callData) external override onlyTreasuryProxyOrAdmin {
        bytes32 callDataHash = keccak256(callData);

        TwoAdminProposal storage _proposal = _proposals[callDataHash];

        _proposal.confirmedByAdmin = false;
        _proposal.confirmedByTreasuryProxy = false;
        _activeProposals.remove(callDataHash);
    }

    /// @notice Sets the insurance amount for a token
    function setTokenInsuranceAmount(address token, uint256 amount) external override onlySelf {
        tokenInsuranceAmount[token] = amount;

        emit SetTokenInsuranceAmount(token, amount);
    }

    /// @notice Sets a split for a specific token
    function setTokenSplit(
        address token,
        address[] memory receivers,
        uint16[] memory proportions,
        bool distributeBefore
    ) external override onlySelf {
        if (distributeBefore) {
            _distribute(token);
        }

        _setSplit(_tokenSplits[token], receivers, proportions);

        emit SetTokenSplit(token, receivers, proportions);
    }

    /// @notice Sets a default split used for tokens that don't have a specific split
    /// @dev All tokens should be distributed manually before calling this, so that
    ///      the new default distribution does not apply to undistributed tokens
    function setDefaultSplit(address[] memory receivers, uint16[] memory proportions) external override onlySelf {
        _setSplit(_defaultSplit, receivers, proportions);

        emit SetDefaultSplit(receivers, proportions);
    }

    /// @dev Internal logic for `setTokenSplit` and `setDefaultSplit`
    function _setSplit(Split storage _split, address[] memory receivers, uint16[] memory proportions) internal {
        uint256 len = proportions.length;

        if (receivers.length != len) revert SplitArraysDifferentLengthException();

        uint256 propSum = 0;

        for (uint256 i = 0; i < len; ++i) {
            if (receivers[i] == address(this)) revert TreasurySplitterAsReceiverException();

            propSum += proportions[i];
        }

        if (propSum != PERCENTAGE_FACTOR) revert PropotionSumIncorrectException();

        _split.initialized = true;
        _split.receivers = receivers;
        _split.proportions = proportions;
    }

    /// @notice Withdraws an amount of a token to another address
    function withdrawToken(address token, address to, uint256 amount) external override onlySelf {
        IERC20(token).safeTransfer(to, amount);

        emit WithdrawToken(token, to, amount);
    }
}

File 2 of 16 : Types.sol
// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

struct AddressProviderEntry {
    bytes32 key;
    uint256 ver;
    address value;
}

struct AuditReport {
    address auditor;
    string reportUrl;
    bytes signature;
}

struct Bytecode {
    bytes32 contractType;
    uint256 version;
    bytes initCode;
    address author;
    string source;
    bytes authorSignature;
}

struct BytecodePointer {
    bytes32 contractType;
    uint256 version;
    address[] initCodePointers;
    address author;
    string source;
    bytes authorSignature;
}

struct Call {
    address target;
    bytes callData;
}

struct ConnectedPriceFeed {
    address token;
    address[] priceFeeds;
}

struct CrossChainCall {
    uint256 chainId; // 0 means to be executed on all chains
    address target;
    bytes callData;
}

struct DeployParams {
    bytes32 postfix;
    bytes32 salt;
    bytes constructorParams;
}

struct DeployResult {
    address newContract;
    Call[] onInstallOps;
}

struct MarketFactories {
    address poolFactory;
    address priceOracleFactory;
    address interestRateModelFactory;
    address rateKeeperFactory;
    address lossPolicyFactory;
}

struct PriceFeedInfo {
    string name;
    uint32 stalenessPeriod;
    bytes32 priceFeedType;
    uint256 version;
}

struct SignedBatch {
    string name;
    bytes32 prevHash;
    CrossChainCall[] calls;
    bytes[] signatures;
}

struct SignedRecoveryModeMessage {
    uint256 chainId;
    bytes32 startingBatchHash;
    bytes[] signatures;
}

struct Split {
    bool initialized;
    address[] receivers;
    uint16[] proportions;
}

struct TwoAdminProposal {
    bytes callData;
    bool confirmedByAdmin;
    bool confirmedByTreasuryProxy;
}

File 3 of 16 : ContractLiterals.sol
// SPDX-License-Identifier: BUSL-1.1
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

uint256 constant NO_VERSION_CONTROL = 0;

// Contract types and prefixes
bytes32 constant AP_ACCOUNT_FACTORY_DEFAULT = "ACCOUNT_FACTORY::DEFAULT";
bytes32 constant AP_ACL = "ACL";
bytes32 constant AP_ADDRESS_PROVIDER = "ADDRESS_PROVIDER";
bytes32 constant AP_BOT_LIST = "BOT_LIST";
bytes32 constant AP_BYTECODE_REPOSITORY = "BYTECODE_REPOSITORY";
bytes32 constant AP_CONTRACTS_REGISTER = "CONTRACTS_REGISTER";
bytes32 constant AP_CREDIT_CONFIGURATOR = "CREDIT_CONFIGURATOR";
bytes32 constant AP_CREDIT_FACADE = "CREDIT_FACADE";
bytes32 constant AP_CREDIT_FACTORY = "CREDIT_FACTORY";
bytes32 constant AP_CREDIT_MANAGER = "CREDIT_MANAGER";
bytes32 constant AP_CROSS_CHAIN_GOVERNANCE = "CROSS_CHAIN_GOVERNANCE";
bytes32 constant AP_CROSS_CHAIN_GOVERNANCE_PROXY = "CROSS_CHAIN_GOVERNANCE_PROXY";
bytes32 constant AP_CROSS_CHAIN_MULTISIG = "CROSS_CHAIN_MULTISIG";
bytes32 constant AP_GEAR_STAKING = "GEAR_STAKING";
bytes32 constant AP_GEAR_TOKEN = "GLOBAL::GEAR_TOKEN";
bytes32 constant AP_GOVERNOR = "GOVERNOR";
bytes32 constant AP_INSTANCE_MANAGER = "INSTANCE_MANAGER";
bytes32 constant AP_INSTANCE_MANAGER_PROXY = "INSTANCE_MANAGER_PROXY";
bytes32 constant AP_INTEREST_RATE_MODEL_DEFAULT = "IRM::DEFAULT";
bytes32 constant AP_INTEREST_RATE_MODEL_FACTORY = "INTEREST_RATE_MODEL_FACTORY";
bytes32 constant AP_INTEREST_RATE_MODEL_LINEAR = "IRM::LINEAR";
bytes32 constant AP_LOSS_POLICY_ALIASED = "LOSS_POLICY::ALIASED";
bytes32 constant AP_LOSS_POLICY_DEFAULT = "LOSS_POLICY::DEFAULT";
bytes32 constant AP_LOSS_POLICY_FACTORY = "LOSS_POLICY_FACTORY";
bytes32 constant AP_MARKET_CONFIGURATOR = "MARKET_CONFIGURATOR";
bytes32 constant AP_MARKET_CONFIGURATOR_FACTORY = "MARKET_CONFIGURATOR_FACTORY";
bytes32 constant AP_MARKET_CONFIGURATOR_LEGACY = "MARKET_CONFIGURATOR::LEGACY";
bytes32 constant AP_POOL = "POOL";
bytes32 constant AP_POOL_FACTORY = "POOL_FACTORY";
bytes32 constant AP_POOL_QUOTA_KEEPER = "POOL_QUOTA_KEEPER";
bytes32 constant AP_PRICE_FEED_STORE = "PRICE_FEED_STORE";
bytes32 constant AP_PRICE_ORACLE = "PRICE_ORACLE";
bytes32 constant AP_PRICE_ORACLE_FACTORY = "PRICE_ORACLE_FACTORY";
bytes32 constant AP_RATE_KEEPER_FACTORY = "RATE_KEEPER_FACTORY";
bytes32 constant AP_RATE_KEEPER_GAUGE = "RATE_KEEPER::GAUGE";
bytes32 constant AP_RATE_KEEPER_TUMBLER = "RATE_KEEPER::TUMBLER";
bytes32 constant AP_TREASURY = "TREASURY";
bytes32 constant AP_TREASURY_PROXY = "TREASURY_PROXY";
bytes32 constant AP_TREASURY_SPLITTER = "TREASURY_SPLITTER";
bytes32 constant AP_WETH_TOKEN = "WETH_TOKEN";
bytes32 constant AP_ZERO_PRICE_FEED = "PRICE_FEED::ZERO";

// Common domains
bytes32 constant DOMAIN_ACCOUNT_FACTORY = "ACCOUNT_FACTORY";
bytes32 constant DOMAIN_ADAPTER = "ADAPTER";
bytes32 constant DOMAIN_BOT = "BOT";
bytes32 constant DOMAIN_CREDIT_MANAGER = "CREDIT_MANAGER";
bytes32 constant DOMAIN_DEGEN_NFT = "DEGEN_NFT";
bytes32 constant DOMAIN_IRM = "IRM";
bytes32 constant DOMAIN_LOSS_POLICY = "LOSS_POLICY";
bytes32 constant DOMAIN_POOL = "POOL";
bytes32 constant DOMAIN_PRICE_FEED = "PRICE_FEED";
bytes32 constant DOMAIN_RATE_KEEPER = "RATE_KEEPER";
bytes32 constant DOMAIN_ZAPPER = "ZAPPER";

// Roles
bytes32 constant ROLE_EMERGENCY_LIQUIDATOR = "EMERGENCY_LIQUIDATOR";
bytes32 constant ROLE_PAUSABLE_ADMIN = "PAUSABLE_ADMIN";
bytes32 constant ROLE_UNPAUSABLE_ADMIN = "UNPAUSABLE_ADMIN";

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

import {IAddressProvider as IAddressProviderBase} from
    "@gearbox-protocol/core-v3/contracts/interfaces/base/IAddressProvider.sol";
import {IVersion} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IVersion.sol";
import {IImmutableOwnableTrait} from "./base/IImmutableOwnableTrait.sol";
import {AddressProviderEntry} from "./Types.sol";

/// @title Address provider interface
interface IAddressProvider is IAddressProviderBase, IVersion, IImmutableOwnableTrait {
    // ------ //
    // EVENTS //
    // ------ //

    event SetAddress(bytes32 indexed key, uint256 indexed ver, address indexed value);

    // ------ //
    // ERRORS //
    // ------ //

    error AddressNotFoundException(bytes32 key, uint256 ver);
    error InvalidVersionException(bytes32 key, uint256 ver);
    error VersionNotFoundException(bytes32 key);
    error ZeroAddressException(bytes32 key);

    // ------- //
    // GETTERS //
    // ------- //

    function getAddress(bytes32 key, uint256 ver) external view returns (address);
    function getAddressOrRevert(bytes32 key, uint256 ver) external view override returns (address);
    function getKeys() external view returns (bytes32[] memory);
    function getVersions(bytes32 key) external view returns (uint256[] memory);
    function getAllEntries() external view returns (AddressProviderEntry[] memory);
    function getLatestVersion(bytes32 key) external view returns (uint256);
    function getLatestMinorVersion(bytes32 key, uint256 majorVersion) external view returns (uint256);
    function getLatestPatchVersion(bytes32 key, uint256 minorVersion) external view returns (uint256);

    // ------------- //
    // CONFIGURATION //
    // ------------- //

    function setAddress(bytes32 key, address value, bool saveVersion) external;
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

import {IVersion} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IVersion.sol";
import {Split, TwoAdminProposal} from "./Types.sol";

/// @title Treasury splitter
interface ITreasurySplitter is IVersion {
    // ------ //
    // ERRORS //
    // ------ //

    /// @notice Thrown when attempting to set a split with different-sized receiver and proportion arrays
    error SplitArraysDifferentLengthException();

    /// @notice Thrown when attempting to set a split that doesn't have proportions summing to 1
    error PropotionSumIncorrectException();

    /// @notice Thrown when attempting to distribute a token for which a split is not defined
    error UndefinedSplitException();

    /// @notice Thrown when a restricted function is called by non-multisig address
    error OnlySelfException();

    /// @notice Thrown when a restricted function is called not by admin or treasury proxy
    error OnlyAdminOrTreasuryProxyException();

    /// @notice Thrown when attempting to call a configure function with an incorrect selector
    error IncorrectConfigureSelectorException();

    /// @notice Thrown when attempting the add the splitter itself as split receiver
    error TreasurySplitterAsReceiverException();

    // ------ //
    // EVENTS //
    // ------ //

    /// @notice Emitted when a new default split is set
    event SetDefaultSplit(address[] receivers, uint16[] proportions);

    /// @notice Emitted when a new token-specific split is set
    event SetTokenSplit(address indexed token, address[] receivers, uint16[] proportions);

    /// @notice Emitted whan a token is withdrawn to another address
    event WithdrawToken(address indexed token, address indexed to, uint256 withdrawnAmount);

    /// @notice Emitted when tokens are distributed
    event DistributeToken(address indexed token, uint256 distributedAmount);

    /// @notice Emitted when setting a new token insurance amount
    event SetTokenInsuranceAmount(address indexed token, uint256 amount);

    // --------------- //
    // STATE VARIABLES //
    // --------------- //

    function admin() external view returns (address);

    function treasuryProxy() external view returns (address);

    function tokenSplits(address token) external view returns (Split memory);

    function defaultSplit() external view returns (Split memory);

    function tokenInsuranceAmount(address token) external view returns (uint256);

    function getProposal(bytes32 callDataHash) external view returns (TwoAdminProposal memory);

    function activeProposals() external view returns (TwoAdminProposal[] memory);

    // ------------- //
    // CONFIGURATION //
    // ------------- //

    function distribute(address token) external;

    function configure(bytes memory callData) external;

    function cancelConfigure(bytes memory callData) external;

    // ------------- //
    // SELF-CALLABLE //
    // ------------- //

    function setTokenInsuranceAmount(address token, uint256 amount) external;

    function setTokenSplit(address token, address[] memory receivers, uint16[] memory proportions, bool distribute)
        external;

    function setDefaultSplit(address[] memory receivers, uint16[] memory proportions) external;

    function withdrawToken(address token, address to, uint256 amount) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

File 10 of 16 : IImmutableOwnableTrait.sol
// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

/// @title Immutable ownable trait interface
/// @notice Interface for contracts with immutable owner functionality
interface IImmutableOwnableTrait {
    error CallerIsNotOwnerException(address caller);

    /// @notice Returns the immutable owner address
    function owner() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @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 of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @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._indexes[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 read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 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 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

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

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

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

            // Delete the index for the deleted slot
            delete set._indexes[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._indexes[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;

        /// @solidity memory-safe-assembly
        assembly {
            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;

        /// @solidity memory-safe-assembly
        assembly {
            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;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 13 of 16 : Constants.sol
// SPDX-License-Identifier: BUSL-1.1
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.17;

bytes32 constant AP_GEAR_TOKEN = "GLOBAL::GEAR_TOKEN";
bytes32 constant AP_INSTANCE_MANAGER_PROXY = "INSTANCE_MANAGER_PROXY";
bytes32 constant AP_CROSS_CHAIN_GOVERNANCE_PROXY = "CROSS_CHAIN_GOVERNANCE_PROXY";
bytes32 constant AP_PRICE_FEED_STORE = "PRICE_FEED_STORE";
uint256 constant NO_VERSION_CONTROL = 0;

uint256 constant WAD = 1e18;
uint256 constant RAY = 1e27;
uint16 constant PERCENTAGE_FACTOR = 1e4;

uint256 constant SECONDS_PER_YEAR = 365 days;
uint256 constant EPOCH_LENGTH = 7 days;
uint256 constant FIRST_EPOCH_TIMESTAMP = 1702900800;
uint256 constant EPOCHS_TO_WITHDRAW = 4;

uint8 constant MAX_SANE_ENABLED_TOKENS = 20;
uint256 constant MAX_SANE_EPOCH_LENGTH = 28 days;
uint256 constant MAX_SANE_ACTIVE_BOTS = 5;

uint8 constant MAX_WITHDRAW_FEE = 100;

uint8 constant DEFAULT_LIMIT_PER_BLOCK_MULTIPLIER = 2;

uint8 constant BOT_PERMISSIONS_SET_FLAG = 1;

uint256 constant UNDERLYING_TOKEN_MASK = 1;

address constant INACTIVE_CREDIT_ACCOUNT_ADDRESS = address(1);

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.17;

/// @title Version interface
/// @notice Defines contract version and type
interface IVersion {
    /// @notice Contract version
    function version() external view returns (uint256);

    /// @notice Contract type
    function contractType() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.17;

interface IAddressProvider {
    function getAddressOrRevert(bytes32 key, uint256 version) external view returns (address);
}

Settings
{
  "remappings": [
    "@1inch/=lib/@1inch/",
    "@gearbox-protocol/=lib/@gearbox-protocol/",
    "@openzeppelin/=lib/@openzeppelin/",
    "@redstone-finance/=node_modules/@redstone-finance/",
    "@solady/=lib/@solady/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/@openzeppelin/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin/=lib/@openzeppelin/contracts/"
  ],
  "optimizer": {
    "runs": 1000,
    "enabled": true
  },
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "evmVersion": "shanghai",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"addressProvider_","type":"address"},{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address","name":"adminFeeTreasury_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"IncorrectConfigureSelectorException","type":"error"},{"inputs":[],"name":"OnlyAdminOrTreasuryProxyException","type":"error"},{"inputs":[],"name":"OnlySelfException","type":"error"},{"inputs":[],"name":"PropotionSumIncorrectException","type":"error"},{"inputs":[],"name":"SplitArraysDifferentLengthException","type":"error"},{"inputs":[],"name":"TreasurySplitterAsReceiverException","type":"error"},{"inputs":[],"name":"UndefinedSplitException","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"distributedAmount","type":"uint256"}],"name":"DistributeToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint16[]","name":"proportions","type":"uint16[]"}],"name":"SetDefaultSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SetTokenInsuranceAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint16[]","name":"proportions","type":"uint16[]"}],"name":"SetTokenSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawnAmount","type":"uint256"}],"name":"WithdrawToken","type":"event"},{"inputs":[],"name":"activeProposals","outputs":[{"components":[{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bool","name":"confirmedByAdmin","type":"bool"},{"internalType":"bool","name":"confirmedByTreasuryProxy","type":"bool"}],"internalType":"struct TwoAdminProposal[]","name":"proposals","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"cancelConfigure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"configure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultSplit","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint16[]","name":"proportions","type":"uint16[]"}],"internalType":"struct Split","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"callDataHash","type":"bytes32"}],"name":"getProposal","outputs":[{"components":[{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bool","name":"confirmedByAdmin","type":"bool"},{"internalType":"bool","name":"confirmedByTreasuryProxy","type":"bool"}],"internalType":"struct TwoAdminProposal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint16[]","name":"proportions","type":"uint16[]"}],"name":"setDefaultSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setTokenInsuranceAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint16[]","name":"proportions","type":"uint16[]"},{"internalType":"bool","name":"distributeBefore","type":"bool"}],"name":"setTokenSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"tokenInsuranceAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"tokenSplits","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint16[]","name":"proportions","type":"uint16[]"}],"internalType":"struct Split","name":"split","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x60c060405234801562000010575f80fd5b506040516200268d3803806200268d83398101604081905262000033916200050a565b6001600160a01b03828116608052604051632bdad0e360e11b815267545245415355525960c01b60048201525f60248201819052918516906357b5a1c690604401602060405180830381865afa15801562000090573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620000b6919062000551565b604051632bdad0e360e11b81526d54524541535552595f50524f585960901b60048201525f60248201529091506001600160a01b038516906357b5a1c690604401602060405180830381865afa15801562000113573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000139919062000551565b6001600160a01b031660a0526040805160028082526060820183525f9260208301908036833701905050905082815f815181106200017b576200017b62000574565b60200260200101906001600160a01b031690816001600160a01b0316815250508181600181518110620001b257620001b262000574565b6001600160a01b03929092166020928302919091018201526040805160028082526060820183525f939192909183019080368337019050509050620001fb600261271062000588565b815f8151811062000210576200021062000574565b61ffff9092166020928302919091019091015262000232600261271062000588565b8160018151811062000248576200024862000574565b61ffff90921660209283029190910190910152620002685f8383620002af565b7f3f14cafe803c0b803a94bf6989e0bfcb09bce73858c7a69312c280868c4034c382826040516200029b929190620005b5565b60405180910390a150505050505062000665565b805182518114620002d357604051633f07c7f560e01b815260040160405180910390fd5b5f805b828110156200036757306001600160a01b0316858281518110620002fe57620002fe62000574565b60200260200101516001600160a01b0316036200032e576040516335aed15960e11b815260040160405180910390fd5b83818151811062000343576200034362000574565b602002602001015161ffff16826200035c91906200063f565b9150600101620002d6565b5061271081146200038b576040516309eaf27f60e31b815260040160405180910390fd5b845460ff1916600190811786558451620003ad918701906020870190620003cd565b508251620003c5906002870190602086019062000435565b505050505050565b828054828255905f5260205f2090810192821562000423579160200282015b828111156200042357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620003ec565b5062000431929150620004d8565b5090565b828054828255905f5260205f2090600f0160109004810192821562000423579160200282015f5b838211156200049e57835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026200045c565b8015620004ce5782816101000a81549061ffff02191690556002016020816001010492830192600103026200049e565b5050620004319291505b5b8082111562000431575f8155600101620004d9565b80516001600160a01b038116811462000505575f80fd5b919050565b5f805f606084860312156200051d575f80fd5b6200052884620004ee565b92506200053860208501620004ee565b91506200054860408501620004ee565b90509250925092565b5f6020828403121562000562575f80fd5b6200056d82620004ee565b9392505050565b634e487b7160e01b5f52603260045260245ffd5b5f61ffff80841680620005a957634e487b7160e01b5f52601260045260245ffd5b92169190910492915050565b604080825283519082018190525f906020906060840190828701845b82811015620005f85781516001600160a01b031684529284019290840190600101620005d1565b505050838103828501528451808252858301918301905f5b818110156200063257835161ffff168352928401929184019160010162000610565b5090979650505050505050565b808201808211156200065f57634e487b7160e01b5f52601160045260245ffd5b92915050565b60805160a051611fd5620006b85f395f81816101c7015281816106a3015281816108440152610abb01525f818161028d0152818161066f01528181610810015281816109e30152610a870152611fd55ff3fe608060405234801561000f575f80fd5b50600436106100fb575f3560e01c80635d978826116100935780639aff53ee116100635780639aff53ee14610246578063cb2ef6f71461024e578063dfea329a14610275578063f851a44014610288575f80fd5b80635d978826146101c25780635e2ebde91461020157806363453ae1146102205780637203fdda14610233575f80fd5b80633ae65ac3116100ce5780633ae65ac314610165578063430694cf1461017857806346739e731461019857806354fd4d50146101ab575f80fd5b806301e33667146100ff578063109c3d2714610114578063311cd4601461013257806333db5ca514610152575b5f80fd5b61011261010d3660046117cf565b6102af565b005b61011c610335565b604051610129919061188d565b60405180910390f35b6101456101403660046118ef565b6104c8565b6040516101299190611946565b610112610160366004611b0d565b6105fc565b610112610173366004611b6d565b610664565b61018b610186366004611bfc565b61071b565b6040516101299190611c13565b6101126101a6366004611b6d565b610805565b6101b461013681565b604051908152602001610129565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610129565b6101b461020f3660046118ef565b60046020525f908152604090205481565b61011261022e3660046118ef565b610a7c565b610112610241366004611c32565b610b08565b610145610ba2565b6101b47f54524541535552595f53504c495454455200000000000000000000000000000081565b610112610283366004611cb4565b610cbe565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b3330146102cf57604051635f096c9b60e11b815260040160405180910390fd5b6102e36001600160a01b0384168383610d36565b816001600160a01b0316836001600160a01b03167f037238854fe57fbf51f09946f854fc3916fe83938d6521f09bd05463839f13048360405161032891815260200190565b60405180910390a3505050565b60605f6103426006610dbb565b80519091508067ffffffffffffffff811115610360576103606119c7565b6040519080825280602002602001820160405280156103a957816020015b604080516060808201835281525f60208083018290529282015282525f1990920191018161037e5790505b5092505f5b818110156104c25760055f8483815181106103cb576103cb611cdc565b602002602001015181526020019081526020015f206040518060600160405290815f820180546103fa90611cf0565b80601f016020809104026020016040519081016040528092919081815260200182805461042690611cf0565b80156104715780601f1061044857610100808354040283529160200191610471565b820191905f5260205f20905b81548152906001019060200180831161045457829003601f168201915b50505091835250506001919091015460ff8082161515602084015261010090910416151560409091015284518590839081106104af576104af611cdc565b60209081029190910101526001016103ae565b50505090565b6104ed60405180606001604052805f1515815260200160608152602001606081525090565b6001600160a01b0382165f908152600360209081526040918290208251606081018452815460ff16151581526001820180548551818602810186019096528086529194929385810193929083018282801561056f57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610551575b50505050508152602001600282018054806020026020016040519081016040528092919081815260200182805480156105ec57602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116105b35790505b5050505050815250509050919050565b33301461061c57604051635f096c9b60e11b815260040160405180910390fd5b6106275f8383610dce565b7f3f14cafe803c0b803a94bf6989e0bfcb09bce73858c7a69312c280868c4034c38282604051610658929190611d28565b60405180910390a15050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906106c65750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b156106e45760405163ab85e89360e01b815260040160405180910390fd5b80516020808301919091205f8181526005909252604090912060018101805461ffff19169055610715600683610f26565b50505050565b604080516060808201835281525f60208201819052918101919091525f828152600560205260409081902081516060810190925280548290829061075e90611cf0565b80601f016020809104026020016040519081016040528092919081815260200182805461078a90611cf0565b80156107d55780601f106107ac576101008083540402835291602001916107d5565b820191905f5260205f20905b8154815290600101906020018083116107b857829003601f168201915b50505091835250506001919091015460ff8082161515602084015261010090910416151560409091015292915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906108675750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b156108855760405163ab85e89360e01b815260040160405180910390fd5b5f61088f82611dae565b90506001600160e01b031981167fdfea329a00000000000000000000000000000000000000000000000000000000148015906108f557506001600160e01b031981167f33db5ca50000000000000000000000000000000000000000000000000000000014155b801561092b57506001600160e01b031981167f7203fdda0000000000000000000000000000000000000000000000000000000014155b801561096157506001600160e01b031981167f01e336670000000000000000000000000000000000000000000000000000000014155b15610998576040517fcab248b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516020808401919091205f818152600590925260409091206109bc600683610f3a565b6109d9576109cb600683610f51565b50806109d78582611e29565b505b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610a1e576001818101805460ff19169091179055610a30565b60018101805461ff0019166101001790555b600181015460ff168015610a4d57506001810154610100900460ff165b1561071557610a5c3085610f5c565b5060018101805461ffff19169055610a75600683610f26565b5050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801590610ade5750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b15610afc5760405163ab85e89360e01b815260040160405180910390fd5b610b0581610f9f565b50565b333014610b2857604051635f096c9b60e11b815260040160405180910390fd5b8015610b3757610b3784610f9f565b6001600160a01b0384165f908152600360205260409020610b59908484610dce565b836001600160a01b03167fce6b2553a624c7d10d718b9947147cccc7849d16501e376eef8b989ce764233f8484604051610b94929190611d28565b60405180910390a250505050565b610bc760405180606001604052805f1515815260200160608152602001606081525090565b604080516060810182525f805460ff1615158252600180548451602082810282018101909652818152939492938386019390929190830182828015610c3357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610c15575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015610cb057602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610c775790505b505050505081525050905090565b333014610cde57604051635f096c9b60e11b815260040160405180910390fd5b6001600160a01b0382165f8181526004602052604090819020839055517fcb715e08eeb0b8525fec2caec324a9d8479025113aa7e4f839c176ff1ac8341a90610d2a9084815260200190565b60405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610db690849061127a565b505050565b60605f610dc783611365565b9392505050565b805182518114610e0a576040517f3f07c7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805b82811015610eac57306001600160a01b0316858281518110610e3157610e31611cdc565b60200260200101516001600160a01b031603610e79576040517f6b5da2b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838181518110610e8b57610e8b611cdc565b602002602001015161ffff1682610ea29190611ef9565b9150600101610e0d565b506127108114610ee8576040517f4f5793f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845460ff1916600190811786558451610f08918701906020870190611688565b508251610f1e9060028701906020860190611703565b505050505050565b5f610f3183836113be565b90505b92915050565b5f8181526001830160205260408120541515610f31565b5f610f3183836114a1565b6060610f3183835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506114ed565b6001600160a01b0381165f9081526003602052604081205460ff16610fc4575f610fdc565b6001600160a01b0382165f9081526003602052604090205b60408051606081018252825460ff161515815260018301805483516020828102820181019095528181529294938086019392919083018282801561104757602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611029575b50505050508152602001600282018054806020026020016040519081016040528092919081815260200182805480156110c457602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161108b5790505b505050919092525050506020810151516040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250905f906001600160a01b038516906370a0823190602401602060405180830381865afa158015611135573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111599190611f0c565b6001600160a01b0385165f90815260046020526040902054909150808211611182575050505050565b5f61118d8284611f23565b90505f5b8481101561122e575f866020015182815181106111b0576111b0611cdc565b602002602001015190505f876040015183815181106111d1576111d1611cdc565b60200260200101519050306001600160a01b0316826001600160a01b03161461122457611224826127106112098761ffff8616611f36565b6112139190611f4d565b6001600160a01b038c169190610d36565b5050600101611191565b50856001600160a01b03167f8e303f84fe3357e09112a03b39540286c13cbd04593711fe74fbce4d3233f3838260405161126a91815260200190565b60405180910390a2505050505050565b5f6112ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115dd9092919063ffffffff16565b905080515f14806112ee5750808060200190518101906112ee9190611f6c565b610db65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6060815f018054806020026020016040519081016040528092919081815260200182805480156113b257602002820191905f5260205f20905b81548152602001906001019080831161139e575b50505050509050919050565b5f8181526001830160205260408120548015611498575f6113e0600183611f23565b85549091505f906113f390600190611f23565b9050818114611452575f865f01828154811061141157611411611cdc565b905f5260205f200154905080875f01848154811061143157611431611cdc565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061146357611463611f87565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610f34565b5f915050610f34565b5f8181526001830160205260408120546114e657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610f34565b505f610f34565b6060824710156115655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161135c565b5f80866001600160a01b031685876040516115809190611f9b565b5f6040518083038185875af1925050503d805f81146115ba576040519150601f19603f3d011682016040523d82523d5f602084013e6115bf565b606091505b50915091506115d0878383876115eb565b925050505b949350505050565b60606115d584845f856114ed565b606083156116595782515f03611652576001600160a01b0385163b6116525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161135c565b50816115d5565b6115d5838381511561166e5781518083602001fd5b8060405162461bcd60e51b815260040161135c9190611fb6565b828054828255905f5260205f209081019282156116f3579160200282015b828111156116f357825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039091161782556020909201916001909101906116a6565b506116ff9291506117a0565b5090565b828054828255905f5260205f2090600f016010900481019282156116f3579160200282015f5b8382111561176957835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611729565b80156117975782816101000a81549061ffff0219169055600201602081600101049283019260010302611769565b50506116ff9291505b5b808211156116ff575f81556001016117a1565b80356001600160a01b03811681146117ca575f80fd5b919050565b5f805f606084860312156117e1575f80fd5b6117ea846117b4565b92506117f8602085016117b4565b9150604084013590509250925092565b5f5b8381101561182257818101518382015260200161180a565b50505f910152565b5f8151808452611841816020860160208601611808565b601f01601f19169290920160200192915050565b5f815160608452611869606085018261182a565b90506020830151151560208501526040830151151560408501528091505092915050565b5f60208083016020845280855180835260408601915060408160051b8701019250602087015f5b828110156118e257603f198886030184526118d0858351611855565b945092850192908501906001016118b4565b5092979650505050505050565b5f602082840312156118ff575f80fd5b610f31826117b4565b5f815180845260208085019450602084015f5b8381101561193b57815161ffff168752958201959082019060010161191b565b509495945050505050565b6020808252825115158282015282810151606060408401528051608084018190525f9291820190839060a08601905b8083101561199e5783516001600160a01b03168252928401926001929092019190840190611975565b506040870151868203601f1901606088015293506119bc8185611908565b979650505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611a0457611a046119c7565b604052919050565b5f67ffffffffffffffff821115611a2557611a256119c7565b5060051b60200190565b5f82601f830112611a3e575f80fd5b81356020611a53611a4e83611a0c565b6119db565b8083825260208201915060208460051b870101935086841115611a74575f80fd5b602086015b84811015611a9757611a8a816117b4565b8352918301918301611a79565b509695505050505050565b5f82601f830112611ab1575f80fd5b81356020611ac1611a4e83611a0c565b8083825260208201915060208460051b870101935086841115611ae2575f80fd5b602086015b84811015611a9757803561ffff81168114611b00575f80fd5b8352918301918301611ae7565b5f8060408385031215611b1e575f80fd5b823567ffffffffffffffff80821115611b35575f80fd5b611b4186838701611a2f565b93506020850135915080821115611b56575f80fd5b50611b6385828601611aa2565b9150509250929050565b5f6020808385031215611b7e575f80fd5b823567ffffffffffffffff80821115611b95575f80fd5b818501915085601f830112611ba8575f80fd5b813581811115611bba57611bba6119c7565b611bcc601f8201601f191685016119db565b91508082528684828501011115611be1575f80fd5b80848401858401375f90820190930192909252509392505050565b5f60208284031215611c0c575f80fd5b5035919050565b602081525f610f316020830184611855565b8015158114610b05575f80fd5b5f805f8060808587031215611c45575f80fd5b611c4e856117b4565b9350602085013567ffffffffffffffff80821115611c6a575f80fd5b611c7688838901611a2f565b94506040870135915080821115611c8b575f80fd5b50611c9887828801611aa2565b9250506060850135611ca981611c25565b939692955090935050565b5f8060408385031215611cc5575f80fd5b611cce836117b4565b946020939093013593505050565b634e487b7160e01b5f52603260045260245ffd5b600181811c90821680611d0457607f821691505b602082108103611d2257634e487b7160e01b5f52602260045260245ffd5b50919050565b604080825283519082018190525f906020906060840190828701845b82811015611d695781516001600160a01b031684529284019290840190600101611d44565b505050838103828501528451808252858301918301905f5b81811015611da157835161ffff1683529284019291840191600101611d81565b5090979650505050505050565b5f815160208301516001600160e01b031980821693506004831015611ddd5780818460040360031b1b83161693505b505050919050565b601f821115610db657805f5260205f20601f840160051c81016020851015611e0a5750805b601f840160051c820191505b81811015610a75575f8155600101611e16565b815167ffffffffffffffff811115611e4357611e436119c7565b611e5781611e518454611cf0565b84611de5565b602080601f831160018114611e8a575f8415611e735750858301515b5f19600386901b1c1916600185901b178555610f1e565b5f85815260208120601f198616915b82811015611eb857888601518255948401946001909101908401611e99565b5085821015611ed557878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610f3457610f34611ee5565b5f60208284031215611f1c575f80fd5b5051919050565b81810381811115610f3457610f34611ee5565b8082028115828204841417610f3457610f34611ee5565b5f82611f6757634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611f7c575f80fd5b8151610dc781611c25565b634e487b7160e01b5f52603160045260245ffd5b5f8251611fac818460208701611808565b9190910192915050565b602081525f610f31602083018461182a56fea164736f6c6343000817000a000000000000000000000000f7f0a609bfab9a0a98786951ef10e5fe26cc1e3800000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b0000000000000000000000006cc7e7757f254c9670df3d72cdc1f931fcfdd662

Deployed Bytecode

0x608060405234801561000f575f80fd5b50600436106100fb575f3560e01c80635d978826116100935780639aff53ee116100635780639aff53ee14610246578063cb2ef6f71461024e578063dfea329a14610275578063f851a44014610288575f80fd5b80635d978826146101c25780635e2ebde91461020157806363453ae1146102205780637203fdda14610233575f80fd5b80633ae65ac3116100ce5780633ae65ac314610165578063430694cf1461017857806346739e731461019857806354fd4d50146101ab575f80fd5b806301e33667146100ff578063109c3d2714610114578063311cd4601461013257806333db5ca514610152575b5f80fd5b61011261010d3660046117cf565b6102af565b005b61011c610335565b604051610129919061188d565b60405180910390f35b6101456101403660046118ef565b6104c8565b6040516101299190611946565b610112610160366004611b0d565b6105fc565b610112610173366004611b6d565b610664565b61018b610186366004611bfc565b61071b565b6040516101299190611c13565b6101126101a6366004611b6d565b610805565b6101b461013681565b604051908152602001610129565b6101e97f00000000000000000000000002e0371f10a99c841b68758492f9ee1a7fe16df281565b6040516001600160a01b039091168152602001610129565b6101b461020f3660046118ef565b60046020525f908152604090205481565b61011261022e3660046118ef565b610a7c565b610112610241366004611c32565b610b08565b610145610ba2565b6101b47f54524541535552595f53504c495454455200000000000000000000000000000081565b610112610283366004611cb4565b610cbe565b6101e97f00000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b81565b3330146102cf57604051635f096c9b60e11b815260040160405180910390fd5b6102e36001600160a01b0384168383610d36565b816001600160a01b0316836001600160a01b03167f037238854fe57fbf51f09946f854fc3916fe83938d6521f09bd05463839f13048360405161032891815260200190565b60405180910390a3505050565b60605f6103426006610dbb565b80519091508067ffffffffffffffff811115610360576103606119c7565b6040519080825280602002602001820160405280156103a957816020015b604080516060808201835281525f60208083018290529282015282525f1990920191018161037e5790505b5092505f5b818110156104c25760055f8483815181106103cb576103cb611cdc565b602002602001015181526020019081526020015f206040518060600160405290815f820180546103fa90611cf0565b80601f016020809104026020016040519081016040528092919081815260200182805461042690611cf0565b80156104715780601f1061044857610100808354040283529160200191610471565b820191905f5260205f20905b81548152906001019060200180831161045457829003601f168201915b50505091835250506001919091015460ff8082161515602084015261010090910416151560409091015284518590839081106104af576104af611cdc565b60209081029190910101526001016103ae565b50505090565b6104ed60405180606001604052805f1515815260200160608152602001606081525090565b6001600160a01b0382165f908152600360209081526040918290208251606081018452815460ff16151581526001820180548551818602810186019096528086529194929385810193929083018282801561056f57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610551575b50505050508152602001600282018054806020026020016040519081016040528092919081815260200182805480156105ec57602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116105b35790505b5050505050815250509050919050565b33301461061c57604051635f096c9b60e11b815260040160405180910390fd5b6106275f8383610dce565b7f3f14cafe803c0b803a94bf6989e0bfcb09bce73858c7a69312c280868c4034c38282604051610658929190611d28565b60405180910390a15050565b336001600160a01b037f00000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b16148015906106c65750336001600160a01b037f00000000000000000000000002e0371f10a99c841b68758492f9ee1a7fe16df21614155b156106e45760405163ab85e89360e01b815260040160405180910390fd5b80516020808301919091205f8181526005909252604090912060018101805461ffff19169055610715600683610f26565b50505050565b604080516060808201835281525f60208201819052918101919091525f828152600560205260409081902081516060810190925280548290829061075e90611cf0565b80601f016020809104026020016040519081016040528092919081815260200182805461078a90611cf0565b80156107d55780601f106107ac576101008083540402835291602001916107d5565b820191905f5260205f20905b8154815290600101906020018083116107b857829003601f168201915b50505091835250506001919091015460ff8082161515602084015261010090910416151560409091015292915050565b336001600160a01b037f00000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b16148015906108675750336001600160a01b037f00000000000000000000000002e0371f10a99c841b68758492f9ee1a7fe16df21614155b156108855760405163ab85e89360e01b815260040160405180910390fd5b5f61088f82611dae565b90506001600160e01b031981167fdfea329a00000000000000000000000000000000000000000000000000000000148015906108f557506001600160e01b031981167f33db5ca50000000000000000000000000000000000000000000000000000000014155b801561092b57506001600160e01b031981167f7203fdda0000000000000000000000000000000000000000000000000000000014155b801561096157506001600160e01b031981167f01e336670000000000000000000000000000000000000000000000000000000014155b15610998576040517fcab248b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516020808401919091205f818152600590925260409091206109bc600683610f3a565b6109d9576109cb600683610f51565b50806109d78582611e29565b505b6001600160a01b037f00000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b163303610a1e576001818101805460ff19169091179055610a30565b60018101805461ff0019166101001790555b600181015460ff168015610a4d57506001810154610100900460ff165b1561071557610a5c3085610f5c565b5060018101805461ffff19169055610a75600683610f26565b5050505050565b336001600160a01b037f00000000000000000000000095a61383a024238ddad218c6de71a2adc3fd954b1614801590610ade5750336001600160a01b037f00000000000000000000000002e0371f10a99c841b68758492f9ee1a7fe16df21614155b15610afc5760405163ab85e89360e01b815260040160405180910390fd5b610b0581610f9f565b50565b333014610b2857604051635f096c9b60e11b815260040160405180910390fd5b8015610b3757610b3784610f9f565b6001600160a01b0384165f908152600360205260409020610b59908484610dce565b836001600160a01b03167fce6b2553a624c7d10d718b9947147cccc7849d16501e376eef8b989ce764233f8484604051610b94929190611d28565b60405180910390a250505050565b610bc760405180606001604052805f1515815260200160608152602001606081525090565b604080516060810182525f805460ff1615158252600180548451602082810282018101909652818152939492938386019390929190830182828015610c3357602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311610c15575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015610cb057602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610c775790505b505050505081525050905090565b333014610cde57604051635f096c9b60e11b815260040160405180910390fd5b6001600160a01b0382165f8181526004602052604090819020839055517fcb715e08eeb0b8525fec2caec324a9d8479025113aa7e4f839c176ff1ac8341a90610d2a9084815260200190565b60405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610db690849061127a565b505050565b60605f610dc783611365565b9392505050565b805182518114610e0a576040517f3f07c7f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805b82811015610eac57306001600160a01b0316858281518110610e3157610e31611cdc565b60200260200101516001600160a01b031603610e79576040517f6b5da2b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838181518110610e8b57610e8b611cdc565b602002602001015161ffff1682610ea29190611ef9565b9150600101610e0d565b506127108114610ee8576040517f4f5793f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845460ff1916600190811786558451610f08918701906020870190611688565b508251610f1e9060028701906020860190611703565b505050505050565b5f610f3183836113be565b90505b92915050565b5f8181526001830160205260408120541515610f31565b5f610f3183836114a1565b6060610f3183835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506114ed565b6001600160a01b0381165f9081526003602052604081205460ff16610fc4575f610fdc565b6001600160a01b0382165f9081526003602052604090205b60408051606081018252825460ff161515815260018301805483516020828102820181019095528181529294938086019392919083018282801561104757602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611029575b50505050508152602001600282018054806020026020016040519081016040528092919081815260200182805480156110c457602002820191905f5260205f20905f905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161108b5790505b505050919092525050506020810151516040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250905f906001600160a01b038516906370a0823190602401602060405180830381865afa158015611135573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111599190611f0c565b6001600160a01b0385165f90815260046020526040902054909150808211611182575050505050565b5f61118d8284611f23565b90505f5b8481101561122e575f866020015182815181106111b0576111b0611cdc565b602002602001015190505f876040015183815181106111d1576111d1611cdc565b60200260200101519050306001600160a01b0316826001600160a01b03161461122457611224826127106112098761ffff8616611f36565b6112139190611f4d565b6001600160a01b038c169190610d36565b5050600101611191565b50856001600160a01b03167f8e303f84fe3357e09112a03b39540286c13cbd04593711fe74fbce4d3233f3838260405161126a91815260200190565b60405180910390a2505050505050565b5f6112ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115dd9092919063ffffffff16565b905080515f14806112ee5750808060200190518101906112ee9190611f6c565b610db65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6060815f018054806020026020016040519081016040528092919081815260200182805480156113b257602002820191905f5260205f20905b81548152602001906001019080831161139e575b50505050509050919050565b5f8181526001830160205260408120548015611498575f6113e0600183611f23565b85549091505f906113f390600190611f23565b9050818114611452575f865f01828154811061141157611411611cdc565b905f5260205f200154905080875f01848154811061143157611431611cdc565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061146357611463611f87565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610f34565b5f915050610f34565b5f8181526001830160205260408120546114e657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610f34565b505f610f34565b6060824710156115655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161135c565b5f80866001600160a01b031685876040516115809190611f9b565b5f6040518083038185875af1925050503d805f81146115ba576040519150601f19603f3d011682016040523d82523d5f602084013e6115bf565b606091505b50915091506115d0878383876115eb565b925050505b949350505050565b60606115d584845f856114ed565b606083156116595782515f03611652576001600160a01b0385163b6116525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161135c565b50816115d5565b6115d5838381511561166e5781518083602001fd5b8060405162461bcd60e51b815260040161135c9190611fb6565b828054828255905f5260205f209081019282156116f3579160200282015b828111156116f357825182547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039091161782556020909201916001909101906116a6565b506116ff9291506117a0565b5090565b828054828255905f5260205f2090600f016010900481019282156116f3579160200282015f5b8382111561176957835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611729565b80156117975782816101000a81549061ffff0219169055600201602081600101049283019260010302611769565b50506116ff9291505b5b808211156116ff575f81556001016117a1565b80356001600160a01b03811681146117ca575f80fd5b919050565b5f805f606084860312156117e1575f80fd5b6117ea846117b4565b92506117f8602085016117b4565b9150604084013590509250925092565b5f5b8381101561182257818101518382015260200161180a565b50505f910152565b5f8151808452611841816020860160208601611808565b601f01601f19169290920160200192915050565b5f815160608452611869606085018261182a565b90506020830151151560208501526040830151151560408501528091505092915050565b5f60208083016020845280855180835260408601915060408160051b8701019250602087015f5b828110156118e257603f198886030184526118d0858351611855565b945092850192908501906001016118b4565b5092979650505050505050565b5f602082840312156118ff575f80fd5b610f31826117b4565b5f815180845260208085019450602084015f5b8381101561193b57815161ffff168752958201959082019060010161191b565b509495945050505050565b6020808252825115158282015282810151606060408401528051608084018190525f9291820190839060a08601905b8083101561199e5783516001600160a01b03168252928401926001929092019190840190611975565b506040870151868203601f1901606088015293506119bc8185611908565b979650505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611a0457611a046119c7565b604052919050565b5f67ffffffffffffffff821115611a2557611a256119c7565b5060051b60200190565b5f82601f830112611a3e575f80fd5b81356020611a53611a4e83611a0c565b6119db565b8083825260208201915060208460051b870101935086841115611a74575f80fd5b602086015b84811015611a9757611a8a816117b4565b8352918301918301611a79565b509695505050505050565b5f82601f830112611ab1575f80fd5b81356020611ac1611a4e83611a0c565b8083825260208201915060208460051b870101935086841115611ae2575f80fd5b602086015b84811015611a9757803561ffff81168114611b00575f80fd5b8352918301918301611ae7565b5f8060408385031215611b1e575f80fd5b823567ffffffffffffffff80821115611b35575f80fd5b611b4186838701611a2f565b93506020850135915080821115611b56575f80fd5b50611b6385828601611aa2565b9150509250929050565b5f6020808385031215611b7e575f80fd5b823567ffffffffffffffff80821115611b95575f80fd5b818501915085601f830112611ba8575f80fd5b813581811115611bba57611bba6119c7565b611bcc601f8201601f191685016119db565b91508082528684828501011115611be1575f80fd5b80848401858401375f90820190930192909252509392505050565b5f60208284031215611c0c575f80fd5b5035919050565b602081525f610f316020830184611855565b8015158114610b05575f80fd5b5f805f8060808587031215611c45575f80fd5b611c4e856117b4565b9350602085013567ffffffffffffffff80821115611c6a575f80fd5b611c7688838901611a2f565b94506040870135915080821115611c8b575f80fd5b50611c9887828801611aa2565b9250506060850135611ca981611c25565b939692955090935050565b5f8060408385031215611cc5575f80fd5b611cce836117b4565b946020939093013593505050565b634e487b7160e01b5f52603260045260245ffd5b600181811c90821680611d0457607f821691505b602082108103611d2257634e487b7160e01b5f52602260045260245ffd5b50919050565b604080825283519082018190525f906020906060840190828701845b82811015611d695781516001600160a01b031684529284019290840190600101611d44565b505050838103828501528451808252858301918301905f5b81811015611da157835161ffff1683529284019291840191600101611d81565b5090979650505050505050565b5f815160208301516001600160e01b031980821693506004831015611ddd5780818460040360031b1b83161693505b505050919050565b601f821115610db657805f5260205f20601f840160051c81016020851015611e0a5750805b601f840160051c820191505b81811015610a75575f8155600101611e16565b815167ffffffffffffffff811115611e4357611e436119c7565b611e5781611e518454611cf0565b84611de5565b602080601f831160018114611e8a575f8415611e735750858301515b5f19600386901b1c1916600185901b178555610f1e565b5f85815260208120601f198616915b82811015611eb857888601518255948401946001909101908401611e99565b5085821015611ed557878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610f3457610f34611ee5565b5f60208284031215611f1c575f80fd5b5051919050565b81810381811115610f3457610f34611ee5565b8082028115828204841417610f3457610f34611ee5565b5f82611f6757634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611f7c575f80fd5b8151610dc781611c25565b634e487b7160e01b5f52603160045260245ffd5b5f8251611fac818460208701611808565b9190910192915050565b602081525f610f31602083018461182a56fea164736f6c6343000817000a

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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.