Source Code
                
                
                
                    
                
                
            
          
            
        Overview
ETH Balance
0 ETH
                            Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
                                    
                                    
                                    
                                         Advanced mode:
                                    
                                    
                                    
                                        
                                    
                                
                            Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
                                    
                                    
                                        This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
                                    
                                
                                
                            Contract Source Code Verified (Exact Match)
Contract Name:
                                        
                                            PendleVotingControllerUpg
                                        
                                    Compiler Version
                                        
                                            v0.8.24+commit.e11b9ed9
                                        
                                    Optimization Enabled:
                                        
                                            Yes with 1000000 runs
                                        
                                    Other Settings:
                                        
                                            shanghai EvmVersion
                                        
                                    Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;
import "./VotingControllerStorageUpg.sol";
import "../CrossChainMsg/PendleMsgSenderAppUpg.sol";
import "../libraries/VeBalanceLib.sol";
import "../../core/libraries/math/PMath.sol";
import "../../interfaces/IPGaugeControllerMainchain.sol";
import "../../interfaces/IPVotingController.sol";
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
/*
Voting accounting:
    - For gauge controller, it will consider each message from voting controller
    as a pack of money to incentivize it during the very next WEEK (block.timestamp -> block.timestamp + WEEK)
    - If the reward duration for the last pack of money has not ended, it will combine
    the leftover reward with the current reward to distribute.
    - In the very extreme case where no one broadcast the result of week x, and at week x+1,
    the results for both are now broadcasted, then the WEEK of (block.timestamp -> WEEK)
    will receive both of the reward pack
    - Each pack of money will has it own id as timestamp, a gauge controller does not
    receive a pack of money with the same id twice, this allow governance to rebroadcast
    in case the last message was corrupted by LayerZero
Pros:
    - If governance does not forget broadcasting the reward on the early of the week,
    the mechanism works just the same as the epoch-based one
    - If governance forget to broadcast the reward, the whole system still works normally,
    the reward is still incentivized, but only approximately fair
Cons:
    - Does not guarantee the reward will be distributed on epoch start and end
*/
contract PendleVotingControllerUpg is PendleMsgSenderAppUpg, VotingControllerStorageUpg, UUPSUpgradeable {
    using VeBalanceLib for VeBalance;
    using PMath for uint256;
    using PMath for int256;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using EnumerableSet for EnumerableSet.AddressSet;
    constructor(
        address _vePendle,
        address _pendleMsgSendEndpoint,
        uint256 initialApproxDestinationGas
    )
        VotingControllerStorageUpg(_vePendle)
        PendleMsgSenderAppUpg(_pendleMsgSendEndpoint, initialApproxDestinationGas) // constructor only set immutable variables
        initializer
    //solhint-disable-next-line
    {
    }
    function initialize(address _owner) external initializer {
        __BoringOwnableV2_init(_owner);
        deployedWTime = WeekMath.getCurrentWeekStart();
    }
    /*///////////////////////////////////////////////////////////////
                FUNCTIONS CAN BE CALLED BY ANYONE
    //////////////////////////////////////////////////////////////*/
    /**
     * @notice updates a user's vote weights, also allowing user to divide their voting power
     * across different pools
     * @param pools pools to change vote weights, if not listed then existing weight won't change
     * @param weights voting weight on each pool in `pools`, must be same length as `pools`
     * @dev A user's max voting weights is equal to `USER_VOTE_MAX_WEIGHT` (1e18). If their total
     * voted weights is less than such, then the excess weight is not counted. For such reason, a
     * user's voting power will only be fully utilized if their total voted weight is exactly 1e18.
     * @dev Reverts if, after all vote changes, the total voted weight is more than 1e18.
     * @dev A removed pool can be included, but the new weight must be 0, otherwise will revert.
     * @dev See {`VotingControllerStorageUpg - getUserData()`} for current user data.
     */
    function vote(address[] calldata pools, uint64[] calldata weights) external {
        address user = msg.sender;
        if (pools.length != weights.length) revert Errors.ArrayLengthMismatch();
        if (user != owner && vePendle.balanceOf(user) == 0) revert Errors.VCZeroVePendle(user);
        LockedPosition memory userPosition = _getUserVePendlePosition(user);
        for (uint256 i = 0; i < pools.length; ++i) {
            if (_isPoolActive(pools[i])) applyPoolSlopeChanges(pools[i]);
            VeBalance memory newVote = _modifyVoteWeight(user, pools[i], userPosition, weights[i]);
            emit Vote(user, pools[i], weights[i], newVote);
        }
        uint256 totalVotedWeight = userData[user].totalVotedWeight;
        if (totalVotedWeight > VeBalanceLib.USER_VOTE_MAX_WEIGHT)
            revert Errors.VCExceededMaxWeight(totalVotedWeight, VeBalanceLib.USER_VOTE_MAX_WEIGHT);
    }
    /**
     * @notice Process all the slopeChanges that haven't been processed & update these data into
     * poolData
     * @dev reverts if pool is not active
     * @dev if pool is already up-to-date, the function will succeed without any state updates
     */
    function applyPoolSlopeChanges(address pool) public {
        if (!_isPoolActive(pool)) revert Errors.VCInactivePool(pool);
        uint128 wTime = poolData[pool].lastSlopeChangeAppliedAt;
        uint128 currentWeekStart = WeekMath.getCurrentWeekStart();
        // no state changes are expected
        if (wTime >= currentWeekStart) return;
        VeBalance memory currentVote = poolData[pool].totalVote;
        while (wTime < currentWeekStart) {
            wTime += WEEK;
            currentVote = currentVote.sub(poolData[pool].slopeChanges[wTime], wTime);
            _setFinalPoolVoteForWeek(pool, wTime, currentVote.getValueAt(wTime));
        }
        _setNewVotePoolData(pool, currentVote, wTime);
    }
    /**
     * @notice finalize the voting results of all pools, up to the current epoch
     * @dev See `applyPoolSlopeChanges()` for more details
     * @dev This function might be gas-costly if there are a lot of active pools, but this can be
     * mitigated by calling `applyPoolSlopeChanges()` for each pool separately, spreading the gas
     * cost across multiple txs (although the total gas cost will be higher).
     * This is because `applyPoolSlopeChanges()` will not update anything if already up-to-date.
     */
    function finalizeEpoch() public {
        uint256 length = allActivePools.length();
        for (uint256 i = 0; i < length; ++i) {
            applyPoolSlopeChanges(allActivePools.at(i));
        }
        _setAllPastEpochsAsFinalized();
    }
    /**
     * @notice broadcast the voting results of the current week to the chain with chainId. Can be
     * called by anyone.
     * @dev It's intentional to allow the same results to be broadcasted multiple
     * times. The receiver should be able to filter these duplicated messages
     * @dev The epoch must have already been finalized by `finalizeEpoch()`, otherwise will revert.
     */
    function broadcastResults(uint64 chainId) external payable refundUnusedEth {
        uint128 wTime = WeekMath.getCurrentWeekStart();
        if (!weekData[wTime].isEpochFinalized) revert Errors.VCEpochNotFinalized(wTime);
        _broadcastResults(chainId, wTime, pendlePerSec, globalCap);
    }
    /*///////////////////////////////////////////////////////////////
                    GOVERNANCE-ONLY FUNCTIONS
    //////////////////////////////////////////////////////////////*/
    modifier onlyAddPoolHelperAndOwner() {
        require(msg.sender == addPoolHelper || msg.sender == owner, "add pool not allowed");
        _;
    }
    modifier onlyRemovePoolHelperAndOwner() {
        require(msg.sender == removePoolHelper || msg.sender == owner, "remove pool not allowed");
        _;
    }
    /**
     * @notice add a pool to allow users to vote. Can only be done by [governance/owner helper]
     * @custom:gov NOTE TO GOV:
     * - Previous week's results should have been broadcasted prior to calling this function.
     * - `pool` must not have been added before (even if has been removed).
     * - `chainId` must be valid.
     */
    function addPool(uint64 chainId, address pool) external onlyAddPoolHelperAndOwner {
        if (_isPoolActive(pool)) revert Errors.VCPoolAlreadyActive(pool);
        if (allRemovedPools.contains(pool)) revert Errors.VCPoolAlreadyAddAndRemoved(pool);
        _addPool(chainId, pool);
        emit AddPool(chainId, pool);
    }
    function addMultiPools(uint64[] memory chainIds, address[] memory pools) external onlyAddPoolHelperAndOwner {
        if (chainIds.length != pools.length) revert Errors.ArrayLengthMismatch();
        for (uint256 i = 0; i < chainIds.length; ++i) {
            (uint64 chainId, address pool) = (chainIds[i], pools[i]);
            if (_isPoolActive(pool)) revert Errors.VCPoolAlreadyActive(pool);
            if (allRemovedPools.contains(pool)) revert Errors.VCPoolAlreadyAddAndRemoved(pool);
            _addPool(chainId, pool);
            emit AddPool(chainId, pool);
        }
    }
    /**
     * @notice remove a pool from voting. Can only be done by governance
     * @custom:gov NOTE TO GOV:
     * - Previous week's results should have been broadcasted prior to calling this function.
     * - `pool` must be currently active.
     */
    function removePool(address pool) external onlyRemovePoolHelperAndOwner {
        if (!_isPoolActive(pool)) revert Errors.VCInactivePool(pool);
        uint64 chainId = poolData[pool].chainId;
        applyPoolSlopeChanges(pool);
        _removePool(pool);
        emit RemovePool(chainId, pool);
    }
    /**
     * @notice set the cap for a pool, or remove cap (using global cap) if `cap` is 0
     */
    function setPoolCaps(address[] calldata pools, uint256[] calldata caps) external onlyAddPoolHelperAndOwner {
        if (pools.length != caps.length) revert Errors.ArrayLengthMismatch();
        for (uint256 i = 0; i < pools.length; ++i) {
            _setPoolCap(pools[i], caps[i]);
        }
        emit SetPoolCaps(pools, caps);
    }
    function setGlobalCap(uint256 cap) external onlyOwner {
        _setGlobalCap(cap);
        emit SetGlobalCap(cap);
    }
    /**
     * @notice use the gov-privilege to force broadcast a message in case there are issues with LayerZero
     * @custom:gov NOTE TO GOV: gov should always call finalizeEpoch beforehand
     */
    function forceBroadcastResults(
        uint64 chainId,
        uint128 wTime,
        uint128 forcedPendlePerSec
    ) external payable onlyOwner refundUnusedEth {
        _broadcastResults(chainId, wTime, forcedPendlePerSec, globalCap);
    }
    /**
     * @notice sets new pendlePerSec
     * @dev no zero checks because gov may want to stop liquidity mining
     * @custom:gov NOTE TO GOV: Should be done mid-week, well before the next broadcast to avoid
     * race condition
     */
    function setPendlePerSec(uint128 newPendlePerSec) external onlyOwner {
        pendlePerSec = newPendlePerSec;
        emit SetPendlePerSec(newPendlePerSec);
    }
    function getBroadcastResultFee(uint64 chainId) external view returns (uint256) {
        if (chainId == block.chainid) return 0; // Mainchain broadcast
        uint256 length = activeChainPools[chainId].length();
        if (length == 0) return 0;
        address[] memory pools = new address[](length);
        uint256[] memory totalPendleAmounts = new uint256[](length);
        return _getSendMessageFee(chainId, abi.encode(uint128(0), pools, totalPendleAmounts));
    }
    /*///////////////////////////////////////////////////////////////
                    INTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/
    /// @notice broadcast voting results of the timestamp to chainId
    function _broadcastResults(
        uint64 chainId,
        uint128 wTime,
        uint128 totalPendlePerSec,
        uint256 currentGlobalCap
    ) internal {
        uint256 totalVotes = weekData[wTime].totalVotes;
        if (totalVotes == 0) return;
        uint256 length = activeChainPools[chainId].length();
        if (length == 0) return;
        address[] memory pools = activeChainPools[chainId].values();
        uint256[] memory totalPendleAmounts = new uint256[](length);
        for (uint256 i = 0; i < length; ++i) {
            uint256 poolVotes = weekData[wTime].poolVotes[pools[i]];
            uint256 cappedRate = PMath.min(_getPoolCapOpt(pools[i], currentGlobalCap), poolVotes.divDown(totalVotes));
            totalPendleAmounts[i] = (uint256(totalPendlePerSec) * WEEK).mulDown(cappedRate);
        }
        if (chainId == block.chainid) {
            address gaugeController = destinationContracts.get(chainId);
            IPGaugeControllerMainchain(gaugeController).updateVotingResults(wTime, pools, totalPendleAmounts);
        } else {
            _sendMessage(chainId, abi.encode(wTime, pools, totalPendleAmounts));
        }
        emit BroadcastResults(chainId, wTime, totalPendlePerSec);
    }
    function _getUserVePendlePosition(address user) internal view returns (LockedPosition memory userPosition) {
        if (user == owner) {
            (userPosition.amount, userPosition.expiry) = (
                GOVERNANCE_PENDLE_VOTE,
                WeekMath.getWeekStartTimestamp(uint128(block.timestamp) + MAX_LOCK_TIME)
            );
        } else {
            (userPosition.amount, userPosition.expiry) = vePendle.positionData(user);
        }
    }
    function setAddPoolHelper(address _helper) public onlyOwner {
        addPoolHelper = _helper;
    }
    function setRemovePoolHelper(address _helper) public onlyOwner {
        removePoolHelper = _helper;
    }
    //solhint-disable-next-line
    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;
    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;
    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);
    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }
    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }
    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }
    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }
    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}// 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 AddressUpgradeable {
    /**
     * @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.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);
    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);
    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeacon.sol";
import "../../interfaces/IERC1967.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";
/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967Upgrade is IERC1967 {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }
    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }
    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }
    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }
    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }
    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }
    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }
    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }
    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }
    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }
    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822.sol";
import "../ERC1967/ERC1967Upgrade.sol";
/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);
    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }
    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }
    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }
    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }
    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
}// 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.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }
    struct BooleanSlot {
        bool value;
    }
    struct Bytes32Slot {
        bytes32 value;
    }
    struct Uint256Slot {
        uint256 value;
    }
    struct StringSlot {
        string value;
    }
    struct BytesSlot {
        bytes value;
    }
    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableMap.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.
pragma solidity ^0.8.0;
import "./EnumerableSet.sol";
/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * The following map types are supported:
 *
 * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0
 * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
 *
 * [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 EnumerableMap, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableMap.
 * ====
 */
library EnumerableMap {
    using EnumerableSet for EnumerableSet.Bytes32Set;
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.
    struct Bytes32ToBytes32Map {
        // Storage of keys
        EnumerableSet.Bytes32Set _keys;
        mapping(bytes32 => bytes32) _values;
    }
    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) {
        map._values[key] = value;
        return map._keys.add(key);
    }
    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {
        delete map._values[key];
        return map._keys.remove(key);
    }
    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {
        return map._keys.contains(key);
    }
    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {
        return map._keys.length();
    }
    /**
     * @dev Returns the key-value pair stored at position `index` in the map. O(1).
     *
     * Note that there are no guarantees on the ordering of entries inside the
     * array, and it may change when more entries are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) {
        bytes32 key = map._keys.at(index);
        return (key, map._values[key]);
    }
    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) {
        bytes32 value = map._values[key];
        if (value == bytes32(0)) {
            return (contains(map, key), bytes32(0));
        } else {
            return (true, value);
        }
    }
    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key");
        return value;
    }
    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToBytes32Map storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), errorMessage);
        return value;
    }
    /**
     * @dev Return the an array containing all the keys
     *
     * 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 map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) {
        return map._keys.values();
    }
    // UintToUintMap
    struct UintToUintMap {
        Bytes32ToBytes32Map _inner;
    }
    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(value));
    }
    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }
    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }
    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }
    /**
     * @dev Returns the element stored at position `index` in the map. 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(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), uint256(value));
    }
    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, uint256(value));
    }
    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key)));
    }
    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(UintToUintMap storage map, uint256 key, string memory errorMessage) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key), errorMessage));
    }
    /**
     * @dev Return the an array containing all the keys
     *
     * 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 map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(UintToUintMap storage map) internal view returns (uint256[] memory) {
        bytes32[] memory store = keys(map._inner);
        uint256[] memory result;
        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }
        return result;
    }
    // UintToAddressMap
    struct UintToAddressMap {
        Bytes32ToBytes32Map _inner;
    }
    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
    }
    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }
    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }
    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }
    /**
     * @dev Returns the element stored at position `index` in the map. 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(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), address(uint160(uint256(value))));
    }
    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, address(uint160(uint256(value))));
    }
    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key)))));
    }
    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        UintToAddressMap storage map,
        uint256 key,
        string memory errorMessage
    ) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage))));
    }
    /**
     * @dev Return the an array containing all the keys
     *
     * 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 map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) {
        bytes32[] memory store = keys(map._inner);
        uint256[] memory result;
        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }
        return result;
    }
    // AddressToUintMap
    struct AddressToUintMap {
        Bytes32ToBytes32Map _inner;
    }
    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) {
        return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
    }
    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(AddressToUintMap storage map, address key) internal returns (bool) {
        return remove(map._inner, bytes32(uint256(uint160(key))));
    }
    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(AddressToUintMap storage map, address key) internal view returns (bool) {
        return contains(map._inner, bytes32(uint256(uint160(key))));
    }
    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(AddressToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }
    /**
     * @dev Returns the element stored at position `index` in the map. 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(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (address(uint160(uint256(key))), uint256(value));
    }
    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key))));
        return (success, uint256(value));
    }
    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key)))));
    }
    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        AddressToUintMap storage map,
        address key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage));
    }
    /**
     * @dev Return the an array containing all the keys
     *
     * 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 map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(AddressToUintMap storage map) internal view returns (address[] memory) {
        bytes32[] memory store = keys(map._inner);
        address[] memory result;
        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }
        return result;
    }
    // Bytes32ToUintMap
    struct Bytes32ToUintMap {
        Bytes32ToBytes32Map _inner;
    }
    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) {
        return set(map._inner, key, bytes32(value));
    }
    /**
     * @dev Removes a value from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {
        return remove(map._inner, key);
    }
    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {
        return contains(map._inner, key);
    }
    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(Bytes32ToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }
    /**
     * @dev Returns the element stored at position `index` in the map. 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(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (key, uint256(value));
    }
    /**
     * @dev Tries to returns the value associated with `key`. O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, key);
        return (success, uint256(value));
    }
    /**
     * @dev Returns the value associated with `key`. O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {
        return uint256(get(map._inner, key));
    }
    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToUintMap storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, key, errorMessage));
    }
    /**
     * @dev Return the an array containing all the keys
     *
     * 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 map grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) {
        bytes32[] memory store = keys(map._inner);
        bytes32[] memory result;
        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }
        return result;
    }
}// 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;
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract BoringOwnableUpgradeableData {
    address public owner;
    address public pendingOwner;
}
abstract contract BoringOwnableUpgradeableV2 is BoringOwnableUpgradeableData, Initializable {
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    function __BoringOwnableV2_init(address _owner) internal onlyInitializing {
        owner = _owner;
    }
    /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
    /// Can only be invoked by the current `owner`.
    /// @param newOwner Address of the new owner.
    /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
    /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
    function transferOwnership(address newOwner, bool direct, bool renounce) public onlyOwner {
        if (direct) {
            // Checks
            require(newOwner != address(0) || renounce, "Ownable: zero address");
            // Effects
            emit OwnershipTransferred(owner, newOwner);
            owner = newOwner;
            pendingOwner = address(0);
        } else {
            // Effects
            pendingOwner = newOwner;
        }
    }
    /// @notice Needs to be called by `pendingOwner` to claim ownership.
    function claimOwnership() public {
        address _pendingOwner = pendingOwner;
        // Checks
        require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");
        // Effects
        emit OwnershipTransferred(owner, _pendingOwner);
        owner = _pendingOwner;
        pendingOwner = address(0);
    }
    /// @notice Only allows the `owner` to execute the function.
    modifier onlyOwner() {
        require(msg.sender == owner, "Ownable: caller is not the owner");
        _;
    }
    uint256[48] private __gap;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
library Errors {
    // BulkSeller
    error BulkInsufficientSyForTrade(uint256 currentAmount, uint256 requiredAmount);
    error BulkInsufficientTokenForTrade(uint256 currentAmount, uint256 requiredAmount);
    error BulkInSufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
    error BulkInSufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
    error BulkInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
    error BulkNotMaintainer();
    error BulkNotAdmin();
    error BulkSellerAlreadyExisted(address token, address SY, address bulk);
    error BulkSellerInvalidToken(address token, address SY);
    error BulkBadRateTokenToSy(uint256 actualRate, uint256 currentRate, uint256 eps);
    error BulkBadRateSyToToken(uint256 actualRate, uint256 currentRate, uint256 eps);
    // APPROX
    error ApproxFail();
    error ApproxParamsInvalid(uint256 guessMin, uint256 guessMax, uint256 eps);
    error ApproxBinarySearchInputInvalid(
        uint256 approxGuessMin,
        uint256 approxGuessMax,
        uint256 minGuessMin,
        uint256 maxGuessMax
    );
    // MARKET + MARKET MATH CORE
    error MarketExpired();
    error MarketZeroAmountsInput();
    error MarketZeroAmountsOutput();
    error MarketZeroLnImpliedRate();
    error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
    error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
    error MarketInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
    error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
    error MarketExchangeRateBelowOne(int256 exchangeRate);
    error MarketProportionMustNotEqualOne();
    error MarketRateScalarBelowZero(int256 rateScalar);
    error MarketScalarRootBelowZero(int256 scalarRoot);
    error MarketProportionTooHigh(int256 proportion, int256 maxProportion);
    error OracleUninitialized();
    error OracleTargetTooOld(uint32 target, uint32 oldest);
    error OracleZeroCardinality();
    error MarketFactoryExpiredPt();
    error MarketFactoryInvalidPt();
    error MarketFactoryMarketExists();
    error MarketFactoryLnFeeRateRootTooHigh(uint80 lnFeeRateRoot, uint256 maxLnFeeRateRoot);
    error MarketFactoryOverriddenFeeTooHigh(uint80 overriddenFee, uint256 marketLnFeeRateRoot);
    error MarketFactoryReserveFeePercentTooHigh(uint8 reserveFeePercent, uint8 maxReserveFeePercent);
    error MarketFactoryZeroTreasury();
    error MarketFactoryInitialAnchorTooLow(int256 initialAnchor, int256 minInitialAnchor);
    error MFNotPendleMarket(address addr);
    // ROUTER
    error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
    error RouterInsufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
    error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
    error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
    error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
    error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
    error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
    error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
    error RouterNotAllSyUsed(uint256 netSyDesired, uint256 netSyUsed);
    error RouterTimeRangeZero();
    error RouterCallbackNotPendleMarket(address caller);
    error RouterInvalidAction(bytes4 selector);
    error RouterInvalidFacet(address facet);
    error RouterKyberSwapDataZero();
    error SimulationResults(bool success, bytes res);
    // YIELD CONTRACT
    error YCExpired();
    error YCNotExpired();
    error YieldContractInsufficientSy(uint256 actualSy, uint256 requiredSy);
    error YCNothingToRedeem();
    error YCPostExpiryDataNotSet();
    error YCNoFloatingSy();
    // YieldFactory
    error YCFactoryInvalidExpiry();
    error YCFactoryYieldContractExisted();
    error YCFactoryZeroExpiryDivisor();
    error YCFactoryZeroTreasury();
    error YCFactoryInterestFeeRateTooHigh(uint256 interestFeeRate, uint256 maxInterestFeeRate);
    error YCFactoryRewardFeeRateTooHigh(uint256 newRewardFeeRate, uint256 maxRewardFeeRate);
    // SY
    error SYInvalidTokenIn(address token);
    error SYInvalidTokenOut(address token);
    error SYZeroDeposit();
    error SYZeroRedeem();
    error SYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
    error SYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
    // SY-specific
    error SYQiTokenMintFailed(uint256 errCode);
    error SYQiTokenRedeemFailed(uint256 errCode);
    error SYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
    error SYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
    error SYCurveInvalidPid();
    error SYCurve3crvPoolNotFound();
    error SYApeDepositAmountTooSmall(uint256 amountDeposited);
    error SYBalancerInvalidPid();
    error SYInvalidRewardToken(address token);
    error SYStargateRedeemCapExceeded(uint256 amountLpDesired, uint256 amountLpRedeemable);
    error SYBalancerReentrancy();
    error NotFromTrustedRemote(uint16 srcChainId, bytes path);
    error ApxETHNotEnoughBuffer();
    // Liquidity Mining
    error VCInvalidCap(uint256 cap);
    error VCInactivePool(address pool);
    error VCPoolAlreadyActive(address pool);
    error VCZeroVePendle(address user);
    error VCExceededMaxWeight(uint256 totalWeight, uint256 maxWeight);
    error VCEpochNotFinalized(uint256 wTime);
    error VCPoolAlreadyAddAndRemoved(address pool);
    error VEInvalidNewExpiry(uint256 newExpiry);
    error VEExceededMaxLockTime();
    error VEInsufficientLockTime();
    error VENotAllowedReduceExpiry();
    error VEZeroAmountLocked();
    error VEPositionNotExpired();
    error VEZeroPosition();
    error VEZeroSlope(uint128 bias, uint128 slope);
    error VEReceiveOldSupply(uint256 msgTime);
    error GCNotPendleMarket(address caller);
    error GCNotVotingController(address caller);
    error InvalidWTime(uint256 wTime);
    error ExpiryInThePast(uint256 expiry);
    error ChainNotSupported(uint256 chainId);
    error FDTotalAmountFundedNotMatch(uint256 actualTotalAmount, uint256 expectedTotalAmount);
    error FDEpochLengthMismatch();
    error FDInvalidPool(address pool);
    error FDPoolAlreadyExists(address pool);
    error FDInvalidNewFinishedEpoch(uint256 oldFinishedEpoch, uint256 newFinishedEpoch);
    error FDInvalidStartEpoch(uint256 startEpoch);
    error FDInvalidWTimeFund(uint256 lastFunded, uint256 wTime);
    error FDFutureFunding(uint256 lastFunded, uint256 currentWTime);
    error BDInvalidEpoch(uint256 epoch, uint256 startTime);
    // Cross-Chain
    error MsgNotFromSendEndpoint(uint16 srcChainId, bytes path);
    error MsgNotFromReceiveEndpoint(address sender);
    error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
    error ApproxDstExecutionGasNotSet();
    error InvalidRetryData();
    // GENERIC MSG
    error ArrayLengthMismatch();
    error ArrayEmpty();
    error ArrayOutOfBounds();
    error ZeroAddress();
    error FailedToSendEther();
    error InvalidMerkleProof();
    error OnlyLayerZeroEndpoint();
    error OnlyYT();
    error OnlyYCFactory();
    error OnlyWhitelisted();
    // Swap Aggregator
    error SAInsufficientTokenIn(address tokenIn, uint256 amountExpected, uint256 amountActual);
    error UnsupportedSelector(uint256 aggregatorType, bytes4 selector);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.0;
/* solhint-disable private-vars-leading-underscore, reason-string */
library PMath {
    uint256 internal constant ONE = 1e18; // 18 decimal places
    int256 internal constant IONE = 1e18; // 18 decimal places
    function subMax0(uint256 a, uint256 b) internal pure returns (uint256) {
        unchecked {
            return (a >= b ? a - b : 0);
        }
    }
    function subNoNeg(int256 a, int256 b) internal pure returns (int256) {
        require(a >= b, "negative");
        return a - b; // no unchecked since if b is very negative, a - b might overflow
    }
    function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 product = a * b;
        unchecked {
            return product / ONE;
        }
    }
    function mulDown(int256 a, int256 b) internal pure returns (int256) {
        int256 product = a * b;
        unchecked {
            return product / IONE;
        }
    }
    function divDown(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 aInflated = a * ONE;
        unchecked {
            return aInflated / b;
        }
    }
    function divDown(int256 a, int256 b) internal pure returns (int256) {
        int256 aInflated = a * IONE;
        unchecked {
            return aInflated / b;
        }
    }
    function rawDivUp(uint256 a, uint256 b) internal pure returns (uint256) {
        return (a + b - 1) / b;
    }
    function rawDivUp(int256 a, int256 b) internal pure returns (int256) {
        return (a + b - 1) / b;
    }
    function tweakUp(uint256 a, uint256 factor) internal pure returns (uint256) {
        return mulDown(a, ONE + factor);
    }
    function tweakDown(uint256 a, uint256 factor) internal pure returns (uint256) {
        return mulDown(a, ONE - factor);
    }
    /// @return res = min(a + b, bound)
    /// @dev This function should handle arithmetic operation and bound check without overflow/underflow
    function addWithUpperBound(uint256 a, uint256 b, uint256 bound) internal pure returns (uint256 res) {
        unchecked {
            if (type(uint256).max - b < a) res = bound;
            else res = min(bound, a + b);
        }
    }
    /// @return res = max(a - b, bound)
    /// @dev This function should handle arithmetic operation and bound check without overflow/underflow
    function subWithLowerBound(uint256 a, uint256 b, uint256 bound) internal pure returns (uint256 res) {
        unchecked {
            if (b > a) res = bound;
            else res = max(a - b, bound);
        }
    }
    function clamp(uint256 x, uint256 lower, uint256 upper) internal pure returns (uint256 res) {
        res = x;
        if (x < lower) res = lower;
        else if (x > upper) res = upper;
    }
    // @author Uniswap
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
    function square(uint256 x) internal pure returns (uint256) {
        return x * x;
    }
    function squareDown(uint256 x) internal pure returns (uint256) {
        return mulDown(x, x);
    }
    function abs(int256 x) internal pure returns (uint256) {
        return uint256(x > 0 ? x : -x);
    }
    function neg(int256 x) internal pure returns (int256) {
        return x * (-1);
    }
    function neg(uint256 x) internal pure returns (int256) {
        return Int(x) * (-1);
    }
    function max(uint256 x, uint256 y) internal pure returns (uint256) {
        return (x > y ? x : y);
    }
    function max(int256 x, int256 y) internal pure returns (int256) {
        return (x > y ? x : y);
    }
    function min(uint256 x, uint256 y) internal pure returns (uint256) {
        return (x < y ? x : y);
    }
    function min(int256 x, int256 y) internal pure returns (int256) {
        return (x < y ? x : y);
    }
    /*///////////////////////////////////////////////////////////////
                               SIGNED CASTS
    //////////////////////////////////////////////////////////////*/
    function Int(uint256 x) internal pure returns (int256) {
        require(x <= uint256(type(int256).max));
        return int256(x);
    }
    function Int128(int256 x) internal pure returns (int128) {
        require(type(int128).min <= x && x <= type(int128).max);
        return int128(x);
    }
    function Int128(uint256 x) internal pure returns (int128) {
        return Int128(Int(x));
    }
    /*///////////////////////////////////////////////////////////////
                               UNSIGNED CASTS
    //////////////////////////////////////////////////////////////*/
    function Uint(int256 x) internal pure returns (uint256) {
        require(x >= 0);
        return uint256(x);
    }
    function Uint32(uint256 x) internal pure returns (uint32) {
        require(x <= type(uint32).max);
        return uint32(x);
    }
    function Uint64(uint256 x) internal pure returns (uint64) {
        require(x <= type(uint64).max);
        return uint64(x);
    }
    function Uint112(uint256 x) internal pure returns (uint112) {
        require(x <= type(uint112).max);
        return uint112(x);
    }
    function Uint96(uint256 x) internal pure returns (uint96) {
        require(x <= type(uint96).max);
        return uint96(x);
    }
    function Uint128(uint256 x) internal pure returns (uint128) {
        require(x <= type(uint128).max);
        return uint128(x);
    }
    function Uint192(uint256 x) internal pure returns (uint192) {
        require(x <= type(uint192).max);
        return uint192(x);
    }
    function Uint80(uint256 x) internal pure returns (uint80) {
        require(x <= type(uint80).max);
        return uint80(x);
    }
    function isAApproxB(uint256 a, uint256 b, uint256 eps) internal pure returns (bool) {
        return mulDown(b, ONE - eps) <= a && a <= mulDown(b, ONE + eps);
    }
    function isAGreaterApproxB(uint256 a, uint256 b, uint256 eps) internal pure returns (bool) {
        return a >= b && a <= mulDown(b, ONE + eps);
    }
    function isASmallerApproxB(uint256 a, uint256 b, uint256 eps) internal pure returns (bool) {
        return a <= b && a >= mulDown(b, ONE - eps);
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
library MiniHelpers {
    function isCurrentlyExpired(uint256 expiry) internal view returns (bool) {
        return (expiry <= block.timestamp);
    }
    function isExpired(uint256 expiry, uint256 blockTime) internal pure returns (bool) {
        return (expiry <= blockTime);
    }
    function isTimeInThePast(uint256 timestamp) internal view returns (bool) {
        return (timestamp <= block.timestamp); // same definition as isCurrentlyExpired
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
interface IPGaugeController {
    event MarketClaimReward(address indexed market, uint256 amount);
    event ReceiveVotingResults(uint128 indexed wTime, address[] markets, uint256[] pendleAmounts);
    event UpdateMarketReward(address indexed market, uint256 pendlePerSec, uint256 incentiveEndsAt);
    function fundPendle(uint256 amount) external;
    function withdrawPendle(uint256 amount) external;
    function pendle() external returns (address);
    function redeemMarketReward() external;
    function rewardData(address pool) external view returns (uint128 pendlePerSec, uint128, uint128, uint128);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "./IPGaugeController.sol";
interface IPGaugeControllerMainchain is IPGaugeController {
    function updateVotingResults(uint128 wTime, address[] calldata markets, uint256[] calldata pendleSpeeds) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
interface IPMsgSendEndpoint {
    function calcFee(
        address dstAddress,
        uint256 dstChainId,
        bytes memory payload,
        uint256 estimatedGasAmount
    ) external view returns (uint256 fee);
    function sendMessage(
        address dstAddress,
        uint256 dstChainId,
        bytes calldata payload,
        uint256 estimatedGasAmount
    ) external payable;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
interface IPVeToken {
    // ============= USER INFO =============
    function balanceOf(address user) external view returns (uint128);
    function positionData(address user) external view returns (uint128 amount, uint128 expiry);
    // ============= META DATA =============
    function totalSupplyStored() external view returns (uint128);
    function totalSupplyCurrent() external returns (uint128);
    function totalSupplyAndBalanceCurrent(address user) external returns (uint128, uint128);
}pragma solidity ^0.8.0;
import "../LiquidityMining/libraries/VeBalanceLib.sol";
import "../LiquidityMining/libraries/VeHistoryLib.sol";
interface IPVotingController {
    event AddPool(uint64 indexed chainId, address indexed pool);
    event RemovePool(uint64 indexed chainId, address indexed pool);
    event Vote(address indexed user, address indexed pool, uint64 weight, VeBalance vote);
    event PoolVoteChange(address indexed pool, VeBalance vote);
    event SetPendlePerSec(uint256 newPendlePerSec);
    event BroadcastResults(uint64 indexed chainId, uint128 indexed wTime, uint128 totalPendlePerSec);
    event SetPoolCaps(address[] pools, uint256[] caps);
    event SetGlobalCap(uint256 cap);
    function applyPoolSlopeChanges(address pool) external;
    /// @notice deprecated, only kept for compatibility reasons
    function getUserPoolHistoryLength(address user, address pool) external view returns (uint256);
    /// @notice deprecated, only kept for compatibility reasons
    function getUserPoolHistoryAt(address user, address pool, uint256 index) external view returns (Checkpoint memory);
    function getWeekData(
        uint128 wTime,
        address[] calldata pools
    ) external view returns (bool isEpochFinalized, uint128 totalVotes, uint128[] memory poolVotes);
    function getPoolTotalVoteAt(address pool, uint128 wTime) external view returns (uint128);
    function finalizeEpoch() external;
    function getBroadcastResultFee(uint64 chainId) external view returns (uint256);
    function broadcastResults(uint64 chainId) external payable;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "../../interfaces/IPMsgSendEndpoint.sol";
import "../../core/libraries/BoringOwnableUpgradeableV2.sol";
import "../../core/libraries/Errors.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
// solhint-disable no-empty-blocks
abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeableV2 {
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    uint256 public approxDstExecutionGas;
    IPMsgSendEndpoint public immutable pendleMsgSendEndpoint;
    // destinationContracts mapping contains one address for each chainId only
    EnumerableMap.UintToAddressMap internal destinationContracts;
    uint256[100] private __gap;
    modifier refundUnusedEth() {
        _;
        if (address(this).balance > 0) {
            AddressUpgradeable.sendValue(payable(msg.sender), address(this).balance);
        }
    }
    constructor(address _pendleMsgSendEndpoint, uint256 _approxDstExecutionGas) {
        pendleMsgSendEndpoint = IPMsgSendEndpoint(_pendleMsgSendEndpoint);
        approxDstExecutionGas = _approxDstExecutionGas;
    }
    function _sendMessage(uint256 chainId, bytes memory message) internal {
        assert(destinationContracts.contains(chainId));
        address toAddr = destinationContracts.get(chainId);
        uint256 estimatedGasAmount = approxDstExecutionGas;
        uint256 fee = pendleMsgSendEndpoint.calcFee(toAddr, chainId, message, estimatedGasAmount);
        // LM contracts won't hold ETH on its own so this is fine
        if (address(this).balance < fee) revert Errors.InsufficientFeeToSendMsg(address(this).balance, fee);
        pendleMsgSendEndpoint.sendMessage{value: fee}(toAddr, chainId, message, estimatedGasAmount);
    }
    function addDestinationContract(address _address, uint256 _chainId) external payable onlyOwner {
        destinationContracts.set(_chainId, _address);
    }
    function setApproxDstExecutionGas(uint256 gas) external onlyOwner {
        approxDstExecutionGas = gas;
    }
    function getAllDestinationContracts() public view returns (uint256[] memory chainIds, address[] memory addrs) {
        uint256 length = destinationContracts.length();
        chainIds = new uint256[](length);
        addrs = new address[](length);
        for (uint256 i = 0; i < length; ++i) {
            (chainIds[i], addrs[i]) = destinationContracts.at(i);
        }
    }
    function _getSendMessageFee(uint256 chainId, bytes memory message) internal view returns (uint256) {
        return
            pendleMsgSendEndpoint.calcFee(destinationContracts.get(chainId), chainId, message, approxDstExecutionGas);
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "../../core/libraries/math/PMath.sol";
import "../../core/libraries/Errors.sol";
struct VeBalance {
    uint128 bias;
    uint128 slope;
}
struct LockedPosition {
    uint128 amount;
    uint128 expiry;
}
library VeBalanceLib {
    using PMath for uint256;
    uint128 internal constant MAX_LOCK_TIME = 104 weeks;
    uint256 internal constant USER_VOTE_MAX_WEIGHT = 10 ** 18;
    function add(VeBalance memory a, VeBalance memory b) internal pure returns (VeBalance memory res) {
        res.bias = a.bias + b.bias;
        res.slope = a.slope + b.slope;
    }
    function sub(VeBalance memory a, VeBalance memory b) internal pure returns (VeBalance memory res) {
        res.bias = a.bias - b.bias;
        res.slope = a.slope - b.slope;
    }
    function sub(VeBalance memory a, uint128 slope, uint128 expiry) internal pure returns (VeBalance memory res) {
        res.slope = a.slope - slope;
        res.bias = a.bias - slope * expiry;
    }
    function isExpired(VeBalance memory a) internal view returns (bool) {
        return a.slope * uint128(block.timestamp) >= a.bias;
    }
    function getCurrentValue(VeBalance memory a) internal view returns (uint128) {
        if (isExpired(a)) return 0;
        return getValueAt(a, uint128(block.timestamp));
    }
    function getValueAt(VeBalance memory a, uint128 t) internal pure returns (uint128) {
        if (a.slope * t > a.bias) {
            return 0;
        }
        return a.bias - a.slope * t;
    }
    function getExpiry(VeBalance memory a) internal pure returns (uint128) {
        if (a.slope == 0) revert Errors.VEZeroSlope(a.bias, a.slope);
        return a.bias / a.slope;
    }
    function convertToVeBalance(LockedPosition memory position) internal pure returns (VeBalance memory res) {
        res.slope = position.amount / MAX_LOCK_TIME;
        res.bias = res.slope * position.expiry;
    }
    function convertToVeBalance(
        LockedPosition memory position,
        uint256 weight
    ) internal pure returns (VeBalance memory res) {
        res.slope = ((position.amount * weight) / MAX_LOCK_TIME / USER_VOTE_MAX_WEIGHT).Uint128();
        res.bias = res.slope * position.expiry;
    }
    function convertToVeBalance(uint128 amount, uint128 expiry) internal pure returns (uint128, uint128) {
        VeBalance memory balance = convertToVeBalance(LockedPosition(amount, expiry));
        return (balance.bias, balance.slope);
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
// Forked from OpenZeppelin (v4.5.0) (utils/Checkpoints.sol)
pragma solidity ^0.8.0;
import "../../core/libraries/math/PMath.sol";
import "./VeBalanceLib.sol";
import "./WeekMath.sol";
struct Checkpoint {
    uint128 timestamp;
    VeBalance value;
}
library CheckpointHelper {
    function assignWith(Checkpoint memory a, Checkpoint memory b) internal pure {
        a.timestamp = b.timestamp;
        a.value = b.value;
    }
}
library Checkpoints {
    struct History {
        Checkpoint[] _checkpoints;
    }
    function length(History storage self) internal view returns (uint256) {
        return self._checkpoints.length;
    }
    function get(History storage self, uint256 index) internal view returns (Checkpoint memory) {
        return self._checkpoints[index];
    }
    function push(History storage self, VeBalance memory value) internal {
        uint256 pos = self._checkpoints.length;
        if (pos > 0 && self._checkpoints[pos - 1].timestamp == WeekMath.getCurrentWeekStart()) {
            self._checkpoints[pos - 1].value = value;
        } else {
            self._checkpoints.push(Checkpoint({timestamp: WeekMath.getCurrentWeekStart(), value: value}));
        }
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
library WeekMath {
    uint128 internal constant WEEK = 7 days;
    function getWeekStartTimestamp(uint128 timestamp) internal pure returns (uint128) {
        return (timestamp / WEEK) * WEEK;
    }
    function getCurrentWeekStart() internal view returns (uint128) {
        return getWeekStartTimestamp(uint128(block.timestamp));
    }
    function isValidWTime(uint256 time) internal pure returns (bool) {
        return time % WEEK == 0;
    }
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;
import "../../interfaces/IPVeToken.sol";
import "../../interfaces/IPVotingController.sol";
import "../libraries/VeBalanceLib.sol";
import "../libraries/WeekMath.sol";
import "../libraries/VeHistoryLib.sol";
import "../../core/libraries/MiniHelpers.sol";
import "../../core/libraries/Errors.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
abstract contract VotingControllerStorageUpg is IPVotingController {
    using VeBalanceLib for VeBalance;
    using VeBalanceLib for LockedPosition;
    using EnumerableSet for EnumerableSet.AddressSet;
    using Checkpoints for Checkpoints.History;
    using WeekMath for uint128;
    struct PoolData {
        uint64 chainId;
        uint128 lastSlopeChangeAppliedAt;
        VeBalance totalVote;
        // wTime => slopeChange value
        mapping(uint128 => uint128) slopeChanges;
    }
    struct UserPoolData {
        uint64 weight;
        VeBalance vote;
    }
    struct UserData {
        uint64 totalVotedWeight;
        mapping(address => UserPoolData) voteForPools;
    }
    struct WeekData {
        bool isEpochFinalized;
        uint128 totalVotes;
        mapping(address => uint128) poolVotes;
    }
    uint128 public constant MAX_LOCK_TIME = 104 weeks;
    uint128 public constant WEEK = 1 weeks;
    uint128 public constant GOVERNANCE_PENDLE_VOTE = 10 * (10 ** 6) * (10 ** 18); // 10 mils of PENDLE
    IPVeToken public immutable vePendle;
    uint128 public deployedWTime;
    uint128 public pendlePerSec;
    EnumerableSet.AddressSet internal allActivePools;
    EnumerableSet.AddressSet internal allRemovedPools;
    // [chainId] => [pool]
    mapping(uint64 => EnumerableSet.AddressSet) internal activeChainPools;
    // [poolAddress] -> PoolData
    mapping(address => PoolData) internal poolData;
    // [wTime] => WeekData
    mapping(uint128 => WeekData) internal weekData;
    // user voting data
    mapping(address => UserData) internal userData;
    // [user][pool] => checkpoint
    mapping(address => mapping(address => Checkpoints.History)) internal __dep_userPoolHistory;
    address public addPoolHelper;
    address public removePoolHelper;
    // [pool] => cap
    mapping(address => uint256) public poolCaps;
    uint256 public globalCap;
    uint256[96] private __gap;
    constructor(address _vePendle) {
        vePendle = IPVeToken(_vePendle);
    }
    /*///////////////////////////////////////////////////////////////
                            VIEW FUNCTIONS
    //////////////////////////////////////////////////////////////*/
    function getPoolCap(address pool) public view returns (uint256) {
        uint256 cap = poolCaps[pool];
        return (cap != 0) ? cap : globalCap;
    }
    function getPoolTotalVoteAt(address pool, uint128 wTime) public view returns (uint128) {
        return weekData[wTime].poolVotes[pool];
    }
    /// @notice deprecated, only kept for compatibility reasons
    function getUserPoolHistoryLength(address user, address pool) external view returns (uint256) {
        return __dep_userPoolHistory[user][pool].length();
    }
    /// @notice deprecated, only kept for compatibility reasons
    function getUserPoolHistoryAt(address user, address pool, uint256 index) external view returns (Checkpoint memory) {
        return __dep_userPoolHistory[user][pool].get(index);
    }
    function getPoolData(
        address pool,
        uint128[] calldata wTimes
    )
        public
        view
        returns (
            uint64 chainId,
            uint128 lastSlopeChangeAppliedAt,
            VeBalance memory totalVote,
            uint128[] memory slopeChanges
        )
    {
        PoolData storage data = poolData[pool];
        (chainId, lastSlopeChangeAppliedAt, totalVote) = (data.chainId, data.lastSlopeChangeAppliedAt, data.totalVote);
        slopeChanges = new uint128[](wTimes.length);
        for (uint256 i = 0; i < wTimes.length; ++i) {
            if (!wTimes[i].isValidWTime()) revert Errors.InvalidWTime(wTimes[i]);
            slopeChanges[i] = data.slopeChanges[wTimes[i]];
        }
    }
    function getUserData(
        address user,
        address[] calldata pools
    ) public view returns (uint64 totalVotedWeight, UserPoolData[] memory voteForPools) {
        UserData storage data = userData[user];
        totalVotedWeight = data.totalVotedWeight;
        voteForPools = new UserPoolData[](pools.length);
        for (uint256 i = 0; i < pools.length; ++i) voteForPools[i] = data.voteForPools[pools[i]];
    }
    function getWeekData(
        uint128 wTime,
        address[] calldata pools
    ) public view returns (bool isEpochFinalized, uint128 totalVotes, uint128[] memory poolVotes) {
        if (!wTime.isValidWTime()) revert Errors.InvalidWTime(wTime);
        WeekData storage data = weekData[wTime];
        (isEpochFinalized, totalVotes) = (data.isEpochFinalized, data.totalVotes);
        poolVotes = new uint128[](pools.length);
        for (uint256 i = 0; i < pools.length; ++i) poolVotes[i] = data.poolVotes[pools[i]];
    }
    function getAllActivePools() external view returns (address[] memory) {
        return allActivePools.values();
    }
    function getAllRemovedPools(
        uint256 start,
        uint256 end
    ) external view returns (uint256 lengthOfRemovedPools, address[] memory arr) {
        lengthOfRemovedPools = allRemovedPools.length();
        if (end >= lengthOfRemovedPools) revert Errors.ArrayOutOfBounds();
        arr = new address[](end - start + 1);
        for (uint256 i = start; i <= end; ++i) arr[i - start] = allRemovedPools.at(i);
    }
    function getActiveChainPools(uint64 chainId) external view returns (address[] memory) {
        return activeChainPools[chainId].values();
    }
    function getUserPoolVote(address user, address pool) external view returns (UserPoolData memory) {
        return userData[user].voteForPools[pool];
    }
    /*///////////////////////////////////////////////////////////////
                INTERNAL DATA MANIPULATION FUNCTIONS
    //////////////////////////////////////////////////////////////*/
    function _addPool(uint64 chainId, address pool) internal {
        if (!activeChainPools[chainId].add(pool)) assert(false);
        if (!allActivePools.add(pool)) assert(false);
        poolData[pool].chainId = chainId;
        poolData[pool].lastSlopeChangeAppliedAt = WeekMath.getCurrentWeekStart();
    }
    function _removePool(address pool) internal {
        uint64 chainId = poolData[pool].chainId;
        if (!activeChainPools[chainId].remove(pool)) assert(false);
        if (!allActivePools.remove(pool)) assert(false);
        if (!allRemovedPools.add(pool)) assert(false);
        delete poolData[pool];
    }
    function _setFinalPoolVoteForWeek(address pool, uint128 wTime, uint128 vote) internal {
        weekData[wTime].totalVotes += vote;
        weekData[wTime].poolVotes[pool] = vote;
    }
    function _setNewVotePoolData(address pool, VeBalance memory vote, uint128 wTime) internal {
        poolData[pool].totalVote = vote;
        poolData[pool].lastSlopeChangeAppliedAt = wTime;
        emit PoolVoteChange(pool, vote);
    }
    /**
     * @notice modifies `user`'s vote weight on `pool`
     * @dev works by simply removing the old vote position, then adds in a fresh vote
     */
    function _modifyVoteWeight(
        address user,
        address pool,
        LockedPosition memory userPosition,
        uint64 weight
    ) internal returns (VeBalance memory newVote) {
        UserData storage uData = userData[user];
        PoolData storage pData = poolData[pool];
        VeBalance memory oldVote = uData.voteForPools[pool].vote;
        // REMOVE OLD VOTE
        if (oldVote.bias != 0) {
            if (_isPoolActive(pool) && _isVoteActive(oldVote)) {
                pData.totalVote = pData.totalVote.sub(oldVote);
                pData.slopeChanges[oldVote.getExpiry()] -= oldVote.slope;
            }
            uData.totalVotedWeight -= uData.voteForPools[pool].weight;
            delete uData.voteForPools[pool];
        }
        // ADD NEW VOTE
        if (weight != 0) {
            if (!_isPoolActive(pool)) revert Errors.VCInactivePool(pool);
            newVote = userPosition.convertToVeBalance(weight);
            pData.totalVote = pData.totalVote.add(newVote);
            pData.slopeChanges[newVote.getExpiry()] += newVote.slope;
            uData.voteForPools[pool] = UserPoolData(weight, newVote);
            uData.totalVotedWeight += weight;
        }
        emit PoolVoteChange(pool, pData.totalVote);
    }
    function _setAllPastEpochsAsFinalized() internal {
        uint128 wTime = WeekMath.getCurrentWeekStart();
        while (wTime > deployedWTime && weekData[wTime].isEpochFinalized == false) {
            weekData[wTime].isEpochFinalized = true;
            wTime -= WEEK;
        }
    }
    function _isPoolActive(address pool) internal view returns (bool) {
        return allActivePools.contains(pool);
    }
    /// @notice check if a vote still counts by checking if the vote is not (x,0) (in case the
    /// weight of the vote is too small) & the expiry is after the current time
    function _isVoteActive(VeBalance memory vote) internal view returns (bool) {
        return vote.slope != 0 && !MiniHelpers.isCurrentlyExpired(vote.getExpiry());
    }
    function _setPoolCap(address pool, uint256 cap) internal {
        _validateCap(cap);
        poolCaps[pool] = cap;
    }
    function _setGlobalCap(uint256 cap) internal {
        _validateCap(cap);
        globalCap = cap;
    }
    function _getPoolCapOpt(address _pool, uint256 _globalCap) internal view returns (uint256) {
        uint256 cap = poolCaps[_pool];
        return (cap != 0) ? cap : _globalCap;
    }
    function _validateCap(uint256 cap) internal pure {
        if (cap > PMath.ONE) {
            revert Errors.VCInvalidCap(cap);
        }
    }
}{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "viaIR": true,
  "evmVersion": "shanghai",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_vePendle","type":"address"},{"internalType":"address","name":"_pendleMsgSendEndpoint","type":"address"},{"internalType":"uint256","name":"initialApproxDestinationGas","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"ArrayOutOfBounds","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentFee","type":"uint256"},{"internalType":"uint256","name":"requiredFee","type":"uint256"}],"name":"InsufficientFeeToSendMsg","type":"error"},{"inputs":[{"internalType":"uint256","name":"wTime","type":"uint256"}],"name":"InvalidWTime","type":"error"},{"inputs":[{"internalType":"uint256","name":"wTime","type":"uint256"}],"name":"VCEpochNotFinalized","type":"error"},{"inputs":[{"internalType":"uint256","name":"totalWeight","type":"uint256"},{"internalType":"uint256","name":"maxWeight","type":"uint256"}],"name":"VCExceededMaxWeight","type":"error"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"VCInactivePool","type":"error"},{"inputs":[{"internalType":"uint256","name":"cap","type":"uint256"}],"name":"VCInvalidCap","type":"error"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"VCPoolAlreadyActive","type":"error"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"VCPoolAlreadyAddAndRemoved","type":"error"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"VCZeroVePendle","type":"error"},{"inputs":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"name":"VEZeroSlope","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"chainId","type":"uint64"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"AddPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"chainId","type":"uint64"},{"indexed":true,"internalType":"uint128","name":"wTime","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"totalPendlePerSec","type":"uint128"}],"name":"BroadcastResults","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"indexed":false,"internalType":"struct VeBalance","name":"vote","type":"tuple"}],"name":"PoolVoteChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"chainId","type":"uint64"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"RemovePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cap","type":"uint256"}],"name":"SetGlobalCap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPendlePerSec","type":"uint256"}],"name":"SetPendlePerSec","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"pools","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"caps","type":"uint256[]"}],"name":"SetPoolCaps","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint64","name":"weight","type":"uint64"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"indexed":false,"internalType":"struct VeBalance","name":"vote","type":"tuple"}],"name":"Vote","type":"event"},{"inputs":[],"name":"GOVERNANCE_PENDLE_VOTE","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_LOCK_TIME","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WEEK","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"addDestinationContract","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"chainIds","type":"uint64[]"},{"internalType":"address[]","name":"pools","type":"address[]"}],"name":"addMultiPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"address","name":"pool","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"addPoolHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"applyPoolSlopeChanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approxDstExecutionGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"}],"name":"broadcastResults","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployedWTime","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalizeEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"uint128","name":"wTime","type":"uint128"},{"internalType":"uint128","name":"forcedPendlePerSec","type":"uint128"}],"name":"forceBroadcastResults","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"}],"name":"getActiveChainPools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllActivePools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllDestinationContracts","outputs":[{"internalType":"uint256[]","name":"chainIds","type":"uint256[]"},{"internalType":"address[]","name":"addrs","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getAllRemovedPools","outputs":[{"internalType":"uint256","name":"lengthOfRemovedPools","type":"uint256"},{"internalType":"address[]","name":"arr","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainId","type":"uint64"}],"name":"getBroadcastResultFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"getPoolCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint128[]","name":"wTimes","type":"uint128[]"}],"name":"getPoolData","outputs":[{"internalType":"uint64","name":"chainId","type":"uint64"},{"internalType":"uint128","name":"lastSlopeChangeAppliedAt","type":"uint128"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"internalType":"struct VeBalance","name":"totalVote","type":"tuple"},{"internalType":"uint128[]","name":"slopeChanges","type":"uint128[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint128","name":"wTime","type":"uint128"}],"name":"getPoolTotalVoteAt","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address[]","name":"pools","type":"address[]"}],"name":"getUserData","outputs":[{"internalType":"uint64","name":"totalVotedWeight","type":"uint64"},{"components":[{"internalType":"uint64","name":"weight","type":"uint64"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"internalType":"struct VeBalance","name":"vote","type":"tuple"}],"internalType":"struct VotingControllerStorageUpg.UserPoolData[]","name":"voteForPools","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getUserPoolHistoryAt","outputs":[{"components":[{"internalType":"uint128","name":"timestamp","type":"uint128"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"internalType":"struct VeBalance","name":"value","type":"tuple"}],"internalType":"struct Checkpoint","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"pool","type":"address"}],"name":"getUserPoolHistoryLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"pool","type":"address"}],"name":"getUserPoolVote","outputs":[{"components":[{"internalType":"uint64","name":"weight","type":"uint64"},{"components":[{"internalType":"uint128","name":"bias","type":"uint128"},{"internalType":"uint128","name":"slope","type":"uint128"}],"internalType":"struct VeBalance","name":"vote","type":"tuple"}],"internalType":"struct VotingControllerStorageUpg.UserPoolData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"wTime","type":"uint128"},{"internalType":"address[]","name":"pools","type":"address[]"}],"name":"getWeekData","outputs":[{"internalType":"bool","name":"isEpochFinalized","type":"bool"},{"internalType":"uint128","name":"totalVotes","type":"uint128"},{"internalType":"uint128[]","name":"poolVotes","type":"uint128[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendleMsgSendEndpoint","outputs":[{"internalType":"contract IPMsgSendEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendlePerSec","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolCaps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"removePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removePoolHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_helper","type":"address"}],"name":"setAddPoolHelper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gas","type":"uint256"}],"name":"setApproxDstExecutionGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cap","type":"uint256"}],"name":"setGlobalCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"newPendlePerSec","type":"uint128"}],"name":"setPendlePerSec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"},{"internalType":"uint256[]","name":"caps","type":"uint256[]"}],"name":"setPoolCaps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_helper","type":"address"}],"name":"setRemovePoolHelper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"bool","name":"renounce","type":"bool"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vePendle","outputs":[{"internalType":"contract IPVeToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"},{"internalType":"uint64[]","name":"weights","type":"uint64[]"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e034620001ed57601f620053e138819003918201601f19168301916001600160401b03831184841017620001f157808492606094604052833981010312620001ed576200004d8162000205565b60406200005d6020840162000205565b9201516001600160a01b039283166080526032551660a0523060c0526001805460a881901c60ff1615908180620001dd575b8015620001c2575b15620001665760ff60a01b198116600160a01b178355816200014e575b5062000110575b6040516151c690816200021b82396080518181816113f701528181613c830152614684015260a05181818161146501528181611f420152612063015260c0518181816123ed015281816125690152612e8c0152f35b805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a15f620000bb565b61ffff60a01b191661010160a01b1782555f620000b4565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156200009757508260ff8260a01c161462000097565b508260ff8260a01c16106200008f565b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b0382168203620001ed5756fe60806040526004361015610011575f80fd5b5f3560e01c8063078dfbe71461353357806313d65dcb146132e757806316ac7e30146132425780631c9bdb49146131bc578063210490281461314c5780632477bfbe1461310b5780632982d519146130ba5780633659cfe614612e3b578063366c771d14612cc857806338b8765c14612c8e5780633b7d094614612aaf5780633e39b650146129d157806349be407d146129485780634e71e0c8146128425780634f1ef286146124c157806352d1902d146123a857806359255706146122e1578063632c096d146121d9578063646fb67c146120f5578063698766ee1461169d5780636aea28261461162457806382ae9ef71461148957806382dabb211461141b57806389c071ea146113ad5780638d66c284146112685780638da5cb5b146112185780638f45ff781461105957806392a8b2d314610ff6578063945f183814610f7e57806399a2af7514610f435780639efc757514610f085780639f752aef14610e7f578063a0e1163414610e2e578063a71f6f5f14610da1578063b292bf9514610d54578063bfa5b32414610d11578063c291230d14610c4b578063c4d66de81461094e578063cc88370e1461078a578063d45f5e2114610731578063d5cd7d2014610683578063d68ffecb14610539578063e30c3978146104e8578063e5c649351461036d578063f144cf17146102e2578063f4359ce5146102a7578063f7f03fea146102695763fa78668f14610229575f80fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206040516303bfc4008152f35b5f80fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020609a5460801c604051908152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405162093a808152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602061031b6136b4565b6fffffffffffffffffffffffffffffffff9081610336613820565b165f5260a1835273ffffffffffffffffffffffffffffffffffffffff600160405f200191165f52825260405f205416604051908152f35b346102655761037b366139b2565b73ffffffffffffffffffffffffffffffffffffffff939193928360a45416331480156104dc575b6103ab90613a7c565b8181036104b257925f5b84811061046c575060405193806040860160408752526060850193915f905b828210610448575050505082820360208401528082527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610265577ff928912629bf241f6bddb48fd8de3f071422321e8118042858e8e4a901d2566993602092849260051b80928583013701030190a1005b9091929460019082610459886136fa565b16815260209081019601939201906103d4565b806104856104806001938888999699613e31565b6141d1565b8661049183878b613e31565b359161049c83614c74565b165f5260a660205260405f2055019390936103b5565b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b505f54841633146103a2565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576105706137c0565b6105786136d7565b9073ffffffffffffffffffffffffffffffffffffffff8060a4541633148015610677575b6105a590613a7c565b8216916105bd835f52609c60205260405f2054151590565b610646576105d6835f52609e60205260405f2054151590565b61061557906105ee67ffffffffffffffff9282614214565b167f336f0b3cc523e98d21e261389542b62abaffc094a21a82f1eec2779d7c8323cb5f80a3005b602483604051907f4753d2830000000000000000000000000000000000000000000000000000000082526004820152fd5b602483604051907f9e7f1f410000000000000000000000000000000000000000000000000000000082526004820152fd5b505f548116331461059c565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760405180609b5491828152602080910192609b5f527fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc349915f905b82821061071a576107168561070281890382613767565b6040519182916020835260208301906137d7565b0390f35b8354865294850194600193840193909101906106eb565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761078273ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b600435603255005b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557609d8054600435602480359083821015610924576107d78383614207565b92600193600181018091116108f7576107ef90613af5565b95815b8481111561081857878761071660405192839283526040602084015260408301906137d7565b868110156108cb57815f5273ffffffffffffffffffffffffffffffffffffffff817fd26e832454299e9fabb89e0e5fffdc046d4e14431bc1bf607ffb2e8a1ddecf7b01541661087061086a8584614207565b8a613ae1565b527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461089f5785016107f2565b837f4e487b71000000000000000000000000000000000000000000000000000000005f5260116004525ffd5b837f4e487b71000000000000000000000000000000000000000000000000000000005f5260326004525ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b60046040517f7f52b2bf000000000000000000000000000000000000000000000000000000008152fd5b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576109856136b4565b600190815460ff8160a81c161590818092610c3c575b8015610c23575b15610b9f5781740100000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8316178555610b5d575b5082549160ff8360a81c1615610ad95773ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000005f5416175f556fffffffffffffffffffffffffffffffff610a5762093a8082421604614a35565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000609a541617609a55610a8757005b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498917fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff602092168155604051908152a1005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b7fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167501010000000000000000000000000000000000000000178355836109e9565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b50303b1580156109a257508360ff8260a01c16146109a2565b508360ff8260a01c161061099b565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610c7d6137c0565b6fffffffffffffffffffffffffffffffff90610c9f62093a8083421604614a35565b91821691825f5260a160205260ff60405f20541615610ce057610ccd9250609a5460801c9060a75492614465565b47610cd457005b610cde473361433b565b005b602483604051907f760c443c0000000000000000000000000000000000000000000000000000000082526004820152fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206040516a084595161401484a0000008152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206fffffffffffffffffffffffffffffffff609a5416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265577f8cbc4fe2c8f6dfa7ac4f8affa74f9664acfb5c6fd044f51706e458cb5a8b8fa46020600435610e1873ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b610e2181614c74565b8060a755604051908152a1005b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60a55416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610eb66136b4565b73ffffffffffffffffffffffffffffffffffffffff90610eda825f54163314613a17565b167fffffffffffffffffffffffff000000000000000000000000000000000000000060a454161760a4555f80f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020603254604051908152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060a754604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff610fca6136b4565b165f90815260a660205260409020548015610feb576020905b604051908152f35b50602060a754610fe3565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff6110426136b4565b165f5260a6602052602060405f2054604051908152f35b34610265576110673661388f565b909173ffffffffffffffffffffffffffffffffffffffff8091165f52602060a2815260405f209367ffffffffffffffff80865416946110a5816137a8565b946110b36040519687613767565b8186527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06110e0836137a8565b015f5b8181106111f35750505f916001809901925b8181106111925750505050505060405193849360408501908552604083860152835180915260609280606087019501935f905b8382106111355787870388f35b9185975082876111808799849895979951805167ffffffffffffffff16825260209081015180516fffffffffffffffffffffffffffffffff9081168385015291015116604090910152565b01970192018796959391949294611128565b9889836111a7610480849b9c9a9d868b613e31565b165f52848b5260405f206111ce83604051926111c28461371b565b89815416845201613e03565b8c8201526111dc828c613ae1565b526111e7818b613ae1565b500198959796986110f5565b958099979896611204969496614189565b82828c0101520198959796989492946110e3565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761129f61383f565b60243567ffffffffffffffff8111610265576112bf90369060040161385e565b6fffffffffffffffffffffffffffffffff80931662093a80810661137c575f9291925260209060a160205260405f20908154936112fb81613af5565b936001938401915f5b81811061133957888861071689604051938360ff8695161515855260081c1660208401526060604084015260608301906138fe565b8073ffffffffffffffffffffffffffffffffffffffff61135e6104808994868a613e31565b165f528484528960405f205416611375828a613ae1565b5201611304565b602490604051907ff7e2d9d20000000000000000000000000000000000000000000000000000000082526004820152fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557609b80545f5b8181106115a0576fffffffffffffffffffffffffffffffff6114e562093a8082421604614a35565b5b8180609a5416911690811180611589575b15610cde57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6c580915f5260a160205260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905501818111156114e6577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b50805f5260a160205260ff60405f205416156114f7565b82548110156115f757600190835f526115f173ffffffffffffffffffffffffffffffffffffffff827fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc349015416613e82565b016114bd565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761165b6136b4565b6116636136d7565b9073ffffffffffffffffffffffffffffffffffffffff8091165f5260a360205260405f2091165f52602052602060405f2054604051908152f35b34610265576116ab366139b2565b92908383036104b25773ffffffffffffffffffffffffffffffffffffffff5f5416331493841580612019575b611fe957604051946116e88661371b565b5f808752602087015215611ef9576fffffffffffffffffffffffffffffffff6303bfc400814216018181116108f75762093a8082611727921604614a35565b1660208601526a084595161401484a00000085525b5f5b8481106117a557335f5260a260205267ffffffffffffffff60405f205416670de0b6b3a76400009081811161176f57005b604491604051917f903482f500000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b6117dd73ffffffffffffffffffffffffffffffffffffffff6117cb610480848989613e31565b165f52609c60205260405f2054151590565b611ede575b6117f0610480828787613e31565b906118046117ff828587613e31565b6141f2565b6040516118108161371b565b5f81525f602082015290335f5260a260205260405f209073ffffffffffffffffffffffffffffffffffffffff85165f5260a060205260405f209160018101602052611860600160405f2001613e03565b6fffffffffffffffffffffffffffffffff815116611cbf575b5067ffffffffffffffff8216611989575b50507fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b67863604073ffffffffffffffffffffffffffffffffffffffff6001968783519501546fffffffffffffffffffffffffffffffff8116865260801c60208601521692a273ffffffffffffffffffffffffffffffffffffffff611910610480848a8a613e31565b61195b6119216117ff86898b613e31565b9367ffffffffffffffff604051951685526020850190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b16907fc71e393f1527f71ce01b78ea87c9bd4fca84f1482359ce7ac9b73f358c61b1e160603392a30161173e565b9092506119b773ffffffffffffffffffffffffffffffffffffffff86165f52609c60205260405f2054151590565b15611c7857604051926119c98461371b565b5f84525f6020850152670de0b6b3a76400006303bfc400611a088d6fffffffffffffffffffffffffffffffff67ffffffffffffffff8616915116614452565b04046fffffffffffffffffffffffffffffffff811161026557611a4b8c6fffffffffffffffffffffffffffffffff6020818095169283828b015201511690614a5b565b168452611bff846fffffffffffffffffffffffffffffffff6020611a7160018801613e03565b611b038380611ab5818660405196611a888861371b565b5f88525f8289015282611aa38c828085511691511690613e5e565b16885201511682878a01511690613e5e565b1683850181905292517fffffffffffffffffffffffffffffffff0000000000000000000000000000000060809490941b841691166fffffffffffffffffffffffffffffffff161760018a0155565b82828501511683611b1386614bbd565b165f5260028901835260405f20908285611b31845493828516613e5e565b1691161790556001604051611b458161371b565b67ffffffffffffffff8816815283810195865273ffffffffffffffffffffffffffffffffffffffff8d165f52818901845267ffffffffffffffff60405f209151167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161781550193519083825116908554161784550151166fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b81549067ffffffffffffffff80821681841601116108f75767ffffffffffffffff90811681831601167fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000919091161790557fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b67863604061188a565b60248573ffffffffffffffffffffffffffffffffffffffff604051917f913accad000000000000000000000000000000000000000000000000000000008352166004820152fd5b611cea73ffffffffffffffffffffffffffffffffffffffff88165f52609c60205260405f2054151590565b80611e9b575b611da2575b5073ffffffffffffffffffffffffffffffffffffffff86165f526001810160205267ffffffffffffffff60405f20541681549067ffffffffffffffff8181841603116108f75767ffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000918184160316911617815573ffffffffffffffffffffffffffffffffffffffff86165f52600181016020525f60016040822082815501558b611879565b60018401906fffffffffffffffffffffffffffffffff611e6181611dc585613e03565b611e5960405191611dd58361371b565b5f835283806020808601935f855282611df68c828085511691511690614a13565b1687520151169381611e1060208b01968288511690614a13565b1692839052517fffffffffffffffffffffffffffffffff0000000000000000000000000000000060809390931b831691166fffffffffffffffffffffffffffffffff1617909755565b511692614bbd565b165f526002850160205260405f20916fffffffffffffffffffffffffffffffff611e8f845493828516614a13565b1691161790558b611cf5565b506fffffffffffffffffffffffffffffffff60208201511615158015611cf057506fffffffffffffffffffffffffffffffff611ed682614bbd565b164210611cf0565b611ef4611eef610480838888613e31565b613e82565b6117e2565b6040517fcb6b4f3c00000000000000000000000000000000000000000000000000000000815233600482015260408160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa908115611fde575f905f92611f96575b506fffffffffffffffffffffffffffffffff809216602088015216855261173c565b9150506040813d604011611fd6575b81611fb260409383613767565b8101031261026557611fcf6020611fc8836141b4565b92016141b4565b9087611f74565b3d9150611fa5565b6040513d5f823e3d90fd5b60246040517fe7640c03000000000000000000000000000000000000000000000000000000008152336004820152fd5b506040517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa8015611fde575f906120ac575b6fffffffffffffffffffffffffffffffff915016156116d7565b506020813d6020116120ed575b816120c660209383613767565b81010312610265576120e86fffffffffffffffffffffffffffffffff916141b4565b612092565b3d91506120b9565b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761212c6136b4565b6121346136d7565b9061213d614189565b5073ffffffffffffffffffffffffffffffffffffffff8091165f5260a2602052600160405f200191165f52602052606060405f206121976001604051926121838461371b565b67ffffffffffffffff815416845201613e03565b602082810191825260408051935167ffffffffffffffff168452915180516fffffffffffffffffffffffffffffffff908116858401529101511690820152f35bf35b346102655760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576122106136b4565b6122186136d7565b60443591612224614189565b5073ffffffffffffffffffffffffffffffffffffffff8091165f5260a360205260405f2091165f5260205260405f209061225c614189565b5081548110156115f7576060915f5260205f209060011b016121d7604051916122848361371b565b6122a760016fffffffffffffffffffffffffffffffff9283815416865201613e03565b90602084019182526040519351168352516020830190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265577ffe870af61f024df0d7f960ad100676f3ffaa7ea6a44bc6c7adf2756cb8cf4b38602061233b61383f565b61235d73ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b6fffffffffffffffffffffffffffffffff609a54817fffffffffffffffffffffffffffffffff000000000000000000000000000000008460801b16911617609a5560405191168152a1005b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016300361243d5760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576124f36136b4565b6024359067ffffffffffffffff8211610265573660238301121561026557816004013561251f81613976565b9261252d6040519485613767565b81845260209182850191366024838301011161026557815f92602486930185378601015273ffffffffffffffffffffffffffffffffffffffff807f0000000000000000000000000000000000000000000000000000000000000000169061259682301415613ced565b6125c57f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc928284541614613d78565b6125d3815f54163314613a17565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561260b5750505050610cde9150614ad1565b84939416906040517f52d1902d0000000000000000000000000000000000000000000000000000000081528581600481865afa5f9181612813575b506126cf57608486604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b0361278f576126dd83614ad1565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a2835115801590612787575b61271257005b5f8091610cde957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c604051966127478861374b565b602788528701527f206661696c65640000000000000000000000000000000000000000000000000060408701525190845af461278161430c565b916150c0565b50600161270c565b608484604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152fd5b9091508681813d831161283b575b61282b8183613767565b8101031261026557519088612646565b503d612821565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760015473ffffffffffffffffffffffffffffffffffffffff908181168033036128ea57805f549384167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37fffffffffffffffffffffffff0000000000000000000000000000000000000000928316175f5516600155005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e65726044820152fd5b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761297f6136b4565b73ffffffffffffffffffffffffffffffffffffffff906129a3825f54163314613a17565b167fffffffffffffffffffffffff000000000000000000000000000000000000000060a554161760a5555f80f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557603354612a0b81613af5565b90612a1581613af5565b905f5b818110612a4957612a3b8461071685604051938493604085526040850190613943565b9083820360208501526137d7565b806001917f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820154805f52603560205273ffffffffffffffffffffffffffffffffffffffff60405f205416612a9d8387613ae1565b52612aa88287613ae1565b5201612a18565b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557612ae76136b4565b73ffffffffffffffffffffffffffffffffffffffff8060a5541633148015612c82575b15612c2457811691612b27835f52609c60205260405f2054151590565b15612bf357825f5260a0815267ffffffffffffffff612b4c8160405f20541693613e82565b835f5260a0825260405f2054165f52609f8152612b6c8360405f20614ff8565b15612bc657612b7a83614f01565b15612bc657612b8883614d28565b15612bc65760a090835f52525f60016040822082815501557ff2e3b584c4d1ed5ead9a4b7de2a8225fd42d13f09e417cd294d03f1dd07fc9145f80a3005b7f4e487b71000000000000000000000000000000000000000000000000000000005f52600160045260245ffd5b602483604051907f913accad0000000000000000000000000000000000000000000000000000000082526004820152fd5b606483604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601760248201527f72656d6f766520706f6f6c206e6f7420616c6c6f7765640000000000000000006044820152fd5b50805f54163314612b0a565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610cde611eef6136b4565b3461026557612cd63661388f565b604051919273ffffffffffffffffffffffffffffffffffffffff90612cfa8461371b565b5f84525f602080950152165f5260a060205260405f20918254926fffffffffffffffffffffffffffffffff94600191612d3560018201613e03565b93612d3f86613af5565b9560025f9301925b818110612dae5789896107168a612d9d8b604051958567ffffffffffffffff889716875260401c1660208601526040850190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b60a0608084015260a08301906138fe565b62093a808a612dc6612dc184868a613e31565b613e41565b1606612dfb57808a612ddd612dc18994868a613e31565b165f528484528a60405f205416612df4828b613ae1565b5201612d47565b612e0c612dc18b9260249488613e31565b6040517ff7e2d9d200000000000000000000000000000000000000000000000000000000815291166004820152fd5b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557612e736136b4565b73ffffffffffffffffffffffffffffffffffffffff91827f00000000000000000000000000000000000000000000000000000000000000001692612eb984301415613ced565b612ee87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc948286541614613d78565b612ef6815f54163314613a17565b604051938285019185831067ffffffffffffffff84111761308d57826040525f865260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354165f14612f515750505050610cde9150614ad1565b84939416906040517f52d1902d0000000000000000000000000000000000000000000000000000000081528581600481865afa5f918161305e575b5061301557608486604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b0361278f5761302383614ad1565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28351158015906130575761271257005b505f61270c565b9091508681813d8311613086575b6130768183613767565b8101031261026557519088612f8c565b503d61306c565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60a45416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020610fe36131476137c0565b613b84565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610cde6131816136b4565b6024359073ffffffffffffffffffffffffffffffffffffffff906131a9825f54163314613a17565b825f5260356020521660405f2055614cb7565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576131ee6137c0565b6131f6613820565b906044356fffffffffffffffffffffffffffffffff8116810361026557610ccd9261323973ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b60a75492614465565b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655767ffffffffffffffff6132836137c0565b165f52609f815260405f20906040518083838295549384815201905f52835f20925f5b858282106132d1575050506132bd92500383613767565b6107166040519282849384528301906137d7565b85548452600195860195889550930192016132a6565b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655767ffffffffffffffff6004358181116102655736602382011215610265578060040135602492613345826137a8565b926133536040519485613767565b828452602092858486019160051b83010191368311610265578601905b82821061351b5750505083359181831161026557366023840112156102655782600401359261339e846137a8565b936133ac6040519586613767565b808552868386019160051b83010191368311610265578701905b828210613504575050505073ffffffffffffffffffffffffffffffffffffffff908160a45416331480156134f8575b6133fe90613a7c565b83518351036104b2575f5b8451811015610cde578161341d8287613ae1565b51168361342a8387613ae1565b511690613442825f52609c60205260405f2054151590565b6134c85761345b825f52609e60205260405f2054151590565b61349857908161346e8260019594614214565b7f336f0b3cc523e98d21e261389542b62abaffc094a21a82f1eec2779d7c8323cb5f80a301613409565b8782604051907f4753d2830000000000000000000000000000000000000000000000000000000082526004820152fd5b8782604051907f9e7f1f410000000000000000000000000000000000000000000000000000000082526004820152fd5b505f54821633146133f5565b838091613510846136fa565b8152019101906133c6565b81358481168103610265578152908401908401613370565b346102655760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761356a6136b4565b6024358015158103610265576044359081151582036102655773ffffffffffffffffffffffffffffffffffffffff9283916135a9835f54163314613a17565b1561368357169081159081159161367b575b501561361d57805f549283167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37fffffffffffffffffffffffff0000000000000000000000000000000000000000809216175f55600154166001555f80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f206164647265737300000000000000000000006044820152fd5b9050836135bb565b915050167fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001555f80f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b6040810190811067ffffffffffffffff82111761308d57604052565b67ffffffffffffffff811161308d57604052565b6060810190811067ffffffffffffffff82111761308d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761308d57604052565b67ffffffffffffffff811161308d5760051b60200190565b6004359067ffffffffffffffff8216820361026557565b9081518082526020808093019301915f5b8281106137f6575050505090565b835173ffffffffffffffffffffffffffffffffffffffff16855293810193928101926001016137e8565b602435906fffffffffffffffffffffffffffffffff8216820361026557565b600435906fffffffffffffffffffffffffffffffff8216820361026557565b9181601f840112156102655782359167ffffffffffffffff8311610265576020808501948460051b01011161026557565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126102655760043573ffffffffffffffffffffffffffffffffffffffff8116810361026557916024359067ffffffffffffffff8211610265576138fa9160040161385e565b9091565b9081518082526020808093019301915f5b82811061391d575050505090565b83516fffffffffffffffffffffffffffffffff168552938101939281019260010161390f565b9081518082526020808093019301915f5b828110613962575050505090565b835185529381019392810192600101613954565b67ffffffffffffffff811161308d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102655767ffffffffffffffff9160043583811161026557826139fd9160040161385e565b93909392602435918211610265576138fa9160040161385e565b15613a1e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b15613a8357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f61646420706f6f6c206e6f7420616c6c6f7765640000000000000000000000006044820152fd5b80518210156115f75760209160051b010190565b90613aff826137a8565b613b0c6040519182613767565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0613b3a82946137a8565b0190602036910137565b91613b73906fffffffffffffffffffffffffffffffff613b8195931684526060602085015260608401906137d7565b916040818403910152613943565b90565b67ffffffffffffffff16468114613ce857805f52602090609f825260405f20548015613ce157613be4613c2182613bc4613bbe8795613af5565b91613af5565b90613c156040519485925f888501526060604085015260808401906137d7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09384848303016060850152613943565b03908101835282613767565b73ffffffffffffffffffffffffffffffffffffffff80613c4085614e73565b169360325494613c7f604051968795869485947f84fe1721000000000000000000000000000000000000000000000000000000008652600486016149d6565b03917f0000000000000000000000000000000000000000000000000000000000000000165afa918215611fde575f92613cb757505090565b90809250813d8311613cda575b613cce8183613767565b81010312610265575190565b503d613cc4565b5050505f90565b505f90565b15613cf457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152fd5b15613d7f57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152fd5b90604051613e108161371b565b91546fffffffffffffffffffffffffffffffff8116835260801c6020830152565b91908110156115f75760051b0190565b356fffffffffffffffffffffffffffffffff811681036102655790565b9190916fffffffffffffffffffffffffffffffff808094169116019182116108f757565b73ffffffffffffffffffffffffffffffffffffffff16613ead815f52609c60205260405f2054151590565b1561415857805f5260a060209060a082526fffffffffffffffffffffffffffffffff9160409280845f2054851c169162093a809382613eef8682421604614a35565b16908185101561414e57939594875f5260a083526001948591613f166001895f2001613e03565b965b614015575b5050505f87815260a083528590208451928501517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090851660801b16939092166fffffffffffffffffffffffffffffffff169290921760018201557fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b6786394613fe792507fffffffffffffffff00000000000000000000000000000000ffffffffffffffff77ffffffffffffffffffffffffffffffff000000000000000083549260401b169116179055565b61401282518092602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565ba2565b9091929697858116908882101561414657508101968588116108f7578388978b5f528487528a5f2060020190888b1691825f528852888b8d8280825f2054169151946140608661371b565b5f86528c828481838a01935f8552850151169061407c91614a13565b16905251169161408b91614a5b565b61409491614a13565b168152809a6140a291614a82565b90805f5260a1908189528c5f2080546008858d83831c16906140c391613e5e565b901b70ffffffffffffffffffffffffffffffff0016907fffffffffffffffffffffffffffffff00000000000000000000000000000000ff161790555f528752818b5f20018c5f528752878b5f20911681547fffffffffffffffffffffffffffffffff00000000000000000000000000000000161790559291909398979698613f18565b989750613f1d565b5050505050505050565b602490604051907f913accad0000000000000000000000000000000000000000000000000000000082526004820152fd5b604051906141968261371b565b5f82526040516020836141a88361371b565b5f83525f828401520152565b51906fffffffffffffffffffffffffffffffff8216820361026557565b3573ffffffffffffffffffffffffffffffffffffffff811681036102655790565b3567ffffffffffffffff811681036102655790565b919082039182116108f757565b67ffffffffffffffff1690815f52609f60205261424c73ffffffffffffffffffffffffffffffffffffffff60405f2092168092614e21565b15612bc65761425a81614d99565b15612bc6576139b091815f5260a060205260405f20907fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556142b762093a806fffffffffffffffffffffffffffffffff421604614a35565b905f5260a060205260405f20907fffffffffffffffff00000000000000000000000000000000ffffffffffffffff77ffffffffffffffffffffffffffffffff000000000000000083549260401b169116179055565b3d15614336573d9061431d82613976565b9161432b6040519384613767565b82523d5f602084013e565b606090565b8147106143f4575f80809373ffffffffffffffffffffffffffffffffffffffff8294165af161436861430c565b501561437057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152fd5b818102929181159184041417156108f757565b92906fffffffffffffffffffffffffffffffff81165f5260a16020526fffffffffffffffffffffffffffffffff60405f205460081c168015806149725767ffffffffffffffff86165f52609f60205260405f2091825490811561414e576040519360208584815201905f528460205f20915f5b85811061495857506144ec92500385613767565b6144f582613af5565b955f5b83811061482657505050505067ffffffffffffffff851646036145f35773ffffffffffffffffffffffffffffffffffffffff61453d67ffffffffffffffff8716614e73565b1692833b1561026557614583935f92836040518097819582947f72cbf8700000000000000000000000000000000000000000000000000000000084528960048501613b44565b03925af1918215611fde576fffffffffffffffffffffffffffffffff60209267ffffffffffffffff927fc78a580f215ba474e75ecbd7636c375e8d2cd25edb0f2467f99b2d0752e104ba956145e4575b505b816040519616865216941692a3565b6145ed90613737565b5f6145d3565b6146369061460a6040519485928560208501613b44565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283613767565b67ffffffffffffffff84165f52603460205260405f205415612bc6578173ffffffffffffffffffffffffffffffffffffffff8061467c67ffffffffffffffff8816614e73565b1690603254907f00000000000000000000000000000000000000000000000000000000000000001690602067ffffffffffffffff896146eb8460405198899485947f84fe17210000000000000000000000000000000000000000000000000000000086521689600486016149d6565b0381855afa938415611fde575f946147f2575b508347106147ba57813b15610265575f938861475567ffffffffffffffff93604051998a97889687957fb2267a7b0000000000000000000000000000000000000000000000000000000087521690600486016149d6565b03925af1918215611fde576fffffffffffffffffffffffffffffffff60209267ffffffffffffffff927fc78a580f215ba474e75ecbd7636c375e8d2cd25edb0f2467f99b2d0752e104ba956147ab575b506145d5565b6147b490613737565b5f6147a5565b6044844790604051917fe098b7ca00000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b9093506020813d60201161481e575b8161480e60209383613767565b810103126102655751925f6146fe565b3d9150614801565b6fffffffffffffffffffffffffffffffff87165f5260a1602052600160405f20019073ffffffffffffffffffffffffffffffffffffffff9182614869838a613ae1565b51165f526020526fffffffffffffffffffffffffffffffff60405f205416916148928289613ae1565b51165f90815260a660205260409020548015614951575b670de0b6b3a764000092838102908082048514901517156108f75787614924578590048082101561491c5750915b62093a806fffffffffffffffffffffffffffffffff8c168181029181159183041417156108f75760019361490a91614452565b04614915828b613ae1565b52016144f8565b9050916148d7565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50826148a9565b9150600160208192855481520193019101918691926144d8565b505050505050565b91908251928382525f5b8481106149c25750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f845f6020809697860101520116010190565b602081830181015184830182015201614984565b94939260609273ffffffffffffffffffffffffffffffffffffffff614a0e93168752602087015260806040870152608086019061497a565b930152565b6fffffffffffffffffffffffffffffffff91821690821603919082116108f757565b9062093a806fffffffffffffffffffffffffffffffff809316029182169182036108f757565b9190916fffffffffffffffffffffffffffffffff808094169116029182169182036108f757565b602081016fffffffffffffffffffffffffffffffff92839283614aa88382865116614a5b565b9151169384911611614ac957613b8193614ac3925116614a5b565b90614a13565b505050505f90565b803b15614b395773ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc91167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b60208101906fffffffffffffffffffffffffffffffff90818351168015614bf05750519151811691168115614924570490565b82604492511690604051917ffbd384a500000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b609b548110156115f757609b5f527fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc34901905f90565b80548210156115f7575f5260205f2001905f90565b670de0b6b3a76400008111614c865750565b602490604051907f701170a20000000000000000000000000000000000000000000000000000000082526004820152fd5b805f52603460205260405f2054155f14613ce8576033546801000000000000000081101561308d5760018101806033558110156115f75781907f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820155603354905f52603460205260405f2055600190565b805f52609e60205260405f2054155f14613ce857609d546801000000000000000081101561308d576001810180609d558110156115f75781907fd26e832454299e9fabb89e0e5fffdc046d4e14431bc1bf607ffb2e8a1ddecf7b0155609d54905f52609e60205260405f2055600190565b805f52609c60205260405f2054155f14613ce857609b546801000000000000000081101561308d57614e0a614dd5826001859401609b55614c2a565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055609b54905f52609c60205260405f2055600190565b6001810190825f528160205260405f2054155f14613ce15780546801000000000000000081101561308d57614e60614dd5826001879401855584614c5f565b905554915f5260205260405f2055600190565b5f52603560205260405f20548015801590614eef575b15614e915790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b657900006044820152fd5b50603460205260405f20541515614e89565b5f818152609c60205260409020548015614ff2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908181018181116108f757609b54908382019182116108f757808203614fbe575b505050609b548015614f9157810190614f6f82614c2a565b909182549160031b1b19169055609b555f52609c6020525f6040812055600190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b614fdc614fcd614dd593614c2a565b90549060031b1c928392614c2a565b90555f52609c60205260405f20555f8080614f57565b50505f90565b906001820191815f528260205260405f2054908115155f14614ac9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff918281018181116108f7578254908482019182116108f75780820361508b575b50505080548015614f915782019161506d8383614c5f565b909182549160031b1b19169055555f526020525f6040812055600190565b6150ab61509b614dd59386614c5f565b90549060031b1c92839286614c5f565b90555f528460205260405f20555f8080615055565b9192901561513b57508151156150d4575090565b3b156150dd5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501561514e5750805190602001fd5b61518c906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061497a565b0390fdfea2646970667358221220d053e564fabcf03e3585ca8b227d30616b48f243ac923a6417182f9cb73baa3164736f6c634300081800330000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021000000000000000000000000007b1014c88f14c9e910092526db57a20052e989f00000000000000000000000000000000000000000000000000000000000f4240
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c8063078dfbe71461353357806313d65dcb146132e757806316ac7e30146132425780631c9bdb49146131bc578063210490281461314c5780632477bfbe1461310b5780632982d519146130ba5780633659cfe614612e3b578063366c771d14612cc857806338b8765c14612c8e5780633b7d094614612aaf5780633e39b650146129d157806349be407d146129485780634e71e0c8146128425780634f1ef286146124c157806352d1902d146123a857806359255706146122e1578063632c096d146121d9578063646fb67c146120f5578063698766ee1461169d5780636aea28261461162457806382ae9ef71461148957806382dabb211461141b57806389c071ea146113ad5780638d66c284146112685780638da5cb5b146112185780638f45ff781461105957806392a8b2d314610ff6578063945f183814610f7e57806399a2af7514610f435780639efc757514610f085780639f752aef14610e7f578063a0e1163414610e2e578063a71f6f5f14610da1578063b292bf9514610d54578063bfa5b32414610d11578063c291230d14610c4b578063c4d66de81461094e578063cc88370e1461078a578063d45f5e2114610731578063d5cd7d2014610683578063d68ffecb14610539578063e30c3978146104e8578063e5c649351461036d578063f144cf17146102e2578063f4359ce5146102a7578063f7f03fea146102695763fa78668f14610229575f80fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206040516303bfc4008152f35b5f80fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020609a5460801c604051908152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405162093a808152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602061031b6136b4565b6fffffffffffffffffffffffffffffffff9081610336613820565b165f5260a1835273ffffffffffffffffffffffffffffffffffffffff600160405f200191165f52825260405f205416604051908152f35b346102655761037b366139b2565b73ffffffffffffffffffffffffffffffffffffffff939193928360a45416331480156104dc575b6103ab90613a7c565b8181036104b257925f5b84811061046c575060405193806040860160408752526060850193915f905b828210610448575050505082820360208401528082527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610265577ff928912629bf241f6bddb48fd8de3f071422321e8118042858e8e4a901d2566993602092849260051b80928583013701030190a1005b9091929460019082610459886136fa565b16815260209081019601939201906103d4565b806104856104806001938888999699613e31565b6141d1565b8661049183878b613e31565b359161049c83614c74565b165f5260a660205260405f2055019390936103b5565b60046040517fa24a13a6000000000000000000000000000000000000000000000000000000008152fd5b505f54841633146103a2565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576105706137c0565b6105786136d7565b9073ffffffffffffffffffffffffffffffffffffffff8060a4541633148015610677575b6105a590613a7c565b8216916105bd835f52609c60205260405f2054151590565b610646576105d6835f52609e60205260405f2054151590565b61061557906105ee67ffffffffffffffff9282614214565b167f336f0b3cc523e98d21e261389542b62abaffc094a21a82f1eec2779d7c8323cb5f80a3005b602483604051907f4753d2830000000000000000000000000000000000000000000000000000000082526004820152fd5b602483604051907f9e7f1f410000000000000000000000000000000000000000000000000000000082526004820152fd5b505f548116331461059c565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760405180609b5491828152602080910192609b5f527fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc349915f905b82821061071a576107168561070281890382613767565b6040519182916020835260208301906137d7565b0390f35b8354865294850194600193840193909101906106eb565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761078273ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b600435603255005b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557609d8054600435602480359083821015610924576107d78383614207565b92600193600181018091116108f7576107ef90613af5565b95815b8481111561081857878761071660405192839283526040602084015260408301906137d7565b868110156108cb57815f5273ffffffffffffffffffffffffffffffffffffffff817fd26e832454299e9fabb89e0e5fffdc046d4e14431bc1bf607ffb2e8a1ddecf7b01541661087061086a8584614207565b8a613ae1565b527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461089f5785016107f2565b837f4e487b71000000000000000000000000000000000000000000000000000000005f5260116004525ffd5b837f4e487b71000000000000000000000000000000000000000000000000000000005f5260326004525ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b60046040517f7f52b2bf000000000000000000000000000000000000000000000000000000008152fd5b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576109856136b4565b600190815460ff8160a81c161590818092610c3c575b8015610c23575b15610b9f5781740100000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8316178555610b5d575b5082549160ff8360a81c1615610ad95773ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff00000000000000000000000000000000000000005f5416175f556fffffffffffffffffffffffffffffffff610a5762093a8082421604614a35565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000609a541617609a55610a8757005b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498917fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff602092168155604051908152a1005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b7fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167501010000000000000000000000000000000000000000178355836109e9565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b50303b1580156109a257508360ff8260a01c16146109a2565b508360ff8260a01c161061099b565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610c7d6137c0565b6fffffffffffffffffffffffffffffffff90610c9f62093a8083421604614a35565b91821691825f5260a160205260ff60405f20541615610ce057610ccd9250609a5460801c9060a75492614465565b47610cd457005b610cde473361433b565b005b602483604051907f760c443c0000000000000000000000000000000000000000000000000000000082526004820152fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206040516a084595161401484a0000008152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760206fffffffffffffffffffffffffffffffff609a5416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265577f8cbc4fe2c8f6dfa7ac4f8affa74f9664acfb5c6fd044f51706e458cb5a8b8fa46020600435610e1873ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b610e2181614c74565b8060a755604051908152a1005b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60a55416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610eb66136b4565b73ffffffffffffffffffffffffffffffffffffffff90610eda825f54163314613a17565b167fffffffffffffffffffffffff000000000000000000000000000000000000000060a454161760a4555f80f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020603254604051908152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060a754604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff610fca6136b4565b165f90815260a660205260409020548015610feb576020905b604051908152f35b50602060a754610fe3565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff6110426136b4565b165f5260a6602052602060405f2054604051908152f35b34610265576110673661388f565b909173ffffffffffffffffffffffffffffffffffffffff8091165f52602060a2815260405f209367ffffffffffffffff80865416946110a5816137a8565b946110b36040519687613767565b8186527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06110e0836137a8565b015f5b8181106111f35750505f916001809901925b8181106111925750505050505060405193849360408501908552604083860152835180915260609280606087019501935f905b8382106111355787870388f35b9185975082876111808799849895979951805167ffffffffffffffff16825260209081015180516fffffffffffffffffffffffffffffffff9081168385015291015116604090910152565b01970192018796959391949294611128565b9889836111a7610480849b9c9a9d868b613e31565b165f52848b5260405f206111ce83604051926111c28461371b565b89815416845201613e03565b8c8201526111dc828c613ae1565b526111e7818b613ae1565b500198959796986110f5565b958099979896611204969496614189565b82828c0101520198959796989492946110e3565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761129f61383f565b60243567ffffffffffffffff8111610265576112bf90369060040161385e565b6fffffffffffffffffffffffffffffffff80931662093a80810661137c575f9291925260209060a160205260405f20908154936112fb81613af5565b936001938401915f5b81811061133957888861071689604051938360ff8695161515855260081c1660208401526060604084015260608301906138fe565b8073ffffffffffffffffffffffffffffffffffffffff61135e6104808994868a613e31565b165f528484528960405f205416611375828a613ae1565b5201611304565b602490604051907ff7e2d9d20000000000000000000000000000000000000000000000000000000082526004820152fd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000007b1014c88f14c9e910092526db57a20052e989f168152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae3170210168152f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557609b80545f5b8181106115a0576fffffffffffffffffffffffffffffffff6114e562093a8082421604614a35565b5b8180609a5416911690811180611589575b15610cde57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6c580915f5260a160205260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905501818111156114e6577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b50805f5260a160205260ff60405f205416156114f7565b82548110156115f757600190835f526115f173ffffffffffffffffffffffffffffffffffffffff827fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc349015416613e82565b016114bd565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761165b6136b4565b6116636136d7565b9073ffffffffffffffffffffffffffffffffffffffff8091165f5260a360205260405f2091165f52602052602060405f2054604051908152f35b34610265576116ab366139b2565b92908383036104b25773ffffffffffffffffffffffffffffffffffffffff5f5416331493841580612019575b611fe957604051946116e88661371b565b5f808752602087015215611ef9576fffffffffffffffffffffffffffffffff6303bfc400814216018181116108f75762093a8082611727921604614a35565b1660208601526a084595161401484a00000085525b5f5b8481106117a557335f5260a260205267ffffffffffffffff60405f205416670de0b6b3a76400009081811161176f57005b604491604051917f903482f500000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b6117dd73ffffffffffffffffffffffffffffffffffffffff6117cb610480848989613e31565b165f52609c60205260405f2054151590565b611ede575b6117f0610480828787613e31565b906118046117ff828587613e31565b6141f2565b6040516118108161371b565b5f81525f602082015290335f5260a260205260405f209073ffffffffffffffffffffffffffffffffffffffff85165f5260a060205260405f209160018101602052611860600160405f2001613e03565b6fffffffffffffffffffffffffffffffff815116611cbf575b5067ffffffffffffffff8216611989575b50507fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b67863604073ffffffffffffffffffffffffffffffffffffffff6001968783519501546fffffffffffffffffffffffffffffffff8116865260801c60208601521692a273ffffffffffffffffffffffffffffffffffffffff611910610480848a8a613e31565b61195b6119216117ff86898b613e31565b9367ffffffffffffffff604051951685526020850190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b16907fc71e393f1527f71ce01b78ea87c9bd4fca84f1482359ce7ac9b73f358c61b1e160603392a30161173e565b9092506119b773ffffffffffffffffffffffffffffffffffffffff86165f52609c60205260405f2054151590565b15611c7857604051926119c98461371b565b5f84525f6020850152670de0b6b3a76400006303bfc400611a088d6fffffffffffffffffffffffffffffffff67ffffffffffffffff8616915116614452565b04046fffffffffffffffffffffffffffffffff811161026557611a4b8c6fffffffffffffffffffffffffffffffff6020818095169283828b015201511690614a5b565b168452611bff846fffffffffffffffffffffffffffffffff6020611a7160018801613e03565b611b038380611ab5818660405196611a888861371b565b5f88525f8289015282611aa38c828085511691511690613e5e565b16885201511682878a01511690613e5e565b1683850181905292517fffffffffffffffffffffffffffffffff0000000000000000000000000000000060809490941b841691166fffffffffffffffffffffffffffffffff161760018a0155565b82828501511683611b1386614bbd565b165f5260028901835260405f20908285611b31845493828516613e5e565b1691161790556001604051611b458161371b565b67ffffffffffffffff8816815283810195865273ffffffffffffffffffffffffffffffffffffffff8d165f52818901845267ffffffffffffffff60405f209151167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161781550193519083825116908554161784550151166fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b81549067ffffffffffffffff80821681841601116108f75767ffffffffffffffff90811681831601167fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000919091161790557fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b67863604061188a565b60248573ffffffffffffffffffffffffffffffffffffffff604051917f913accad000000000000000000000000000000000000000000000000000000008352166004820152fd5b611cea73ffffffffffffffffffffffffffffffffffffffff88165f52609c60205260405f2054151590565b80611e9b575b611da2575b5073ffffffffffffffffffffffffffffffffffffffff86165f526001810160205267ffffffffffffffff60405f20541681549067ffffffffffffffff8181841603116108f75767ffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000918184160316911617815573ffffffffffffffffffffffffffffffffffffffff86165f52600181016020525f60016040822082815501558b611879565b60018401906fffffffffffffffffffffffffffffffff611e6181611dc585613e03565b611e5960405191611dd58361371b565b5f835283806020808601935f855282611df68c828085511691511690614a13565b1687520151169381611e1060208b01968288511690614a13565b1692839052517fffffffffffffffffffffffffffffffff0000000000000000000000000000000060809390931b831691166fffffffffffffffffffffffffffffffff1617909755565b511692614bbd565b165f526002850160205260405f20916fffffffffffffffffffffffffffffffff611e8f845493828516614a13565b1691161790558b611cf5565b506fffffffffffffffffffffffffffffffff60208201511615158015611cf057506fffffffffffffffffffffffffffffffff611ed682614bbd565b164210611cf0565b611ef4611eef610480838888613e31565b613e82565b6117e2565b6040517fcb6b4f3c00000000000000000000000000000000000000000000000000000000815233600482015260408160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae3170210165afa908115611fde575f905f92611f96575b506fffffffffffffffffffffffffffffffff809216602088015216855261173c565b9150506040813d604011611fd6575b81611fb260409383613767565b8101031261026557611fcf6020611fc8836141b4565b92016141b4565b9087611f74565b3d9150611fa5565b6040513d5f823e3d90fd5b60246040517fe7640c03000000000000000000000000000000000000000000000000000000008152336004820152fd5b506040517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae3170210165afa8015611fde575f906120ac575b6fffffffffffffffffffffffffffffffff915016156116d7565b506020813d6020116120ed575b816120c660209383613767565b81010312610265576120e86fffffffffffffffffffffffffffffffff916141b4565b612092565b3d91506120b9565b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761212c6136b4565b6121346136d7565b9061213d614189565b5073ffffffffffffffffffffffffffffffffffffffff8091165f5260a2602052600160405f200191165f52602052606060405f206121976001604051926121838461371b565b67ffffffffffffffff815416845201613e03565b602082810191825260408051935167ffffffffffffffff168452915180516fffffffffffffffffffffffffffffffff908116858401529101511690820152f35bf35b346102655760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576122106136b4565b6122186136d7565b60443591612224614189565b5073ffffffffffffffffffffffffffffffffffffffff8091165f5260a360205260405f2091165f5260205260405f209061225c614189565b5081548110156115f7576060915f5260205f209060011b016121d7604051916122848361371b565b6122a760016fffffffffffffffffffffffffffffffff9283815416865201613e03565b90602084019182526040519351168352516020830190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265577ffe870af61f024df0d7f960ad100676f3ffaa7ea6a44bc6c7adf2756cb8cf4b38602061233b61383f565b61235d73ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b6fffffffffffffffffffffffffffffffff609a54817fffffffffffffffffffffffffffffffff000000000000000000000000000000008460801b16911617609a5560405191168152a1005b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655773ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000094177dddd740e7fbbf72262d687c39b116944ba716300361243d5760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576124f36136b4565b6024359067ffffffffffffffff8211610265573660238301121561026557816004013561251f81613976565b9261252d6040519485613767565b81845260209182850191366024838301011161026557815f92602486930185378601015273ffffffffffffffffffffffffffffffffffffffff807f00000000000000000000000094177dddd740e7fbbf72262d687c39b116944ba7169061259682301415613ced565b6125c57f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc928284541614613d78565b6125d3815f54163314613a17565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561260b5750505050610cde9150614ad1565b84939416906040517f52d1902d0000000000000000000000000000000000000000000000000000000081528581600481865afa5f9181612813575b506126cf57608486604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b0361278f576126dd83614ad1565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a2835115801590612787575b61271257005b5f8091610cde957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c604051966127478861374b565b602788528701527f206661696c65640000000000000000000000000000000000000000000000000060408701525190845af461278161430c565b916150c0565b50600161270c565b608484604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152fd5b9091508681813d831161283b575b61282b8183613767565b8101031261026557519088612646565b503d612821565b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655760015473ffffffffffffffffffffffffffffffffffffffff908181168033036128ea57805f549384167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37fffffffffffffffffffffffff0000000000000000000000000000000000000000928316175f5516600155005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e65726044820152fd5b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761297f6136b4565b73ffffffffffffffffffffffffffffffffffffffff906129a3825f54163314613a17565b167fffffffffffffffffffffffff000000000000000000000000000000000000000060a554161760a5555f80f35b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557603354612a0b81613af5565b90612a1581613af5565b905f5b818110612a4957612a3b8461071685604051938493604085526040850190613943565b9083820360208501526137d7565b806001917f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820154805f52603560205273ffffffffffffffffffffffffffffffffffffffff60405f205416612a9d8387613ae1565b52612aa88287613ae1565b5201612a18565b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557612ae76136b4565b73ffffffffffffffffffffffffffffffffffffffff8060a5541633148015612c82575b15612c2457811691612b27835f52609c60205260405f2054151590565b15612bf357825f5260a0815267ffffffffffffffff612b4c8160405f20541693613e82565b835f5260a0825260405f2054165f52609f8152612b6c8360405f20614ff8565b15612bc657612b7a83614f01565b15612bc657612b8883614d28565b15612bc65760a090835f52525f60016040822082815501557ff2e3b584c4d1ed5ead9a4b7de2a8225fd42d13f09e417cd294d03f1dd07fc9145f80a3005b7f4e487b71000000000000000000000000000000000000000000000000000000005f52600160045260245ffd5b602483604051907f913accad0000000000000000000000000000000000000000000000000000000082526004820152fd5b606483604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601760248201527f72656d6f766520706f6f6c206e6f7420616c6c6f7765640000000000000000006044820152fd5b50805f54163314612b0a565b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610cde611eef6136b4565b3461026557612cd63661388f565b604051919273ffffffffffffffffffffffffffffffffffffffff90612cfa8461371b565b5f84525f602080950152165f5260a060205260405f20918254926fffffffffffffffffffffffffffffffff94600191612d3560018201613e03565b93612d3f86613af5565b9560025f9301925b818110612dae5789896107168a612d9d8b604051958567ffffffffffffffff889716875260401c1660208601526040850190602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565b60a0608084015260a08301906138fe565b62093a808a612dc6612dc184868a613e31565b613e41565b1606612dfb57808a612ddd612dc18994868a613e31565b165f528484528a60405f205416612df4828b613ae1565b5201612d47565b612e0c612dc18b9260249488613e31565b6040517ff7e2d9d200000000000000000000000000000000000000000000000000000000815291166004820152fd5b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557612e736136b4565b73ffffffffffffffffffffffffffffffffffffffff91827f00000000000000000000000094177dddd740e7fbbf72262d687c39b116944ba71692612eb984301415613ced565b612ee87f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc948286541614613d78565b612ef6815f54163314613a17565b604051938285019185831067ffffffffffffffff84111761308d57826040525f865260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354165f14612f515750505050610cde9150614ad1565b84939416906040517f52d1902d0000000000000000000000000000000000000000000000000000000081528581600481865afa5f918161305e575b5061301557608486604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b0361278f5761302383614ad1565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28351158015906130575761271257005b505f61270c565b9091508681813d8311613086575b6130768183613767565b8101031261026557519088612f8c565b503d61306c565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b34610265575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557602073ffffffffffffffffffffffffffffffffffffffff60a45416604051908152f35b346102655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576020610fe36131476137c0565b613b84565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261026557610cde6131816136b4565b6024359073ffffffffffffffffffffffffffffffffffffffff906131a9825f54163314613a17565b825f5260356020521660405f2055614cb7565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610265576131ee6137c0565b6131f6613820565b906044356fffffffffffffffffffffffffffffffff8116810361026557610ccd9261323973ffffffffffffffffffffffffffffffffffffffff5f54163314613a17565b60a75492614465565b34610265576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655767ffffffffffffffff6132836137c0565b165f52609f815260405f20906040518083838295549384815201905f52835f20925f5b858282106132d1575050506132bd92500383613767565b6107166040519282849384528301906137d7565b85548452600195860195889550930192016132a6565b346102655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655767ffffffffffffffff6004358181116102655736602382011215610265578060040135602492613345826137a8565b926133536040519485613767565b828452602092858486019160051b83010191368311610265578601905b82821061351b5750505083359181831161026557366023840112156102655782600401359261339e846137a8565b936133ac6040519586613767565b808552868386019160051b83010191368311610265578701905b828210613504575050505073ffffffffffffffffffffffffffffffffffffffff908160a45416331480156134f8575b6133fe90613a7c565b83518351036104b2575f5b8451811015610cde578161341d8287613ae1565b51168361342a8387613ae1565b511690613442825f52609c60205260405f2054151590565b6134c85761345b825f52609e60205260405f2054151590565b61349857908161346e8260019594614214565b7f336f0b3cc523e98d21e261389542b62abaffc094a21a82f1eec2779d7c8323cb5f80a301613409565b8782604051907f4753d2830000000000000000000000000000000000000000000000000000000082526004820152fd5b8782604051907f9e7f1f410000000000000000000000000000000000000000000000000000000082526004820152fd5b505f54821633146133f5565b838091613510846136fa565b8152019101906133c6565b81358481168103610265578152908401908401613370565b346102655760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102655761356a6136b4565b6024358015158103610265576044359081151582036102655773ffffffffffffffffffffffffffffffffffffffff9283916135a9835f54163314613a17565b1561368357169081159081159161367b575b501561361d57805f549283167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a37fffffffffffffffffffffffff0000000000000000000000000000000000000000809216175f55600154166001555f80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f206164647265737300000000000000000000006044820152fd5b9050836135bb565b915050167fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001555f80f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b359073ffffffffffffffffffffffffffffffffffffffff8216820361026557565b6040810190811067ffffffffffffffff82111761308d57604052565b67ffffffffffffffff811161308d57604052565b6060810190811067ffffffffffffffff82111761308d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761308d57604052565b67ffffffffffffffff811161308d5760051b60200190565b6004359067ffffffffffffffff8216820361026557565b9081518082526020808093019301915f5b8281106137f6575050505090565b835173ffffffffffffffffffffffffffffffffffffffff16855293810193928101926001016137e8565b602435906fffffffffffffffffffffffffffffffff8216820361026557565b600435906fffffffffffffffffffffffffffffffff8216820361026557565b9181601f840112156102655782359167ffffffffffffffff8311610265576020808501948460051b01011161026557565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126102655760043573ffffffffffffffffffffffffffffffffffffffff8116810361026557916024359067ffffffffffffffff8211610265576138fa9160040161385e565b9091565b9081518082526020808093019301915f5b82811061391d575050505090565b83516fffffffffffffffffffffffffffffffff168552938101939281019260010161390f565b9081518082526020808093019301915f5b828110613962575050505090565b835185529381019392810192600101613954565b67ffffffffffffffff811161308d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102655767ffffffffffffffff9160043583811161026557826139fd9160040161385e565b93909392602435918211610265576138fa9160040161385e565b15613a1e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b15613a8357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f61646420706f6f6c206e6f7420616c6c6f7765640000000000000000000000006044820152fd5b80518210156115f75760209160051b010190565b90613aff826137a8565b613b0c6040519182613767565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0613b3a82946137a8565b0190602036910137565b91613b73906fffffffffffffffffffffffffffffffff613b8195931684526060602085015260608401906137d7565b916040818403910152613943565b90565b67ffffffffffffffff16468114613ce857805f52602090609f825260405f20548015613ce157613be4613c2182613bc4613bbe8795613af5565b91613af5565b90613c156040519485925f888501526060604085015260808401906137d7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09384848303016060850152613943565b03908101835282613767565b73ffffffffffffffffffffffffffffffffffffffff80613c4085614e73565b169360325494613c7f604051968795869485947f84fe1721000000000000000000000000000000000000000000000000000000008652600486016149d6565b03917f00000000000000000000000007b1014c88f14c9e910092526db57a20052e989f165afa918215611fde575f92613cb757505090565b90809250813d8311613cda575b613cce8183613767565b81010312610265575190565b503d613cc4565b5050505f90565b505f90565b15613cf457565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152fd5b15613d7f57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152fd5b90604051613e108161371b565b91546fffffffffffffffffffffffffffffffff8116835260801c6020830152565b91908110156115f75760051b0190565b356fffffffffffffffffffffffffffffffff811681036102655790565b9190916fffffffffffffffffffffffffffffffff808094169116019182116108f757565b73ffffffffffffffffffffffffffffffffffffffff16613ead815f52609c60205260405f2054151590565b1561415857805f5260a060209060a082526fffffffffffffffffffffffffffffffff9160409280845f2054851c169162093a809382613eef8682421604614a35565b16908185101561414e57939594875f5260a083526001948591613f166001895f2001613e03565b965b614015575b5050505f87815260a083528590208451928501517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090851660801b16939092166fffffffffffffffffffffffffffffffff169290921760018201557fa512c82e73ec974de3c794a3ea6bbdfbad18531c1394ace9972f3f0166b6786394613fe792507fffffffffffffffff00000000000000000000000000000000ffffffffffffffff77ffffffffffffffffffffffffffffffff000000000000000083549260401b169116179055565b61401282518092602090816fffffffffffffffffffffffffffffffff91828151168552015116910152565ba2565b9091929697858116908882101561414657508101968588116108f7578388978b5f528487528a5f2060020190888b1691825f528852888b8d8280825f2054169151946140608661371b565b5f86528c828481838a01935f8552850151169061407c91614a13565b16905251169161408b91614a5b565b61409491614a13565b168152809a6140a291614a82565b90805f5260a1908189528c5f2080546008858d83831c16906140c391613e5e565b901b70ffffffffffffffffffffffffffffffff0016907fffffffffffffffffffffffffffffff00000000000000000000000000000000ff161790555f528752818b5f20018c5f528752878b5f20911681547fffffffffffffffffffffffffffffffff00000000000000000000000000000000161790559291909398979698613f18565b989750613f1d565b5050505050505050565b602490604051907f913accad0000000000000000000000000000000000000000000000000000000082526004820152fd5b604051906141968261371b565b5f82526040516020836141a88361371b565b5f83525f828401520152565b51906fffffffffffffffffffffffffffffffff8216820361026557565b3573ffffffffffffffffffffffffffffffffffffffff811681036102655790565b3567ffffffffffffffff811681036102655790565b919082039182116108f757565b67ffffffffffffffff1690815f52609f60205261424c73ffffffffffffffffffffffffffffffffffffffff60405f2092168092614e21565b15612bc65761425a81614d99565b15612bc6576139b091815f5260a060205260405f20907fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161790556142b762093a806fffffffffffffffffffffffffffffffff421604614a35565b905f5260a060205260405f20907fffffffffffffffff00000000000000000000000000000000ffffffffffffffff77ffffffffffffffffffffffffffffffff000000000000000083549260401b169116179055565b3d15614336573d9061431d82613976565b9161432b6040519384613767565b82523d5f602084013e565b606090565b8147106143f4575f80809373ffffffffffffffffffffffffffffffffffffffff8294165af161436861430c565b501561437057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152fd5b818102929181159184041417156108f757565b92906fffffffffffffffffffffffffffffffff81165f5260a16020526fffffffffffffffffffffffffffffffff60405f205460081c168015806149725767ffffffffffffffff86165f52609f60205260405f2091825490811561414e576040519360208584815201905f528460205f20915f5b85811061495857506144ec92500385613767565b6144f582613af5565b955f5b83811061482657505050505067ffffffffffffffff851646036145f35773ffffffffffffffffffffffffffffffffffffffff61453d67ffffffffffffffff8716614e73565b1692833b1561026557614583935f92836040518097819582947f72cbf8700000000000000000000000000000000000000000000000000000000084528960048501613b44565b03925af1918215611fde576fffffffffffffffffffffffffffffffff60209267ffffffffffffffff927fc78a580f215ba474e75ecbd7636c375e8d2cd25edb0f2467f99b2d0752e104ba956145e4575b505b816040519616865216941692a3565b6145ed90613737565b5f6145d3565b6146369061460a6040519485928560208501613b44565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283613767565b67ffffffffffffffff84165f52603460205260405f205415612bc6578173ffffffffffffffffffffffffffffffffffffffff8061467c67ffffffffffffffff8816614e73565b1690603254907f00000000000000000000000007b1014c88f14c9e910092526db57a20052e989f1690602067ffffffffffffffff896146eb8460405198899485947f84fe17210000000000000000000000000000000000000000000000000000000086521689600486016149d6565b0381855afa938415611fde575f946147f2575b508347106147ba57813b15610265575f938861475567ffffffffffffffff93604051998a97889687957fb2267a7b0000000000000000000000000000000000000000000000000000000087521690600486016149d6565b03925af1918215611fde576fffffffffffffffffffffffffffffffff60209267ffffffffffffffff927fc78a580f215ba474e75ecbd7636c375e8d2cd25edb0f2467f99b2d0752e104ba956147ab575b506145d5565b6147b490613737565b5f6147a5565b6044844790604051917fe098b7ca00000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b9093506020813d60201161481e575b8161480e60209383613767565b810103126102655751925f6146fe565b3d9150614801565b6fffffffffffffffffffffffffffffffff87165f5260a1602052600160405f20019073ffffffffffffffffffffffffffffffffffffffff9182614869838a613ae1565b51165f526020526fffffffffffffffffffffffffffffffff60405f205416916148928289613ae1565b51165f90815260a660205260409020548015614951575b670de0b6b3a764000092838102908082048514901517156108f75787614924578590048082101561491c5750915b62093a806fffffffffffffffffffffffffffffffff8c168181029181159183041417156108f75760019361490a91614452565b04614915828b613ae1565b52016144f8565b9050916148d7565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50826148a9565b9150600160208192855481520193019101918691926144d8565b505050505050565b91908251928382525f5b8481106149c25750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f845f6020809697860101520116010190565b602081830181015184830182015201614984565b94939260609273ffffffffffffffffffffffffffffffffffffffff614a0e93168752602087015260806040870152608086019061497a565b930152565b6fffffffffffffffffffffffffffffffff91821690821603919082116108f757565b9062093a806fffffffffffffffffffffffffffffffff809316029182169182036108f757565b9190916fffffffffffffffffffffffffffffffff808094169116029182169182036108f757565b602081016fffffffffffffffffffffffffffffffff92839283614aa88382865116614a5b565b9151169384911611614ac957613b8193614ac3925116614a5b565b90614a13565b505050505f90565b803b15614b395773ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc91167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b60208101906fffffffffffffffffffffffffffffffff90818351168015614bf05750519151811691168115614924570490565b82604492511690604051917ffbd384a500000000000000000000000000000000000000000000000000000000835260048301526024820152fd5b609b548110156115f757609b5f527fbba9db4cdbea0a37c207bbb83e20f828cd4441c49891101dc94fd20dc8efc34901905f90565b80548210156115f7575f5260205f2001905f90565b670de0b6b3a76400008111614c865750565b602490604051907f701170a20000000000000000000000000000000000000000000000000000000082526004820152fd5b805f52603460205260405f2054155f14613ce8576033546801000000000000000081101561308d5760018101806033558110156115f75781907f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a820155603354905f52603460205260405f2055600190565b805f52609e60205260405f2054155f14613ce857609d546801000000000000000081101561308d576001810180609d558110156115f75781907fd26e832454299e9fabb89e0e5fffdc046d4e14431bc1bf607ffb2e8a1ddecf7b0155609d54905f52609e60205260405f2055600190565b805f52609c60205260405f2054155f14613ce857609b546801000000000000000081101561308d57614e0a614dd5826001859401609b55614c2a565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055609b54905f52609c60205260405f2055600190565b6001810190825f528160205260405f2054155f14613ce15780546801000000000000000081101561308d57614e60614dd5826001879401855584614c5f565b905554915f5260205260405f2055600190565b5f52603560205260405f20548015801590614eef575b15614e915790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f456e756d657261626c654d61703a206e6f6e6578697374656e74206b657900006044820152fd5b50603460205260405f20541515614e89565b5f818152609c60205260409020548015614ff2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908181018181116108f757609b54908382019182116108f757808203614fbe575b505050609b548015614f9157810190614f6f82614c2a565b909182549160031b1b19169055609b555f52609c6020525f6040812055600190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b614fdc614fcd614dd593614c2a565b90549060031b1c928392614c2a565b90555f52609c60205260405f20555f8080614f57565b50505f90565b906001820191815f528260205260405f2054908115155f14614ac9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff918281018181116108f7578254908482019182116108f75780820361508b575b50505080548015614f915782019161506d8383614c5f565b909182549160031b1b19169055555f526020525f6040812055600190565b6150ab61509b614dd59386614c5f565b90549060031b1c92839286614c5f565b90555f528460205260405f20555f8080615055565b9192901561513b57508151156150d4575090565b3b156150dd5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501561514e5750805190602001fd5b61518c906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061497a565b0390fdfea2646970667358221220d053e564fabcf03e3585ca8b227d30616b48f243ac923a6417182f9cb73baa3164736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021000000000000000000000000007b1014c88f14c9e910092526db57a20052e989f00000000000000000000000000000000000000000000000000000000000f4240
-----Decoded View---------------
Arg [0] : _vePendle (address): 0x4f30A9D41B80ecC5B94306AB4364951AE3170210
Arg [1] : _pendleMsgSendEndpoint (address): 0x07b1014c88f14C9E910092526db57A20052E989F
Arg [2] : initialApproxDestinationGas (uint256): 1000000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae3170210
Arg [1] : 00000000000000000000000007b1014c88f14c9e910092526db57a20052e989f
Arg [2] : 00000000000000000000000000000000000000000000000000000000000f4240
Loading...
Loading
Loading...
Loading
 0x94177Dddd740E7FBBf72262d687c39b116944Ba7
 
                                0x94177Dddd740E7FBBf72262d687c39b116944Ba7
                            Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value | 
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.
 
     
     
     
     
     
     
     
     
     
     
    

