Source Code
                
                
                
                    
                
                
            
            
        Overview
ETH Balance
0 ETH
                            ETH Value
$0.00Multichain Info
                            
                            N/A
                            
                        
                        
                    View more zero value Internal Transactions in Advanced View mode
                                    
                                    
                                    
                                         Advanced mode:
                                    
                                    
                                    
                                        
                                    
                                    
                                
                            
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:
                                        
                                            VotingEscrowV1_2_0
                                        
                                    Compiler Version
                                        
                                            v0.8.24+commit.e11b9ed9
                                        
                                    Optimization Enabled:
                                        
                                            Yes with 2000 runs
                                        
                                    Other Settings:
                                        
                                            cancun EvmVersion
                                        
                                    Contract Source Code (Solidity Standard Json-Input format)
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// token interfaces
import {
    IERC20Upgradeable as IERC20
} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import {
    IERC20MetadataUpgradeable as IERC20Metadata
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import {IERC721EnumerableMintableBurnable as IERC721EMB} from "@lock/IERC721EMB.sol";
// veGovernance
import {IDAO} from "@aragon/osx-commons-contracts/src/dao/IDAO.sol";
import {IAddressGaugeVoter} from "@voting/IAddressGaugeVoter.sol";
import {
    IEscrowCurveIncreasingV1_2_0 as IEscrowCurve
} from "@curve/IEscrowCurveIncreasing_v1_2_0.sol";
import {IExitQueue} from "@queue/IExitQueue.sol";
import {
    IVotingEscrowIncreasingV1_2_0 as IVotingEscrow,
    IVotingEscrowExiting,
    IMerge,
    ISplit,
    IDelegateMoveVoteCaller
} from "@escrow/IVotingEscrowIncreasing_v1_2_0.sol";
import {IClockV1_2_0 as IClock} from "@clock/IClock_v1_2_0.sol";
// libraries
import {
    SafeERC20Upgradeable as SafeERC20
} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import {
    SafeCastUpgradeable as SafeCast
} from "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";
// parents
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {
    ReentrancyGuardUpgradeable as ReentrancyGuard
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {
    PausableUpgradeable as Pausable
} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import {
    DaoAuthorizableUpgradeable as DaoAuthorizable
} from "@aragon/osx-commons-contracts/src/permission/auth/DaoAuthorizableUpgradeable.sol";
import {
    IDelegateUpdateVotingPower,
    IEscrowIVotesAdapter,
    IDelegateMoveVoteRecipient
} from "../delegation/IEscrowIVotesAdapter.sol";
contract VotingEscrowV1_2_0 is
    IVotingEscrow,
    ReentrancyGuard,
    Pausable,
    DaoAuthorizable,
    UUPSUpgradeable
{
    using SafeERC20 for IERC20;
    using SafeCast for uint256;
    /// @notice Role required to manage the Escrow curve, this typically will be the DAO
    bytes32 public constant ESCROW_ADMIN_ROLE = keccak256("ESCROW_ADMIN");
    /// @notice Role required to pause the contract - can be given to emergency contracts
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER");
    /// @notice Role required to withdraw underlying tokens from the contract
    bytes32 public constant SWEEPER_ROLE = keccak256("SWEEPER");
    /// @dev enables splits without whitelisting
    address public constant SPLIT_WHITELIST_ANY_ADDRESS =
        address(uint160(uint256(keccak256("SPLIT_WHITELIST_ANY_ADDRESS"))));
    /*//////////////////////////////////////////////////////////////
                              NFT Data
    //////////////////////////////////////////////////////////////*/
    /// @notice Decimals of the voting power
    uint8 public constant decimals = 18;
    /// @notice Minimum deposit amount
    uint256 public minDeposit;
    /// @notice Auto-incrementing ID for the most recently created lock, does not decrease on withdrawal
    uint256 public lastLockId;
    /// @notice Total supply of underlying tokens deposited in the contract
    uint256 public totalLocked;
    /// @dev tracks the locked balance of each NFT
    mapping(uint256 => LockedBalance) private _locked;
    /*//////////////////////////////////////////////////////////////
                              Helper Contracts
    //////////////////////////////////////////////////////////////*/
    /// @notice Address of the underying ERC20 token.
    /// @dev Only tokens with 18 decimals and no transfer fees are supported
    address public token;
    /// @notice Address of the gauge voting contract.
    /// @dev We need to ensure votes are not left in this contract before allowing positing changes
    address public voter;
    /// @notice Address of the voting Escrow Curve contract that will calculate the voting power
    address public curve;
    /// @notice Address of the contract that manages exit queue logic for withdrawals
    address public queue;
    /// @notice Address of the clock contract that manages epoch and voting periods
    address public clock;
    /// @notice Address of the NFT contract that is the lock
    address public lockNFT;
    bool private _lockNFTSet;
    /*//////////////////////////////////////////////////////////////
                            ADDED: in 1.2.0
    //////////////////////////////////////////////////////////////*/
    /// @notice Whitelisted contracts that are allowed to split
    mapping(address => bool) public splitWhitelisted;
    /// @notice Updates `to` token's timestamp if merge occurs from a token
    ///         whose creation lock occured in the same timestamp as current tx.
    mapping(uint256 => uint256) internal mergeWithdrawalLock;
    /// @notice Addess of the escrow ivotes adapter where delegations occur.
    address public ivotesAdapter;
    /*//////////////////////////////////////////////////////////////
                              Initialization
    //////////////////////////////////////////////////////////////*/
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }
    function initialize(
        address _token,
        address _dao,
        address _clock,
        uint256 _initialMinDeposit
    ) external initializer {
        __ReentrancyGuard_init();
        __Pausable_init();
        __DaoAuthorizableUpgradeable_init(IDAO(_dao));
        if (IERC20Metadata(_token).decimals() != 18) revert MustBe18Decimals();
        token = _token;
        clock = _clock;
        minDeposit = _initialMinDeposit;
        emit MinDepositSet(_initialMinDeposit);
    }
    /// @notice Used to revert if admin tries to change the contract address 2nd time.
    modifier contractAlreadySet(address _contract) {
        if (_contract != address(0)) revert AddressAlreadySet();
        _;
    }
    /*//////////////////////////////////////////////////////////////
                              Admin Setters
    //////////////////////////////////////////////////////////////*/
    /// @notice Added in 1.2.0 to set the ivotes adapter
    function setIVotesAdapter(
        address _ivotesAdapter
    ) external auth(ESCROW_ADMIN_ROLE) contractAlreadySet(ivotesAdapter) {
        ivotesAdapter = _ivotesAdapter;
    }
    /// @notice Sets the curve contract that calculates the voting power
    function setCurve(address _curve) external auth(ESCROW_ADMIN_ROLE) contractAlreadySet(curve) {
        curve = _curve;
    }
    /// @notice Sets the voter contract that tracks votes
    function setVoter(address _voter) external auth(ESCROW_ADMIN_ROLE) {
        voter = _voter;
    }
    /// @notice Sets the exit queue contract that manages withdrawal eligibility
    function setQueue(address _queue) external auth(ESCROW_ADMIN_ROLE) contractAlreadySet(queue) {
        queue = _queue;
    }
    /// @notice Sets the clock contract that manages epoch and voting periods
    function setClock(address _clock) external auth(ESCROW_ADMIN_ROLE) contractAlreadySet(clock) {
        clock = _clock;
    }
    /// @notice Sets the NFT contract that is the lock
    /// @dev By default this can only be set once due to the high risk of changing the lock
    /// and having the ability to steal user funds.
    function setLockNFT(address _nft) external auth(ESCROW_ADMIN_ROLE) {
        if (_lockNFTSet) revert LockNFTAlreadySet();
        lockNFT = _nft;
        _lockNFTSet = true;
    }
    function pause() external auth(PAUSER_ROLE) {
        _pause();
    }
    function unpause() external auth(PAUSER_ROLE) {
        _unpause();
    }
    function setMinDeposit(uint256 _minDeposit) external auth(ESCROW_ADMIN_ROLE) {
        minDeposit = _minDeposit;
        emit MinDepositSet(_minDeposit);
    }
    /// @notice Split disabled by default, only whitelisted addresses can split.
    function setEnableSplit(
        address _account,
        bool _isWhitelisted
    ) external auth(ESCROW_ADMIN_ROLE) {
        splitWhitelisted[_account] = _isWhitelisted;
        emit SplitWhitelistSet(_account, _isWhitelisted);
    }
    /// @notice Enable split to any address without whitelisting
    function enableSplit() external auth(ESCROW_ADMIN_ROLE) {
        splitWhitelisted[SPLIT_WHITELIST_ANY_ADDRESS] = true;
        emit SplitWhitelistSet(SPLIT_WHITELIST_ANY_ADDRESS, true);
    }
    /// @notice Return true if any address is whitelisted or an `_account`.
    function canSplit(address _account) public view virtual returns (bool) {
        // Only allow split to whitelisted accounts.
        return splitWhitelisted[SPLIT_WHITELIST_ANY_ADDRESS] || splitWhitelisted[_account];
    }
    /*//////////////////////////////////////////////////////////////
                      Getters: ERC721 Functions
    //////////////////////////////////////////////////////////////*/
    function isApprovedOrOwner(address _spender, uint256 _tokenId) public view returns (bool) {
        return IERC721EMB(lockNFT).isApprovedOrOwner(_spender, _tokenId);
    }
    /// @notice Fetch all NFTs owned by an address by leveraging the ERC721Enumerable interface
    /// @param _owner Address to query
    /// @return tokenIds Array of token IDs owned by the address
    function ownedTokens(address _owner) public view returns (uint256[] memory tokenIds) {
        IERC721EMB enumerable = IERC721EMB(lockNFT);
        uint256 balance = enumerable.balanceOf(_owner);
        uint256[] memory tokens = new uint256[](balance);
        for (uint256 i = 0; i < balance; i++) {
            tokens[i] = enumerable.tokenOfOwnerByIndex(_owner, i);
        }
        return tokens;
    }
    /*///////////////////////////////////////////////////////////////
                          Getters: Voting
    //////////////////////////////////////////////////////////////*/
    /// @return The voting power of the NFT at the current block
    function votingPower(uint256 _tokenId) public view returns (uint256) {
        return votingPowerAt(_tokenId, block.timestamp);
    }
    /// @return The voting power of the NFT at a specific timestamp
    function votingPowerAt(uint256 _tokenId, uint256 _t) public view returns (uint256) {
        return IEscrowCurve(curve).votingPowerAt(_tokenId, _t);
    }
    /// @return The total voting power at the current block
    function totalVotingPower() external view returns (uint256) {
        return totalVotingPowerAt(block.timestamp);
    }
    /// @return The total voting power at a specific timestamp
    function totalVotingPowerAt(uint256 _timestamp) public view returns (uint256) {
        return IEscrowCurve(curve).supplyAt(_timestamp);
    }
    /// @return The details of the underlying lock for a given veNFT
    function locked(uint256 _tokenId) public view returns (LockedBalance memory) {
        return _locked[_tokenId];
    }
    /// @return accountVotingPower The voting power of an account at the current block
    /// @dev We cannot do historic voting power at this time because we don't current track
    /// histories of token transfers.
    function votingPowerForAccount(
        address _account
    ) external view returns (uint256 accountVotingPower) {
        uint256[] memory tokens = ownedTokens(_account);
        for (uint256 i = 0; i < tokens.length; i++) {
            accountVotingPower += votingPowerAt(tokens[i], block.timestamp);
        }
    }
    /// @notice Checks if the NFT is currently voting. We require the user to reset their votes if so.
    function isVoting(uint256 _tokenId) public view returns (bool) {
        // If token doesn't exist, it reverts.
        address owner = IERC721EMB(lockNFT).ownerOf(_tokenId);
        // If token is not delegated, delegatee wouldn't exist, so we return false.
        bool isTokenDelegated = IEscrowIVotesAdapter(ivotesAdapter).tokenIsDelegated(_tokenId);
        if (!isTokenDelegated) return false;
        // If token is delegated, it will always have a delegatee.
        address delegatee = IEscrowIVotesAdapter(ivotesAdapter).delegates(owner);
        return IAddressGaugeVoter(voter).isVoting(delegatee);
    }
    /*//////////////////////////////////////////////////////////////
                              ESCROW LOGIC
    //////////////////////////////////////////////////////////////*/
    function createLock(uint256 _value) external nonReentrant whenNotPaused returns (uint256) {
        return _createLockFor(_value, _msgSender());
    }
    /// @notice Creates a lock on behalf of someone else. Restricted by default.
    function createLockFor(
        uint256 _value,
        address _to
    ) external nonReentrant whenNotPaused returns (uint256) {
        return _createLockFor(_value, _to);
    }
    /// @dev Deposit `_value` tokens for `_to` starting at next deposit interval
    /// @param _value Amount to deposit
    /// @param _to Address to deposit
    function _createLockFor(uint256 _value, address _to) internal returns (uint256) {
        if (_value == 0) revert ZeroAmount();
        if (_value < minDeposit) revert AmountTooSmall();
        // query the duration lib to get the next time we can deposit
        uint256 startTime = IClock(clock).epochPrevCheckpointTs();
        // increment the total locked supply and get the new tokenId
        totalLocked += _value;
        uint256 newTokenId = ++lastLockId;
        // write the lock and checkpoint the voting power
        LockedBalance memory lock = LockedBalance(_value.toUint208(), startTime.toUint48());
        _locked[newTokenId] = lock;
        // we don't allow edits in this implementation, so only the new lock is used
        _checkpoint(newTokenId, LockedBalance(0, 0), lock);
        uint256 balanceBefore = IERC20(token).balanceOf(address(this));
        // transfer the tokens into the contract
        IERC20(token).safeTransferFrom(_msgSender(), address(this), _value);
        // we currently don't support tokens that adjust balances on transfer
        if (IERC20(token).balanceOf(address(this)) != balanceBefore + _value)
            revert TransferBalanceIncorrect();
        // Update `_to`'s delegate power.
        _moveDelegateVotes(address(0), _to, newTokenId, lock);
        // mint the NFT before and emit the event to complete the lock
        IERC721EMB(lockNFT).mint(_to, newTokenId);
        emit Deposit(_to, newTokenId, startTime, _value, totalLocked);
        return newTokenId;
    }
    /// @inheritdoc IMerge
    function merge(uint256 _from, uint256 _to) public whenNotPaused {
        address sender = _msgSender();
        if (_from == _to) revert SameNFT();
        address ownerFrom = IERC721EMB(lockNFT).ownerOf(_from);
        address ownerTo = IERC721EMB(lockNFT).ownerOf(_to);
        // Both nfts must have the same owner.
        if (ownerFrom != ownerTo) revert NotSameOwner();
        // sender can either be approved or owner.
        if (!isApprovedOrOwner(sender, _from) || !isApprovedOrOwner(sender, _to)) {
            revert NotApprovedOrOwner();
        }
        LockedBalance memory oldLockedFrom = _locked[_from];
        LockedBalance memory oldLockedTo = _locked[_to];
        if (!canMerge(oldLockedFrom, oldLockedTo)) {
            revert CannotMerge(_from, _to);
        }
        // If `_from` was created in this block, or if another token was merged into `_from` in this block,
        // record the current timestamp for `_to` so that withdrawals for it are blocked in the same block.
        IEscrowCurve.TokenPoint memory point = IEscrowCurve(curve).tokenPointHistory(_from, 1);
        if (point.writtenTs == block.timestamp || mergeWithdrawalLock[_from] == block.timestamp) {
            mergeWithdrawalLock[_to] = block.timestamp;
        }
        // We only allow merge when both tokens have the same owner.
        // After the merge, owner still should have the same voting power
        // as one token gets merged into another. For this reason,
        // We call `_moveDelegateVotes` with empty locked, so it doesn't
        // reduce/increase the same voting power for gas efficiency.
        IEscrowIVotesAdapter(ivotesAdapter).mergeDelegateVotes(
            IDelegateMoveVoteRecipient.TokenLock(ownerFrom, _from, oldLockedFrom),
            IDelegateMoveVoteRecipient.TokenLock(ownerFrom, _to, oldLockedTo)
        );
        // Update for `_from`.
        // Note that on the checkpoint, we still don't
        // remove `start` for historical reasons.
        IERC721EMB(lockNFT).burn(_from);
        _locked[_from] = LockedBalance(0, 0);
        _checkpoint(_from, oldLockedFrom, LockedBalance(0, oldLockedFrom.start));
        // update for `_to`.
        uint208 newLockedAmount = oldLockedFrom.amount + oldLockedTo.amount;
        _checkpoint(_to, oldLockedTo, LockedBalance(newLockedAmount, oldLockedTo.start));
        _locked[_to] = LockedBalance(newLockedAmount, oldLockedTo.start);
        emit Merged(sender, _from, _to, oldLockedFrom.amount, oldLockedTo.amount, newLockedAmount);
    }
    /// @inheritdoc IMerge
    function canMerge(
        LockedBalance memory _fromLocked,
        LockedBalance memory _toLocked
    ) public view returns (bool) {
        uint256 maxTime = IEscrowCurve(curve).maxTime();
        uint256 fromLockedEnd = _fromLocked.start + maxTime;
        uint256 toLockedEnd = _toLocked.start + maxTime;
        // Tokens either must have the same start dates or both must be mature.
        if (
            (_toLocked.start != _fromLocked.start) &&
            (toLockedEnd >= block.timestamp || fromLockedEnd >= block.timestamp)
        ) {
            return false;
        }
        return true;
    }
    /// @inheritdoc ISplit
    function split(uint256 _from, uint256 _value) public whenNotPaused returns (uint256) {
        if (_value == 0) revert ZeroAmount();
        address sender = _msgSender();
        // For some erc721, `ownerOf` reverts and for some,
        // it returns address(0). For safety, if it doesn't revert,
        // we also check if it's not address(0).
        address owner = IERC721EMB(lockNFT).ownerOf(_from);
        if (owner == address(0)) revert NoOwner();
        if (!canSplit(owner)) revert SplitNotWhitelisted();
        // Sender must either be approved or the owner.
        if (!isApprovedOrOwner(sender, _from)) revert NotApprovedOrOwner();
        LockedBalance memory locked_ = _locked[_from];
        if (locked_.amount <= _value) revert SplitAmountTooBig();
        // Ensure that amounts of new tokens will be greater than `minDeposit`.
        uint208 amount1 = locked_.amount - _value.toUint208();
        uint208 amount2 = _value.toUint208();
        if (amount1 < minDeposit || amount2 < minDeposit) {
            revert AmountTooSmall();
        }
        // update for `_from`.
        _checkpoint(_from, locked_, LockedBalance(amount1, locked_.start));
        _locked[_from] = LockedBalance(amount1, locked_.start);
        uint256 newTokenId = ++lastLockId;
        // owner gets minted a new tokenId. Since `split` function
        // just splits the same amount into two tokenIds, there's no need
        // to update voting power on ivotesAdapter, as total doesn't change.
        // We still call `_moveDelegateVotes` with zero LockedBalance to
        // make sure we update delegatee's token count due to newtokenId.
        IEscrowIVotesAdapter(ivotesAdapter).splitDelegateVotes(
            IDelegateMoveVoteRecipient.TokenLock(owner, _from, LockedBalance(0, 0)),
            IDelegateMoveVoteRecipient.TokenLock(owner, newTokenId, LockedBalance(0, 0))
        );
        // update for `newTokenId`.
        locked_.amount = amount2;
        _createSplitNFT(owner, newTokenId, locked_);
        emit Split(_from, newTokenId, sender, amount1, amount2);
        return newTokenId;
    }
    /// @notice creates a new token in checkpoint and mint.
    /// @param _to The address to which new token id will be minted
    /// @param _tokenId The id of the token that will be minted.
    /// @param _newLocked New locked amount / start lock time for the new token
    function _createSplitNFT(
        address _to,
        uint256 _tokenId,
        LockedBalance memory _newLocked
    ) private {
        _locked[_tokenId] = _newLocked;
        _checkpoint(_tokenId, LockedBalance(0, 0), _newLocked);
        IERC721EMB(lockNFT).mint(_to, _tokenId);
    }
    /// @notice Record per-user data to checkpoints. Used by VotingEscrow system.
    /// @param _tokenId NFT token ID.
    /// @dev Old locked balance is unused in the increasing case, at least in this implementation.
    /// @param _fromLocked New locked amount / start lock time for the user
    /// @param _newLocked New locked amount / start lock time for the user
    function _checkpoint(
        uint256 _tokenId,
        LockedBalance memory _fromLocked,
        LockedBalance memory _newLocked
    ) private {
        IEscrowCurve(curve).checkpoint(_tokenId, _fromLocked, _newLocked);
    }
    /*//////////////////////////////////////////////////////////////
                        Exit and Withdraw Logic
    //////////////////////////////////////////////////////////////*/
    /// @inheritdoc IVotingEscrowExiting
    function currentExitingAmount() public view returns (uint256 total) {
        IERC721EMB enumerable = IERC721EMB(lockNFT);
        uint256 balance = enumerable.balanceOf(address(this));
        for (uint256 i = 0; i < balance; i++) {
            uint256 tokenId = enumerable.tokenOfOwnerByIndex(address(this), i);
            total += locked(tokenId).amount;
        }
    }
    /// @notice Resets the votes and begins the withdrawal process for a given tokenId
    /// @dev Convenience function, the user must have authorized this contract to act on their behalf.
    ///      For backwards compatibility, even though `reset` call to gauge voter has been removed,
    ///      we still keep the function with the same name.
    function resetVotesAndBeginWithdrawal(uint256 _tokenId) external whenNotPaused {
        beginWithdrawal(_tokenId);
    }
    /// @notice Enters a tokenId into the withdrawal queue by transferring to this contract and creating a ticket.
    /// @param _tokenId The tokenId to begin withdrawal for. Will be transferred to this contract before burning.
    /// @dev The user must not have active votes in the voter contract.
    function beginWithdrawal(uint256 _tokenId) public nonReentrant whenNotPaused {
        // in the event of an increasing curve, 0 voting power means voting isn't active
        if (votingPower(_tokenId) == 0) revert CannotExit();
        // Safety checks:
        // 1. Prevent creating a lock and starting withdrawal in the same block.
        // 2. Prevent withdrawals if another token created in the same block
        //    was merged into `_tokenId`. Even though `_tokenId` itself was
        //    created in a previous block, the merged portion is "fresh" and
        //    would still be withdrawable without restriction.
        IEscrowCurve.TokenPoint memory point = IEscrowCurve(curve).tokenPointHistory(_tokenId, 1);
        if (
            block.timestamp == point.writtenTs || block.timestamp == mergeWithdrawalLock[_tokenId]
        ) {
            revert CannotWithdrawInSameBlock();
        }
        address owner = IERC721EMB(lockNFT).ownerOf(_tokenId);
        // we can remove the user's voting power as it's no longer locked
        LockedBalance memory locked_ = _locked[_tokenId];
        _checkpoint(_tokenId, locked_, LockedBalance(0, locked_.start));
        // transfer NFT to this and queue the exit
        IERC721EMB(lockNFT).transferFrom(_msgSender(), address(this), _tokenId);
        IExitQueue(queue).queueExit(_tokenId, owner);
    }
    /// @notice Allows cancellation of a pending withdrawal request
    /// @dev The caller must be one that also called `beginWithdrawal`.
    /// @param _tokenId The tokenId to cancel the withdrawal request for.
    function cancelWithdrawalRequest(uint256 _tokenId) public nonReentrant whenNotPaused {
        address owner = IExitQueue(queue).ticketHolder(_tokenId);
        address sender = _msgSender();
        if (owner != sender) {
            revert NotTicketHolder();
        }
        _checkpoint(_tokenId, LockedBalance(0, _locked[_tokenId].start), _locked[_tokenId]);
        IExitQueue(queue).cancelExit(_tokenId);
        IERC721EMB(lockNFT).transferFrom(address(this), sender, _tokenId);
    }
    /// @notice Withdraws tokens from the contract
    function withdraw(uint256 _tokenId) external nonReentrant whenNotPaused {
        address sender = _msgSender();
        // we force the sender to be the ticket holder
        if (!(IExitQueue(queue).ticketHolder(_tokenId) == sender)) revert NotTicketHolder();
        // check that this ticket can exit
        if (!(IExitQueue(queue).canExit(_tokenId))) revert CannotExit();
        LockedBalance memory oldLocked = _locked[_tokenId];
        uint256 value = oldLocked.amount;
        // check for fees to be transferred
        // do this before clearing the lock or it will be incorrect
        uint256 fee = IExitQueue(queue).exit(_tokenId);
        if (fee > 0) {
            IERC20(token).safeTransfer(address(queue), fee);
        }
        // clear out the token data
        _locked[_tokenId] = LockedBalance(0, 0);
        totalLocked -= value;
        // Burn the NFT and transfer the tokens to the user
        IERC721EMB(lockNFT).burn(_tokenId);
        IERC20(token).safeTransfer(sender, value - fee);
        emit Withdraw(sender, _tokenId, value - fee, block.timestamp, totalLocked);
    }
    /// @notice withdraw excess tokens from the contract - possibly by accident
    function sweep() external nonReentrant auth(SWEEPER_ROLE) {
        // if there are extra tokens in the contract
        // balance will be greater than the total locked
        uint balance = IERC20(token).balanceOf(address(this));
        uint excess = balance - totalLocked;
        // if there isn't revert the tx
        if (excess == 0) revert NothingToSweep();
        // if there is, send them to the caller
        IERC20(token).safeTransfer(_msgSender(), excess);
        emit Sweep(_msgSender(), excess);
    }
    /// @notice the sweeper can send NFTs mistakenly sent to the contract to a designated address
    /// @param _tokenId the tokenId to sweep - must be currently in this contract
    /// @param _to the address to send the NFT to - must be a whitelisted address for transfers
    /// @dev Cannot sweep NFTs that are in the exit queue for obvious reasons
    function sweepNFT(uint256 _tokenId, address _to) external nonReentrant auth(SWEEPER_ROLE) {
        // if the token id is not in the contract, revert
        if (IERC721EMB(lockNFT).ownerOf(_tokenId) != address(this)) revert NothingToSweep();
        // if the token id is in the queue, we cannot sweep it
        if (IExitQueue(queue).ticketHolder(_tokenId) != address(0)) revert CannotExit();
        IERC721EMB(lockNFT).transferFrom(address(this), _to, _tokenId);
        emit SweepNFT(_to, _tokenId);
    }
    /*//////////////////////////////////////////////////////////////
                        Moving Delegation Votes Logic
    //////////////////////////////////////////////////////////////*/
    /// @inheritdoc IDelegateMoveVoteCaller
    function moveDelegateVotes(address _from, address _to, uint256 _tokenId) public whenNotPaused {
        if (msg.sender != lockNFT) revert OnlyLockNFT();
        LockedBalance memory locked_ = _locked[_tokenId];
        _moveDelegateVotes(_from, _to, _tokenId, locked_);
    }
    function _moveDelegateVotes(
        address _from,
        address _to,
        uint256 _tokenId,
        LockedBalance memory _lockedBalance
    ) private {
        IEscrowIVotesAdapter(ivotesAdapter).moveDelegateVotes(_from, _to, _tokenId, _lockedBalance);
    }
    function updateVotingPower(address _from, address _to) public whenNotPaused {
        if (msg.sender != ivotesAdapter) revert OnlyIVotesAdapter();
        IAddressGaugeVoter(voter).updateVotingPower(_from, _to);
    }
    /*///////////////////////////////////////////////////////////////
                            UUPS Upgrade
    //////////////////////////////////////////////////////////////*/
    /// @notice Returns the address of the implementation contract in the [proxy storage slot](https://eips.ethereum.org/EIPS/eip-1967) slot the [UUPS proxy](https://eips.ethereum.org/EIPS/eip-1822) is pointing to.
    /// @return The address of the implementation contract.
    function implementation() public view returns (address) {
        return _getImplementation();
    }
    /// @notice Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)).
    function _authorizeUpgrade(address) internal virtual override auth(ESCROW_ADMIN_ROLE) {}
    /// @dev Reserved storage space to allow for layout changes in the future.
    ///      Please note that the reserved slot number in previous version(39) was set
    ///      incorrectly as 39 instead of 40. Changing it to 40 now would overwrite existing slot values,
    ///      resulting in the loss of state. Therefore, we will continue using 37 in this version.
    ///      For future versions, any new variables should be added by subtracting from 37.
    uint256[36] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);
    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);
    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);
    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);
    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);
    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);
    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);
    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);
    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
    IERC721Enumerable
} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IERC721EnumerableMintableBurnable is IERC721Enumerable {
    function mint(address to, uint256 tokenId) external;
    function burn(uint256 tokenId) external;
    function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);
}// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.8; /// @title IDAO /// @author Aragon X - 2022-2024 /// @notice The interface required for DAOs within the Aragon App DAO framework. /// @custom:security-contact [email protected] interface IDAO { /// @notice Checks if an address has permission on a contract via a permission identifier and considers if `ANY_ADDRESS` was used in the granting process. /// @param _where The address of the contract. /// @param _who The address of a EOA or contract to give the permissions. /// @param _permissionId The permission identifier. /// @param _data The optional data passed to the `PermissionCondition` registered. /// @return Returns true if the address has permission, false if not. function hasPermission( address _where, address _who, bytes32 _permissionId, bytes memory _data ) external view returns (bool); /// @notice Updates the DAO metadata (e.g., an IPFS hash). /// @param _metadata The IPFS hash of the new metadata object. function setMetadata(bytes calldata _metadata) external; /// @notice Emitted when the DAO metadata is updated. /// @param metadata The IPFS hash of the new metadata object. event MetadataSet(bytes metadata); /// @notice Emitted when a standard callback is registered. /// @param interfaceId The ID of the interface. /// @param callbackSelector The selector of the callback function. /// @param magicNumber The magic number to be registered for the callback function selector. event StandardCallbackRegistered( bytes4 interfaceId, bytes4 callbackSelector, bytes4 magicNumber ); /// @notice Deposits (native) tokens to the DAO contract with a reference string. /// @param _token The address of the token or address(0) in case of the native token. /// @param _amount The amount of tokens to deposit. /// @param _reference The reference describing the deposit reason. function deposit(address _token, uint256 _amount, string calldata _reference) external payable; /// @notice Emitted when a token deposit has been made to the DAO. /// @param sender The address of the sender. /// @param token The address of the deposited token. /// @param amount The amount of tokens deposited. /// @param _reference The reference describing the deposit reason. event Deposited( address indexed sender, address indexed token, uint256 amount, string _reference ); /// @notice Emitted when a native token deposit has been made to the DAO. /// @dev This event is intended to be emitted in the `receive` function and is therefore bound by the gas limitations for `send`/`transfer` calls introduced by [ERC-2929](https://eips.ethereum.org/EIPS/eip-2929). /// @param sender The address of the sender. /// @param amount The amount of native tokens deposited. event NativeTokenDeposited(address sender, uint256 amount); /// @notice Setter for the trusted forwarder verifying the meta transaction. /// @param _trustedForwarder The trusted forwarder address. function setTrustedForwarder(address _trustedForwarder) external; /// @notice Getter for the trusted forwarder verifying the meta transaction. /// @return The trusted forwarder address. function getTrustedForwarder() external view returns (address); /// @notice Emitted when a new TrustedForwarder is set on the DAO. /// @param forwarder the new forwarder address. event TrustedForwarderSet(address forwarder); /// @notice Checks whether a signature is valid for a provided hash according to [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271). /// @param _hash The hash of the data to be signed. /// @param _signature The signature byte array associated with `_hash`. /// @return Returns the `bytes4` magic value `0x1626ba7e` if the signature is valid and `0xffffffff` if not. function isValidSignature(bytes32 _hash, bytes memory _signature) external returns (bytes4); /// @notice Registers an ERC standard having a callback by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and callback function signature. /// @param _interfaceId The ID of the interface. /// @param _callbackSelector The selector of the callback function. /// @param _magicNumber The magic number to be registered for the function signature. function registerStandardCallback( bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber ) external; /// @notice Removed function being left here to not corrupt the IDAO interface ID. Any call will revert. /// @dev Introduced in v1.0.0. Removed in v1.4.0. function setSignatureValidator(address) external; }
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IGaugeVoter.sol";
interface IAddressGaugeVote {
    /// @param votes gauge => votes cast at that time
    /// @param gaugesVotedFor array of gauges we have active votes for
    /// @param usedVotingPower total voting power used at the time of the vote
    /// @dev this changes so we need an historic snapshot
    /// @param lastVoted is the last time the user voted
    struct AddressVoteData {
        mapping(address => uint256) voteWeights;
        address[] gaugesVotedFor;
        uint256 usedVotingPower;
        uint256 lastVoted;
    }
    /// @param weight proportion of voting power the address will allocate to the gauge. Will be normalised.
    /// @param gauge address of the gauge to vote for
    struct GaugeVote {
        uint256 weight;
        address gauge;
    }
}
/*///////////////////////////////////////////////////////////////
                            Gauge Voter
//////////////////////////////////////////////////////////////*/
interface IAddressGaugeVoterEvents {
    /// @param votingPowerCastForGauge votes cast by this address for this gauge in this vote
    /// @param totalVotingPowerInGauge total voting power in the gauge at the time of the vote, after applying the vote
    /// @param totalVotingPowerInContract total voting power in the contract at the time of the vote, after applying the vote
    event Voted(
        address indexed voter,
        address indexed gauge,
        uint256 indexed epoch,
        uint256 votingPowerCastForGauge,
        uint256 totalVotingPowerInGauge,
        uint256 totalVotingPowerInContract,
        uint256 timestamp
    );
    /// @param votingPowerRemovedFromGauge votes removed by this address for this gauge, at the time of this rest
    /// @param totalVotingPowerInGauge total voting power in the gauge at the time of the reset, after applying the reset
    /// @param totalVotingPowerInContract total voting power in the contract at the time of the reset, after applying the reset
    event Reset(
        address indexed voter,
        address indexed gauge,
        uint256 indexed epoch,
        uint256 votingPowerRemovedFromGauge,
        uint256 totalVotingPowerInGauge,
        uint256 totalVotingPowerInContract,
        uint256 timestamp
    );
}
interface IAddressGaugeVoterErrors {
    error VotingInactive();
    error NotApprovedOrOwner();
    error GaugeDoesNotExist(address _pool);
    error GaugeInactive(address _gauge);
    error DoubleVote();
    error NoVotes();
    error NoVotingPower();
    error NotCurrentlyVoting();
    error OnlyEscrow();
    error UpdateVotingPowerHookNotEnabled();
    error AlreadyVoted(address _address);
}
interface IAddressGaugeVoter is
    IAddressGaugeVoterEvents,
    IAddressGaugeVoterErrors,
    IAddressGaugeVote,
    IGaugeManager,
    IGauge
{
    /// @notice Called by users to vote for pools. Votes distributed proportionally based on weights.
    /// @param _votes       Array of votes to be cast, contains gauge address and weight.
    function vote(GaugeVote[] memory _votes) external;
    /// @notice Called by users to reset voting state. Required when withdrawing or transferring veNFT.
    function reset() external;
    /// @notice Can be called to check if an address is currently voting
    function isVoting(address _address) external view returns (bool);
    function updateVotingPower(address _from, address _to) external;
}
/*///////////////////////////////////////////////////////////////
                      Address Gauge Voter
//////////////////////////////////////////////////////////////*/
interface IAddressGaugeVoterStorageEventsErrors is
    IGaugeManagerEvents,
    IGaugeManagerErrors,
    IAddressGaugeVoterEvents,
    IAddressGaugeVoterErrors
{
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IEscrowCurveIncreasing.sol";
import "../IDeprecated.sol";
/*///////////////////////////////////////////////////////////////
                        Global Curve
//////////////////////////////////////////////////////////////*/
interface IEscrowCurveGlobalStorage {
    /// @notice Captures the shape of the aggregate voting curve at a specific point in time
    /// @param bias The y intercept of the aggregate voting curve at the given time
    /// @param slope The slope of the aggregate voting curve at the given time
    /// @param writtenTs The timestamp at which the we last updated the aggregate voting curve
    struct GlobalPoint {
        int256 bias;
        int256 slope;
        uint48 writtenTs;
    }
}
interface IEscrowCurveGlobal is IEscrowCurveGlobalStorage {
    /// @notice Returns the global point at the passed epoch
    /// @param _index The index in an array to return the point for
    function globalPointHistory(uint256 _index) external view returns (GlobalPoint memory);
}
/*///////////////////////////////////////////////////////////////
                        Token Curve
//////////////////////////////////////////////////////////////*/
interface IEscrowCurveTokenV1_2_0 is IEscrowCurveTokenStorage {
    /// @notice Returns the latest index of the tokenId which can be used
    ///         to retrive token point from `tokenPointHistory` function.
    /// @dev This has been renamed to `tokenPointLatestIndex` in the latest upgrade, but
    ///      for backwards-compatibility, the function still stays in the contract.
    ///      Note that we treat it as deprecated, So use `tokenPointLatestIndex` instead.
    /// @return The latest index of the token id.
    function tokenPointIntervals(uint256 _tokenId) external view returns (uint256);
    /// @notice Returns the latest index of the tokenId which can be used
    ///         to retrive token point from `tokenPointHistory` function.
    /// @param _tokenId The NFT to return the latest token point index
    /// @return The latest index of the token id.
    function tokenPointLatestIndex(uint256 _tokenId) external view returns (uint256);
    /// @notice Returns the TokenPoint at the passed `_index`.
    /// @param _tokenId The NFT to return the TokenPoint for
    /// @param _index The index to return the TokenPoint at.
    function tokenPointHistory(
        uint256 _tokenId,
        uint256 _index
    ) external view returns (TokenPoint memory);
}
interface IEscrowCurveMaxTime is IEscrowCurveErrorsAndEvents {
    /// @return The max time allowed for the lock duration.
    function maxTime() external view returns (uint256);
}
/*///////////////////////////////////////////////////////////////
                        INCREASING CURVE
//////////////////////////////////////////////////////////////*/
interface IEscrowCurveIncreasingV1_2_0 is
    IEscrowCurveCore,
    IEscrowCurveMath,
    IEscrowCurveTokenV1_2_0,
    IEscrowCurveMaxTime,
    IEscrowCurveGlobal,
    IDeprecated
{}
interface IEscrowCurveIncreasingV1_2_0_NoSupply is
    IEscrowCurveCore,
    IEscrowCurveMath,
    IEscrowCurveTokenV1_2_0,
    IEscrowCurveMaxTime,
    IDeprecated
{}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IExitQueueCoreErrorsAndEvents {
    error OnlyEscrow();
    error AlreadyQueued();
    error ZeroAddress();
    error CannotExit();
    error NoLockBalance();
    event ExitQueued(uint256 indexed tokenId, address indexed holder, uint256 exitDate);
    event Exit(uint256 indexed tokenId, uint256 fee);
}
interface ITicket {
    struct Ticket {
        address holder;
        uint256 exitDate;
    }
}
/*///////////////////////////////////////////////////////////////
                        Fee Collection
//////////////////////////////////////////////////////////////*/
interface IExitQueueFeeErrorsAndEvents {
    error FeeTooHigh(uint256 maxFee);
    event Withdraw(address indexed to, uint256 amount);
    event FeePercentSet(uint256 feePercent);
}
interface IExitQueueFee is IExitQueueFeeErrorsAndEvents {
    /// @notice optional fee charged for exiting the queue
    function feePercent() external view returns (uint256);
    /// @notice The exit queue manager can set the fee
    function setFeePercent(uint256 _fee) external;
    /// @notice withdraw accumulated fees
    function withdraw(uint256 _amount) external;
}
/*///////////////////////////////////////////////////////////////
                        Cooldown
//////////////////////////////////////////////////////////////*/
interface IExitQueueCooldownErrorsAndEvents {
    error CooldownTooHigh();
    event CooldownSet(uint48 cooldown);
}
interface IExitQueueCooldown is IExitQueueCooldownErrorsAndEvents {
    /// @notice time in seconds between exit and withdrawal
    function cooldown() external view returns (uint48);
    /// @notice The exit queue manager can set the cooldown period
    /// @param _cooldown time in seconds between exit and withdrawal
    function setCooldown(uint48 _cooldown) external;
}
/*///////////////////////////////////////////////////////////////
                        Min Lock
//////////////////////////////////////////////////////////////*/
interface IExitMinLockCooldownErrorsAndEvents {
    event MinLockSet(uint48 minLock);
    error MinLockOutOfBounds();
    error MinLockNotReached(uint256 tokenId, uint48 minLock, uint48 earliestExitDate);
}
interface IExitQueueMinLock is IExitMinLockCooldownErrorsAndEvents {
    /// @notice minimum time from the original lock date before one can enter the queue
    function minLock() external view returns (uint48);
    /// @notice The exit queue manager can set the minimum lock time
    function setMinLock(uint48 _cooldown) external;
}
/*///////////////////////////////////////////////////////////////
                        Exit Queue
//////////////////////////////////////////////////////////////*/
interface IExitQueueCancelErrorsAndEvents {
    error CannotCancelExit();
    event ExitCancelled(uint256 indexed tokenId, address indexed holder);
}
interface IExitQueueCancel {
    function cancelExit(uint256 _tokenId) external;
}
/*///////////////////////////////////////////////////////////////
                        Exit Queue
//////////////////////////////////////////////////////////////*/
interface IExitQueueErrorsAndEvents is
    IExitQueueCoreErrorsAndEvents,
    IExitQueueFeeErrorsAndEvents,
    IExitQueueCooldownErrorsAndEvents,
    IExitMinLockCooldownErrorsAndEvents,
    IExitQueueCancelErrorsAndEvents
{}
interface IExitQueue is
    IExitQueueErrorsAndEvents,
    ITicket,
    IExitQueueFee,
    IExitQueueCooldown,
    IExitQueueMinLock,
    IExitQueueCancel
{
    /// @notice tokenId => Ticket
    function queue(uint256 _tokenId) external view returns (Ticket memory);
    /// @notice queue an exit for a given tokenId, granting the ticket to the passed holder
    /// @param _tokenId the tokenId to queue an exit for
    /// @param _ticketHolder the address that will be granted the ticket
    function queueExit(uint256 _tokenId, address _ticketHolder) external;
    function cancelExit(uint256 _tokenId) external;
    /// @notice exit the queue for a given tokenId. Requires the cooldown period to have passed
    /// @return exitAmount the amount of tokens that can be withdrawn
    function exit(uint256 _tokenId) external returns (uint256 exitAmount);
    /// @return true if the tokenId corresponds to a valid ticket and the cooldown period has passed
    function canExit(uint256 _tokenId) external view returns (bool);
    /// @return the ticket holder for a given tokenId
    function ticketHolder(uint256 _tokenId) external view returns (address);
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IVotingEscrowIncreasing.sol";
import {IEscrowIVotesAdapter, IDelegateUpdateVotingPower} from "@delegation/IEscrowIVotesAdapter.sol";
interface IVotingEscrowExiting {
    /// @notice How much amount has been exiting.
    /// @return total The total amount for which beginWithdrawal has been called
    ///         but withdraw has not yet been executed.
    function currentExitingAmount() external view returns (uint256);
}
interface IMergeEventsAndErrors {
    event Merged(
        address indexed _sender,
        uint256 indexed _from,
        uint256 indexed _to,
        uint208 _amountFrom,
        uint208 _amountTo,
        uint208 _amountFinal
    );
    error CannotMerge(uint256 _from, uint256 _to);
    error SameNFT();
}
interface IMerge is ILockedBalanceIncreasing, IMergeEventsAndErrors {
    /// @notice Merge two tokens - i.e  `from` into `_to`.
    /// @param _from The token id from which merge is occuring
    /// @param _to The token id to which `_from` is merging
    function merge(uint256 _from, uint256 _to) external;
    /// @notice Whether 2 tokens can be merged.
    /// @param _from The token id from which merge should occur.
    /// @param _to The token id to which `_from` should merge.
    function canMerge(
        LockedBalance memory _from,
        LockedBalance memory _to
    ) external view returns (bool);
}
interface ISplitEventsAndErrors {
    event Split(
        uint256 indexed _from,
        uint256 indexed newTokenId,
        address _sender,
        uint208 _splitAmount1,
        uint208 _splitAmount2
    );
    event SplitWhitelistSet(address indexed account, bool status);
    error SplitNotWhitelisted();
    error SplitAmountTooBig();
}
interface ISplit is ISplitEventsAndErrors {
    /// @notice Split token into two new, separate tokens.
    /// @param _from The token id that should be split
    /// @param _value The amount that determines how token is split
    /// @return _newTokenId The new token id after split.
    function split(
        uint256 _from,
        uint256 _value
    ) external returns (uint256 _newTokenId);
}
interface IDelegateMoveVoteCaller {
    /// @notice After a token transfer, decreases `_from`'s voting power and increases `_to`'s voting power.
    /// @dev Called upon a token transfer.
    /// @param _from The current delegatee of `_tokenId`.
    /// @param _to The new delegatee of `_tokenId`
    /// @param _tokenId The token id that is being transferred.
    function moveDelegateVotes(
        address _from,
        address _to,
        uint256 _tokenId
    ) external;
}
interface IVotingEscrowIncreasingV1_2_0 is
    IVotingEscrowIncreasing,
    IVotingEscrowExiting,
    IMerge,
    ISplit,
    IDelegateUpdateVotingPower,
    IDelegateMoveVoteCaller
{}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IClock.sol";
interface IClockV1_2_0 is IClock {
    function epochPrevCheckpointTs() external view returns (uint256);
    function resolveEpochPrevCheckpointTs(uint256 timestamp) external pure returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../extensions/IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";
/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using AddressUpgradeable for address;
    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }
    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }
    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }
    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }
    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }
    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }
    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20PermitUpgradeable token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }
    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.
        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }
    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.
        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));
    }
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.0;
/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCastUpgradeable {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }
    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }
    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }
    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }
    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }
    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }
    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }
    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }
    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }
    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }
    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }
    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }
    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }
    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }
    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }
    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v2.5._
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }
    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }
    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }
    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }
    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }
    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }
    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }
    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }
    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v2.5._
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }
    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }
    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }
    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }
    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v2.5._
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }
    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }
    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v2.5._
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }
    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v2.5._
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }
    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     *
     * _Available since v3.0._
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }
    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
    }
    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
    }
    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
    }
    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.7._
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
    }
    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
    }
    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
    }
    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
    }
    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
    }
    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
    }
    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
    }
    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
    }
    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
    }
    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
    }
    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
    }
    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
    }
    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
    }
    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
    }
    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
    }
    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
    }
    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.7._
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
    }
    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
    }
    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
    }
    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
    }
    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
    }
    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
    }
    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
    }
    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
    }
    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
    }
    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
    }
    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
    }
    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
    }
    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.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 Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }
    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @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;
    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.
    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;
    uint256 private _status;
    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }
    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }
    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }
    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }
    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);
    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);
    bool private _paused;
    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }
    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }
    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }
    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }
    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }
    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }
    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }
    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }
    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.8;
import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {IDAO} from "../../dao/IDAO.sol";
import {_auth} from "./auth.sol";
/// @title DaoAuthorizableUpgradeable
/// @author Aragon X - 2022-2023
/// @notice An abstract contract providing a meta-transaction compatible modifier for upgradeable or cloneable contracts to authorize function calls through an associated DAO.
/// @dev Make sure to call `__DaoAuthorizableUpgradeable_init` during initialization of the inheriting contract.
/// @custom:security-contact [email protected]
abstract contract DaoAuthorizableUpgradeable is ContextUpgradeable {
    /// @notice The associated DAO managing the permissions of inheriting contracts.
    IDAO private dao_;
    /// @notice Initializes the contract by setting the associated DAO.
    /// @param _dao The associated DAO address.
    // solhint-disable-next-line func-name-mixedcase
    function __DaoAuthorizableUpgradeable_init(IDAO _dao) internal onlyInitializing {
        dao_ = _dao;
    }
    /// @notice Returns the DAO contract.
    /// @return The DAO contract.
    function dao() public view returns (IDAO) {
        return dao_;
    }
    /// @notice A modifier to make functions on inheriting contracts authorized. Permissions to call the function are checked through the associated DAO's permission manager.
    /// @param _permissionId The permission identifier required to call the method this modifier is applied to.
    modifier auth(bytes32 _permissionId) {
        _auth(dao_, address(this), _msgSender(), _permissionId, _msgData());
        _;
    }
    /// @notice This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain (see [OpenZeppelin's guide about storage gaps](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps)).
    uint256[49] private __gap;
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
    IVotesUpgradeable
} from "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol";
import {ILockedBalanceIncreasing} from "@escrow/IVotingEscrowIncreasing.sol";
interface IEscrowIVotesAdapterErrorsAndEvents {
    event AutoDelegationDisabledSet(address indexed delegate, bool enabled);
    event TokensDelegated(address indexed sender, address indexed delegatee, uint256[] tokenIds);
    event TokensUndelegated(address indexed sender, address indexed delegatee, uint256[] tokenIds);
    error OnlyEscrow();
    error DelegateBySigNotSupported();
    error NotApprovedOrOwner();
    error InvalidTokenId();
    error DelegationNotAllowed();
    error DelegateeNotSet();
    error TokenAlreadyDelegated(uint256 tokenId);
    error TokenNotDelegated(uint256 tokenId);
    error VotingPowerZero(uint256 tokenId);
    error TokenListEmpty();
    error ZeroTransition();
}
interface IDelegateMoveVoteRecipient {
    struct TokenLock {
        address account;
        uint256 tokenId;
        ILockedBalanceIncreasing.LockedBalance locked;
    }
    /// @notice The hook function that is called upon `split`.
    function splitDelegateVotes(TokenLock calldata _from, TokenLock calldata _to) external;
    /// @notice The hook function that is called upon `merge`.
    function mergeDelegateVotes(TokenLock calldata _from, TokenLock calldata _to) external;
    /// @notice After a token transfer, decreases `_from`'s voting power and increases `_to`'s voting power.
    /// @dev Called upon a token transfer or create lock.
    /// @param _from The current delegatee of `_tokenId`.
    /// @param _to The new delegatee of `_tokenId`
    /// @param _tokenId The token id that is being transferred.
    /// @param _locked The lock data of the token.
    function moveDelegateVotes(
        address _from,
        address _to,
        uint256 _tokenId,
        ILockedBalanceIncreasing.LockedBalance memory _locked
    ) external;
}
interface IDelegateUpdateVotingPower {
    /// @notice Updates current voting power of `_from` and `_to`.
    /// @dev Called upon a token transfer and delegate/undelegate.
    function updateVotingPower(address _from, address _to) external;
}
interface IEscrowIVotesAdapterStorage {
    struct GlobalPoint {
        int256 bias;
        int256 slope;
        uint48 writtenTs;
    }
}
interface IEscrowIVotesAdapter is
    IEscrowIVotesAdapterErrorsAndEvents,
    IEscrowIVotesAdapterStorage,
    IDelegateMoveVoteRecipient,
    IVotesUpgradeable
{
    /// @notice Allows to delegate `_tokenIds` to the current delegatee
    ///         which is set by IVotes's `delegate` function.
    /// @param _tokenIds The list of token ids that are being delegated.
    function delegate(uint256[] calldata _tokenIds) external;
    /// @notice Allows to un-delegate `_tokenIds` from the current delegatee
    ///         which was set by delegate.
    /// @param _tokenIds The list of token ids that are being un-delegated.
    function undelegate(uint256[] calldata _tokenIds) external;
    /// @notice Check if the token is currently delegated or not.
    function tokenIsDelegated(uint256 _tokenId) external view returns (bool);
    /// @notice Returns the current delegatee of `_account`.
    function delegates(address _account) external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);
    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IGauge {
    /// @param metadataURI URI for the metadata of the gauge
    struct Gauge {
        bool active;
        uint256 created; // timestamp or epoch
        string metadataURI;
        // more space for data as this is a struct in a mapping
    }
}
/*///////////////////////////////////////////////////////////////
                            Gauge Manager
//////////////////////////////////////////////////////////////*/
interface IGaugeManagerEvents {
    event GaugeCreated(address indexed gauge, address indexed creator, string metadataURI);
    event GaugeDeactivated(address indexed gauge);
    event GaugeActivated(address indexed gauge);
    event GaugeMetadataUpdated(address indexed gauge, string metadataURI);
}
interface IGaugeManagerErrors {
    error ZeroGauge();
    error GaugeActivationUnchanged();
    error GaugeExists();
}
interface IGaugeManager is IGaugeManagerEvents, IGaugeManagerErrors {
    function isActive(address gauge) external view returns (bool);
    function createGauge(address _gauge, string calldata _metadata) external returns (address);
    function deactivateGauge(address _gauge) external;
    function activateGauge(address _gauge) external;
    function updateGaugeMetadata(address _gauge, string calldata _metadata) external;
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ILockedBalanceIncreasing} from "@escrow/IVotingEscrowIncreasing.sol";
/*///////////////////////////////////////////////////////////////
                        Token Curve
//////////////////////////////////////////////////////////////*/
interface IEscrowCurveTokenStorage {
    /// @notice Captures the shape of the user's voting curve at a specific point in time
    /// @param bias The y intercept of the user's voting curve at the given time
    /// @param checkpointTs The checkpoint when the user voting curve is/was/will be updated
    /// @param writtenTs The timestamp at which we locked the checkpoint
    /// @param coefficients The coefficients of the curve, supports up to quadratic curves.
    /// @dev Coefficients are stored in the following order: [constant, linear, quadratic]
    /// and not all coefficients are used for all curves.
    struct TokenPoint {
        uint256 bias;
        uint128 checkpointTs;
        uint128 writtenTs;
        int256[3] coefficients;
    }
}
interface IEscrowCurveToken is IEscrowCurveTokenStorage {
    /// @notice returns the token point at time `timestamp`
    function tokenPointIntervals(uint256 timestamp) external view returns (uint256);
    /// @notice Returns the TokenPoint at the passed epoch
    /// @param _tokenId The NFT to return the TokenPoint for
    /// @param _loc The epoch to return the TokenPoint at
    function tokenPointHistory(
        uint256 _tokenId,
        uint256 _loc
    ) external view returns (TokenPoint memory);
}
/*///////////////////////////////////////////////////////////////
                        Core Functions
//////////////////////////////////////////////////////////////*/
interface IEscrowCurveErrorsAndEvents {
    error InvalidTokenId();
    error InvalidCheckpoint();
    error OnlyEscrow();
    error CheckpointOnDepositIntervalNotAllowed();
    error InvalidLocks(
        uint256 tokenId,
        ILockedBalanceIncreasing.LockedBalance fromLocked,
        ILockedBalanceIncreasing.LockedBalance newLocked
    );
}
interface IEscrowCurveCore is IEscrowCurveErrorsAndEvents {
    /// @notice Get the current voting power for `_tokenId`
    /// @dev Adheres to the ERC20 `balanceOf` interface for Aragon compatibility
    ///      Fetches last token point prior to a certain timestamp, then walks forward to timestamp.
    /// @param _tokenId NFT for lock
    /// @param _t Epoch time to return voting power at
    /// @return Token voting power
    function votingPowerAt(uint256 _tokenId, uint256 _t) external view returns (uint256);
    /// @notice Calculate total voting power at some point in the past
    /// @param _t Time to calculate the total voting power at
    /// @return Total voting power at that time
    function supplyAt(uint256 _t) external view returns (uint256);
    /// @notice Writes a snapshot of voting power at the current epoch
    /// @param _tokenId Snapshot a specific token
    /// @param _oldLocked The token's previous locked balance
    /// @param _newLocked The token's new locked balance
    function checkpoint(
        uint256 _tokenId,
        ILockedBalanceIncreasing.LockedBalance memory _oldLocked,
        ILockedBalanceIncreasing.LockedBalance memory _newLocked
    ) external;
}
interface IEscrowCurveMath {
    /// @notice Preview the curve coefficients for curves up to quadratic.
    /// @param amount The amount of tokens to calculate the coefficients for - given a fixed algebraic representation
    /// @return coefficients in the form [constant, linear, quadratic]
    /// @dev Not all coefficients are used for all curves
    function getCoefficients(uint256 amount) external view returns (int256[3] memory coefficients);
    /// @notice Bias is the token's voting weight
    function getBias(uint256 timeElapsed, uint256 amount) external view returns (uint256 bias);
}
/*///////////////////////////////////////////////////////////////
                        WARMUP CURVE
//////////////////////////////////////////////////////////////*/
interface IWarmupEvents {
    event WarmupSet(uint48 warmup);
}
interface IWarmup is IWarmupEvents {
    /// @notice Set the warmup period for the curve
    function setWarmupPeriod(uint48 _warmup) external;
    /// @notice the warmup period for the curve
    function warmupPeriod() external view returns (uint48);
    /// @notice check if the curve is past the warming period
    function isWarm(uint256 _tokenId) external view returns (bool);
}
/*///////////////////////////////////////////////////////////////
                        INCREASING CURVE
//////////////////////////////////////////////////////////////*/
/// @dev first version only accounts for token-level point histories
interface IEscrowCurveIncreasing is
    IEscrowCurveCore,
    IEscrowCurveMath,
    IEscrowCurveToken,
    IWarmup
{}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;
interface IDeprecated {
    /// @notice This function is deprecated and should not be used.
    error Deprecated();
}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*///////////////////////////////////////////////////////////////
                        CORE FUNCTIONALITY
//////////////////////////////////////////////////////////////*/
interface ILockedBalanceIncreasing {
    struct LockedBalance {
        uint208 amount;
        uint48 start; // mirrors oz ERC20 timestamp clocks
    }
}
interface IVotingEscrowCoreErrors {
    error NoLockFound();
    error NotOwner();
    error NoOwner();
    error NotSameOwner();
    error NonExistentToken();
    error NotApprovedOrOwner();
    error ZeroAddress();
    error ZeroAmount();
    error ZeroBalance();
    error SameAddress();
    error LockNFTAlreadySet();
    error MustBe18Decimals();
    error TransferBalanceIncorrect();
    error AmountTooSmall();
    error OnlyLockNFT();
    error OnlyIVotesAdapter();
    error AddressAlreadySet();
}
interface IVotingEscrowCoreEvents {
    event MinDepositSet(uint256 minDeposit);
    event Deposit(
        address indexed depositor,
        uint256 indexed tokenId,
        uint256 indexed startTs,
        uint256 value,
        uint256 newTotalLocked
    );
    event Withdraw(
        address indexed depositor,
        uint256 indexed tokenId,
        uint256 value,
        uint256 ts,
        uint256 newTotalLocked
    );
}
interface IVotingEscrowCore is
    ILockedBalanceIncreasing,
    IVotingEscrowCoreErrors,
    IVotingEscrowCoreEvents
{
    /// @notice Address of the underying ERC20 token.
    function token() external view returns (address);
    /// @notice Address of the lock receipt NFT.
    function lockNFT() external view returns (address);
    /// @notice Total underlying tokens deposited in the contract
    function totalLocked() external view returns (uint256);
    /// @notice Get the raw locked balance for `_tokenId`
    function locked(uint256 _tokenId) external view returns (LockedBalance memory);
    /// @notice Deposit `_value` tokens for `msg.sender`
    /// @param _value Amount to deposit
    /// @return TokenId of created veNFT
    function createLock(uint256 _value) external returns (uint256);
    /// @notice Deposit `_value` tokens for `_to`
    /// @param _value Amount to deposit
    /// @param _to Address to deposit
    /// @return TokenId of created veNFT
    function createLockFor(uint256 _value, address _to) external returns (uint256);
    /// @notice Withdraw all tokens for `_tokenId`
    function withdraw(uint256 _tokenId) external;
    /// @notice helper utility for NFT checks
    function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);
}
/*///////////////////////////////////////////////////////////////
                        WITHDRAWAL QUEUE
//////////////////////////////////////////////////////////////*/
interface IWithdrawalQueueErrors {
    error NotTicketHolder();
    error CannotExit();
    error CannotWithdrawInSameBlock();
}
interface IWithdrawalQueueEvents {}
interface IWithdrawalQueue is IWithdrawalQueueErrors, IWithdrawalQueueEvents {
    /// @notice Enters a tokenId into the withdrawal queue by transferring to this contract and creating a ticket.
    /// @param _tokenId The tokenId to begin withdrawal for. Will be transferred to this contract before burning.
    /// @dev The user must not have active votes in the voter contract.
    function beginWithdrawal(uint256 _tokenId) external;
    /// @notice Address of the contract that manages exit queue logic for withdrawals
    function queue() external view returns (address);
}
/*///////////////////////////////////////////////////////////////
                        SWEEPER
//////////////////////////////////////////////////////////////*/
interface ISweeperEvents {
    event Sweep(address indexed to, uint256 amount);
    event SweepNFT(address indexed to, uint256 tokenId);
}
interface ISweeperErrors {
    error NothingToSweep();
}
interface ISweeper is ISweeperEvents, ISweeperErrors {
    /// @notice sweeps excess tokens from the contract to a designated address
    function sweep() external;
    function sweepNFT(uint256 _tokenId, address _to) external;
}
/*///////////////////////////////////////////////////////////////
                        DYNAMIC VOTER
//////////////////////////////////////////////////////////////*/
interface IDynamicVoterErrors {
    error NotVoter();
    error OwnershipChange();
    error AlreadyVoted();
}
interface IDynamicVoter is IDynamicVoterErrors {
    /// @notice Address of the voting contract.
    /// @dev We need to ensure votes are not left in this contract before allowing positing changes
    function voter() external view returns (address);
    /// @notice Address of the voting Escrow Curve contract that will calculate the voting power
    function curve() external view returns (address);
    /// @notice Get the voting power for _tokenId at the current timestamp
    /// @dev Returns 0 if called in the same block as a transfer.
    /// @param _tokenId .
    /// @return Voting power
    function votingPower(uint256 _tokenId) external view returns (uint256);
    /// @notice Get the voting power for _tokenId at a given timestamp
    /// @param _tokenId .
    /// @param _t Timestamp to query voting power
    /// @return Voting power
    function votingPowerAt(uint256 _tokenId, uint256 _t) external view returns (uint256);
    /// @notice Get the voting power for _account at the current timestamp
    /// Aggregtes all voting power for all tokens owned by the account
    /// @dev This cannot be used historically without token snapshots
    function votingPowerForAccount(address _account) external view returns (uint256);
    /// @notice Calculate total voting power at current timestamp
    /// @return Total voting power at current timestamp
    function totalVotingPower() external view returns (uint256);
    /// @notice Calculate total voting power at a given timestamp
    /// @param _t Timestamp to query total voting power
    /// @return Total voting power at given timestamp
    function totalVotingPowerAt(uint256 _t) external view returns (uint256);
    /// @notice See if a queried _tokenId has actively voted
    /// @return True if voted, else false
    function isVoting(uint256 _tokenId) external view returns (bool);
    /// @notice Set the global state voter
    function setVoter(address _voter) external;
}
/*///////////////////////////////////////////////////////////////
                        INCREASED ESCROW
//////////////////////////////////////////////////////////////*/
interface IVotingEscrowIncreasing is IVotingEscrowCore, IDynamicVoter, IWithdrawalQueue, ISweeper {}
/// @dev useful for testing
interface IVotingEscrowEventsStorageErrorsEvents is
    IVotingEscrowCoreErrors,
    IVotingEscrowCoreEvents,
    IWithdrawalQueueErrors,
    IWithdrawalQueueEvents,
    ILockedBalanceIncreasing,
    ISweeperEvents,
    ISweeperErrors
{}/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IClockUser {
    function clock() external view returns (address);
}
interface IClock {
    function epochDuration() external pure returns (uint256);
    function checkpointInterval() external pure returns (uint256);
    function voteDuration() external pure returns (uint256);
    function voteWindowBuffer() external pure returns (uint256);
    function currentEpoch() external view returns (uint256);
    function resolveEpoch(uint256 timestamp) external pure returns (uint256);
    function elapsedInEpoch() external view returns (uint256);
    function resolveElapsedInEpoch(uint256 timestamp) external pure returns (uint256);
    function epochStartsIn() external view returns (uint256);
    function resolveEpochStartsIn(uint256 timestamp) external pure returns (uint256);
    function epochStartTs() external view returns (uint256);
    function resolveEpochStartTs(uint256 timestamp) external pure returns (uint256);
    function votingActive() external view returns (bool);
    function resolveVotingActive(uint256 timestamp) external pure returns (bool);
    function epochVoteStartsIn() external view returns (uint256);
    function resolveEpochVoteStartsIn(uint256 timestamp) external pure returns (uint256);
    function epochVoteStartTs() external view returns (uint256);
    function resolveEpochVoteStartTs(uint256 timestamp) external pure returns (uint256);
    function epochVoteEndsIn() external view returns (uint256);
    function resolveEpochVoteEndsIn(uint256 timestamp) external pure returns (uint256);
    function epochVoteEndTs() external view returns (uint256);
    function resolveEpochVoteEndTs(uint256 timestamp) external pure returns (uint256);
    function epochNextCheckpointIn() external view returns (uint256);
    function resolveEpochNextCheckpointIn(uint256 timestamp) external pure returns (uint256);
    function epochNextCheckpointTs() external view returns (uint256);
    function resolveEpochNextCheckpointTs(uint256 timestamp) external pure returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20PermitUpgradeable {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);
    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// 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 IERC1822ProxiableUpgradeable {
    /**
     * @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) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.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 ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }
    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // 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 StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }
    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.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) {
            AddressUpgradeable.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 (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(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 StorageSlotUpgradeable.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");
        StorageSlotUpgradeable.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 StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }
    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.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) {
            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }
    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}// 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 v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }
    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }
    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.8;
import {IDAO} from "../../dao/IDAO.sol";
/// @title DAO Authorization Utilities
/// @author Aragon X - 2022-2024
/// @notice Provides utility functions for verifying if a caller has specific permissions in an associated DAO.
/// @custom:security-contact [email protected]
/// @notice Thrown if a call is unauthorized in the associated DAO.
/// @param dao The associated DAO.
/// @param where The context in which the authorization reverted.
/// @param who The address (EOA or contract) missing the permission.
/// @param permissionId The permission identifier.
error DaoUnauthorized(address dao, address where, address who, bytes32 permissionId);
/// @notice A free function checking if a caller is granted permissions on a target contract via a permission identifier that redirects the approval to a `PermissionCondition` if this was specified in the setup.
/// @param _where The address of the target contract for which `who` receives permission.
/// @param _who The address (EOA or contract) owning the permission.
/// @param _permissionId The permission identifier.
/// @param _data The optional data passed to the `PermissionCondition` registered.
function _auth(
    IDAO _dao,
    address _where,
    address _who,
    bytes32 _permissionId,
    bytes calldata _data
) view {
    if (!_dao.hasPermission(_where, _who, _permissionId, _data))
        revert DaoUnauthorized({
            dao: address(_dao),
            where: _where,
            who: _who,
            permissionId: _permissionId
        });
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (governance/utils/IVotes.sol)
pragma solidity ^0.8.0;
/**
 * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.
 *
 * _Available since v4.5._
 */
interface IVotesUpgradeable {
    /**
     * @dev Emitted when an account changes their delegate.
     */
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
    /**
     * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.
     */
    event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
    /**
     * @dev Returns the current amount of votes that `account` has.
     */
    function getVotes(address account) external view returns (uint256);
    /**
     * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is
     * configured to use block numbers, this will return the value at the end of the corresponding block.
     */
    function getPastVotes(address account, uint256 timepoint) external view returns (uint256);
    /**
     * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is
     * configured to use block numbers, this will return the value at the end of the corresponding block.
     *
     * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.
     * Votes that have not been delegated are still part of total supply, even though they would not participate in a
     * vote.
     */
    function getPastTotalSupply(uint256 timepoint) external view returns (uint256);
    /**
     * @dev Returns the delegate that `account` has chosen.
     */
    function delegates(address account) external view returns (address);
    /**
     * @dev Delegates votes from the sender to `delegatee`.
     */
    function delegate(address delegatee) external;
    /**
     * @dev Delegates votes from signer to `delegatee`.
     */
    function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);
    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);
    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;
    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;
    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;
    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;
    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);
    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}// 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 IBeaconUpgradeable {
    /**
     * @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) (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 IERC1967Upgradeable {
    /**
     * @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 (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 StorageSlotUpgradeable {
    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 v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
  "remappings": [
    "@clock/=lib/ve-governance/src/clock/",
    "@curve/=lib/ve-governance/src/curve/",
    "@delegation/=lib/ve-governance/src/delegation/",
    "@escrow-interfaces/=lib/ve-governance/src/escrow/increasing/interfaces/",
    "@escrow/=lib/ve-governance/src/escrow/",
    "@factory/=lib/ve-governance/src/factory/",
    "@foundry-upgrades/=lib/ve-governance/lib/openzeppelin-foundry-upgrades/src/",
    "@helpers/=lib/ve-governance/test/helpers/",
    "@interfaces/=lib/ve-governance/src/interfaces/",
    "@libs/=lib/ve-governance/src/libs/",
    "@lock/=lib/ve-governance/src/lock/",
    "@mocks/=lib/ve-governance/test/mocks/",
    "@openzeppelin/contracts-upgradeable/=lib/ve-governance/lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/ve-governance/lib/openzeppelin-contracts/contracts/",
    "@queue/=lib/ve-governance/src/queue/",
    "@setup/=lib/ve-governance/src/setup/",
    "@solmate/=lib/ve-governance/lib/solmate/src/",
    "@utils/=lib/ve-governance/src/utils/",
    "@voting/=lib/ve-governance/src/voting/",
    "@ve/=lib/ve-governance/src/",
    "@aragon/protocol-factory/=lib/protocol-factory/",
    "@openzeppelin/openzeppelin-foundry-upgrades/=lib/staged-proposal-processor-plugin/node_modules/@openzeppelin/openzeppelin-foundry-upgrades/src/",
    "@ensdomains/buffer/=lib/protocol-factory/lib/buffer/",
    "@ensdomains/ens-contracts/=lib/protocol-factory/lib/ens-contracts/",
    "@merkl/=lib/merkl/contracts/",
    "@aragon/osx-commons-contracts/=lib/osx-commons/contracts/",
    "@aragon/osx/=lib/ve-governance/lib/osx/packages/contracts/src/",
    "@aragon/multisig-plugin/=lib/protocol-factory/lib/multisig-plugin/packages/contracts/src/",
    "@aragon/admin-plugin/=lib/protocol-factory/lib/admin-plugin/packages/contracts/src/",
    "@aragon/admin/=lib/ve-governance/lib/osx/packages/contracts/src/plugins/governance/admin/",
    "@aragon/multisig/=lib/ve-governance/lib/multisig-plugin/packages/contracts/",
    "@aragon/staged-proposal-processor-plugin/=lib/protocol-factory/lib/staged-proposal-processor-plugin/src/",
    "@aragon/token-voting-plugin/=lib/protocol-factory/lib/token-voting-plugin/src/",
    "@test/=lib/ve-governance/test/",
    "admin-plugin/=lib/protocol-factory/lib/admin-plugin/",
    "buffer/=lib/protocol-factory/lib/buffer/contracts/",
    "ds-test/=lib/ve-governance/lib/ds-test/src/",
    "ens-contracts/=lib/ve-governance/lib/ens-contracts/contracts/",
    "erc4626-tests/=lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "merkl/=lib/merkl/",
    "multisig-plugin/=lib/ve-governance/lib/multisig-plugin/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-foundry-upgrades/=lib/ve-governance/lib/openzeppelin-foundry-upgrades/src/",
    "openzeppelin/=lib/ve-governance/lib/openzeppelin-contracts-upgradeable/contracts/",
    "osx-commons/=lib/osx-commons/",
    "osx/=lib/osx/",
    "oz/=lib/merkl/node_modules/@openzeppelin/contracts/",
    "plugin-version-1.3/=lib/protocol-factory/lib/token-voting-plugin/lib/plugin-version-1.3/",
    "protocol-factory/=lib/protocol-factory/",
    "solidity-stringutils/=lib/protocol-factory/lib/staged-proposal-processor-plugin/node_modules/solidity-stringutils/",
    "solmate/=lib/ve-governance/lib/solmate/src/",
    "staged-proposal-processor-plugin/=lib/protocol-factory/lib/staged-proposal-processor-plugin/src/",
    "token-voting-plugin/=lib/protocol-factory/lib/token-voting-plugin/",
    "utils/=lib/ve-governance/test/utils/",
    "ve-governance/=lib/ve-governance/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none",
    "appendCBOR": false
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressAlreadySet","type":"error"},{"inputs":[],"name":"AlreadyVoted","type":"error"},{"inputs":[],"name":"AmountTooSmall","type":"error"},{"inputs":[],"name":"CannotExit","type":"error"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"CannotMerge","type":"error"},{"inputs":[],"name":"CannotWithdrawInSameBlock","type":"error"},{"inputs":[{"internalType":"address","name":"dao","type":"address"},{"internalType":"address","name":"where","type":"address"},{"internalType":"address","name":"who","type":"address"},{"internalType":"bytes32","name":"permissionId","type":"bytes32"}],"name":"DaoUnauthorized","type":"error"},{"inputs":[],"name":"LockNFTAlreadySet","type":"error"},{"inputs":[],"name":"MustBe18Decimals","type":"error"},{"inputs":[],"name":"NoLockFound","type":"error"},{"inputs":[],"name":"NoOwner","type":"error"},{"inputs":[],"name":"NonExistentToken","type":"error"},{"inputs":[],"name":"NotApprovedOrOwner","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotSameOwner","type":"error"},{"inputs":[],"name":"NotTicketHolder","type":"error"},{"inputs":[],"name":"NotVoter","type":"error"},{"inputs":[],"name":"NothingToSweep","type":"error"},{"inputs":[],"name":"OnlyIVotesAdapter","type":"error"},{"inputs":[],"name":"OnlyLockNFT","type":"error"},{"inputs":[],"name":"OwnershipChange","type":"error"},{"inputs":[],"name":"SameAddress","type":"error"},{"inputs":[],"name":"SameNFT","type":"error"},{"inputs":[],"name":"SplitAmountTooBig","type":"error"},{"inputs":[],"name":"SplitNotWhitelisted","type":"error"},{"inputs":[],"name":"TransferBalanceIncorrect","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"inputs":[],"name":"ZeroBalance","type":"error"},{"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":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"startTs","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalLocked","type":"uint256"}],"name":"Deposit","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":"_sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"_from","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_to","type":"uint256"},{"indexed":false,"internalType":"uint208","name":"_amountFrom","type":"uint208"},{"indexed":false,"internalType":"uint208","name":"_amountTo","type":"uint208"},{"indexed":false,"internalType":"uint208","name":"_amountFinal","type":"uint208"}],"name":"Merged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minDeposit","type":"uint256"}],"name":"MinDepositSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_from","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint208","name":"_splitAmount1","type":"uint208"},{"indexed":false,"internalType":"uint208","name":"_splitAmount2","type":"uint208"}],"name":"Split","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SplitWhitelistSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sweep","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"SweepNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","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":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalLocked","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ESCROW_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPLIT_WHITELIST_ANY_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWEEPER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"beginWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint208","name":"amount","type":"uint208"},{"internalType":"uint48","name":"start","type":"uint48"}],"internalType":"struct ILockedBalanceIncreasing.LockedBalance","name":"_fromLocked","type":"tuple"},{"components":[{"internalType":"uint208","name":"amount","type":"uint208"},{"internalType":"uint48","name":"start","type":"uint48"}],"internalType":"struct ILockedBalanceIncreasing.LockedBalance","name":"_toLocked","type":"tuple"}],"name":"canMerge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"canSplit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"cancelWithdrawalRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"createLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"createLockFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentExitingAmount","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curve","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dao","outputs":[{"internalType":"contract IDAO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_dao","type":"address"},{"internalType":"address","name":"_clock","type":"address"},{"internalType":"uint256","name":"_initialMinDeposit","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isApprovedOrOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isVoting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ivotesAdapter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastLockId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockNFT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"locked","outputs":[{"components":[{"internalType":"uint208","name":"amount","type":"uint208"},{"internalType":"uint48","name":"start","type":"uint48"}],"internalType":"struct ILockedBalanceIncreasing.LockedBalance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"merge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"moveDelegateVotes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"ownedTokens","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queue","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"resetVotesAndBeginWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_clock","type":"address"}],"name":"setClock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_curve","type":"address"}],"name":"setCurve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isWhitelisted","type":"bool"}],"name":"setEnableSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ivotesAdapter","type":"address"}],"name":"setIVotesAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"}],"name":"setLockNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDeposit","type":"uint256"}],"name":"setMinDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_queue","type":"address"}],"name":"setQueue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"split","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"splitWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"sweepNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"totalVotingPowerAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"updateVotingPower","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":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"votingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_t","type":"uint256"}],"name":"votingPowerAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"votingPowerForAccount","outputs":[{"internalType":"uint256","name":"accountVotingPower","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523060805234801562000014575f80fd5b506200001f62000025565b620000e3565b5f54610100900460ff1615620000915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811614620000e1575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051615251620001185f395f81816110d80152818161117301528181611b3c01528181611bd20152611ccc01526152515ff3fe608060405260043610610371575f3560e01c80638456cb59116101c8578063c3ff539c116100fd578063d68e8ecc1161009d578063f00a25971161006d578063f00a259714610a6e578063f3ee7e2c14610aa1578063f7d9d0c414610ac0578063fc0c546a14610adf575f80fd5b8063d68e8ecc146109dd578063da8ebd68146109fc578063e10d29ee14610a1b578063e63ab1e914610a3b575f80fd5b8063cf756fdf116100d8578063cf756fdf1461096a578063cf8acc6514610989578063d0cb39c6146109a8578063d1c2babb146109be575f80fd5b8063c3ff539c1461090d578063c412a9231461092c578063c60dec311461094b575f80fd5b8063a039d32c11610168578063b45a3c0e11610143578063b45a3c0e14610832578063bbd25c16146108aa578063bc2ed734146108be578063bee26609146108ed575f80fd5b8063a039d32c146107c8578063abdb84e7146107e7578063b12ab40f14610806575f80fd5b806391ddadf4116101a357806391ddadf41461074a578063924f0e631461076a5780639490895d1461078957806397f72300146107a9575f80fd5b80638456cb59146106f8578063893c37f21461070c5780638fcc9cfb1461072b575f80fd5b80634bc2a657116102a9578063671b37931161024957806372c4a9271161021957806372c4a9271461068757806375ee5515146106a65780637fcce7c8146106ba57806380c62199146106d9575f80fd5b8063671b3793146106015780636e61462a146106155780636e7b1445146106485780637165485d14610667575f80fd5b80635689141211610284578063568914121461058d5780635c60da1b146105a35780635c975abb146105b75780635f82abb9146105ce575f80fd5b80634bc2a657146105475780634f1ef2861461056657806352d1902d14610579575f80fd5b80634162169f1161031457806345b05d09116102ef57806345b05d09146104ca57806346c96aac146104e957806348dc9d2b146105095780634b19becc14610528575f80fd5b80634162169f1461045657806341b3d18514610487578063430c2081146104ab575f80fd5b806335faa4161161034f57806335faa416146103e05780633659cfe6146103f45780633d085a37146104135780633f4ba83a14610442575f80fd5b80630a29e4c0146103755780632e1a7d4d14610396578063313ce567146103b5575b5f80fd5b348015610380575f80fd5b5061039461038f366004614a9d565b610aff565b005b3480156103a1575f80fd5b506103946103b0366004614ad4565b610bcc565b3480156103c0575f80fd5b506103c9601281565b60405160ff90911681526020015b60405180910390f35b3480156103eb575f80fd5b50610394610f76565b3480156103ff575f80fd5b5061039461040e366004614aeb565b6110ce565b34801561041e575f80fd5b5061043261042d366004614aeb565b61126c565b60405190151581526020016103d7565b34801561044d575f80fd5b506103946112d9565b348015610461575f80fd5b506097546001600160a01b03165b6040516001600160a01b0390911681526020016103d7565b348015610492575f80fd5b5061049d61012d5481565b6040519081526020016103d7565b3480156104b6575f80fd5b506104326104c5366004614b06565b61131a565b3480156104d5575f80fd5b506103946104e4366004614ad4565b6113ae565b3480156104f4575f80fd5b506101325461046f906001600160a01b031681565b348015610514575f80fd5b50610394610523366004614aeb565b6115b1565b348015610533575f80fd5b5061049d610542366004614b30565b611648565b348015610552575f80fd5b50610394610561366004614aeb565b611ac8565b610394610574366004614be1565b611b32565b348015610584575f80fd5b5061049d611cc0565b348015610598575f80fd5b5061049d61012f5481565b3480156105ae575f80fd5b5061046f611d84565b3480156105c2575f80fd5b5060655460ff16610432565b3480156105d9575f80fd5b5061049d7ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc981565b34801561060c575f80fd5b5061049d611dbb565b348015610620575f80fd5b5061049d7f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599581565b348015610653575f80fd5b50610394610662366004614aeb565b611dc5565b348015610672575f80fd5b506101335461046f906001600160a01b031681565b348015610692575f80fd5b5061049d6106a1366004614ad4565b611ea6565b3480156106b1575f80fd5b50610394611eb1565b3480156106c5575f80fd5b5061049d6106d4366004614aeb565b611f6e565b3480156106e4575f80fd5b506103946106f3366004614ad4565b611fc4565b348015610703575f80fd5b506103946122d6565b348015610717575f80fd5b5061049d610726366004614b30565b612317565b348015610736575f80fd5b50610394610745366004614ad4565b6123a3565b348015610755575f80fd5b506101355461046f906001600160a01b031681565b348015610775575f80fd5b50610394610784366004614ad4565b612419565b348015610794575f80fd5b506101395461046f906001600160a01b031681565b3480156107b4575f80fd5b506104326107c3366004614ad4565b61242a565b3480156107d3575f80fd5b5061049d6107e2366004614c83565b61264b565b3480156107f2575f80fd5b50610394610801366004614aeb565b612671565b348015610811575f80fd5b50610825610820366004614aeb565b612708565b6040516103d79190614ca6565b34801561083d575f80fd5b5061089d61084c366004614ad4565b604080518082019091525f8082526020820152505f90815261013060209081526040918290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff169082015290565b6040516103d79190614ce9565b3480156108b5575f80fd5b5061049d612882565b3480156108c9575f80fd5b506104326108d8366004614aeb565b6101376020525f908152604090205460ff1681565b3480156108f8575f80fd5b506101365461046f906001600160a01b031681565b348015610918575f80fd5b50610394610927366004614aeb565b6129f5565b348015610937575f80fd5b50610394610946366004614d11565b612a8c565b348015610956575f80fd5b5061049d610965366004614ad4565b612b25565b348015610975575f80fd5b50610394610984366004614d4f565b612baa565b348015610994575f80fd5b506103946109a3366004614c83565b612df4565b3480156109b3575f80fd5b5061049d61012e5481565b3480156109c9575f80fd5b506103946109d8366004614b30565b613029565b3480156109e8575f80fd5b506103946109f7366004614daa565b6135de565b348015610a07575f80fd5b50610432610a16366004614e4c565b613677565b348015610a26575f80fd5b506101345461046f906001600160a01b031681565b348015610a46575f80fd5b5061049d7f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c81565b348015610a79575f80fd5b5061046f7f8845a8ca8d79f29a0e1842e589203edb30c2ecf12612e709afb87c85a170da0a81565b348015610aac575f80fd5b50610394610abb366004614aeb565b613774565b348015610acb575f80fd5b5061049d610ada366004614ad4565b61380b565b348015610aea575f80fd5b506101315461046f906001600160a01b031681565b610b07613836565b610139546001600160a01b03163314610b4c576040517fc817887a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610132546040517f0a29e4c00000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152838116602483015290911690630a29e4c0906044015f604051808303815f87803b158015610bb2575f80fd5b505af1158015610bc4573d5f803e3d5ffd5b505050505050565b610bd4613889565b610bdc613836565b5f33610134546040516315f5987560e31b8152600481018590529192506001600160a01b038084169291169063afacc3a890602401602060405180830381865afa158015610c2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c509190614e7f565b6001600160a01b031614610c90576040517f5a7f2a1000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040517faaff9440000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063aaff944090602401602060405180830381865afa158015610cf1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d159190614e9a565b610d325760405163a02bf16760e01b815260040160405180910390fd5b5f828152610130602090815260408083208151808301835290546001600160d01b038116808352600160d01b90910465ffffffffffff16938201939093526101345491517f7f8661a1000000000000000000000000000000000000000000000000000000008152600481018790529093916001600160a01b031690637f8661a1906024016020604051808303815f875af1158015610dd2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df69190614eb5565b90508015610e1d576101345461013154610e1d916001600160a01b039182169116836138e2565b6040805180820182525f80825260208083018281528983526101309091529281209151925165ffffffffffff16600160d01b026001600160d01b039390931692909217905561012f8054849290610e75908490614ee0565b9091555050610136546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b03909116906342966c68906024015f604051808303815f87803b158015610ed7575f80fd5b505af1158015610ee9573d5f803e3d5ffd5b50505050610f11848284610efd9190614ee0565b610131546001600160a01b031691906138e2565b846001600160a01b0385167fe08737ac48a1dab4b1a46c7dc9398bd5bfc6d7ad6fabb7cd8caa254de14def35610f478486614ee0565b61012f546040805192835242602084015282015260600160405180910390a350505050610f7360018055565b50565b610f7e613889565b6097547ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc990610fbb906001600160a01b031630335b845f36613996565b610131546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015611002573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110269190614eb5565b90505f61012f54826110389190614ee0565b9050805f03611073576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61108b33610131546001600160a01b031690836138e2565b60405181815233907fab2246061d7b0dd3631d037e3f6da75782ae489eeb9f6af878a4b25df9b07c779060200160405180910390a25050506110cc60018055565b565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111715760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111cc7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146112485760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401611168565b61125181613a7a565b604080515f80825260208201909252610f7391839190613ab3565b7389203edb30c2ecf12612e709afb87c85a170da0a5f9081526101376020527f8bcd466e66a74972639fe49f36525a3ea82d0290670747e745243d99fd7a95765460ff16806112d357506001600160a01b0382165f908152610137602052604090205460ff165b92915050565b6097547f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c90611312906001600160a01b03163033610fb3565b610f73613c53565b610136546040517f430c20810000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018490525f92169063430c208190604401602060405180830381865afa158015611383573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113a79190614e9a565b9392505050565b6113b6613889565b6113be613836565b610134546040516315f5987560e31b8152600481018390525f916001600160a01b03169063afacc3a890602401602060405180830381865afa158015611406573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142a9190614e7f565b9050336001600160a01b038216811461146f576040517f5a7f2a1000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820182525f808252858152610130602081815284832054600160d01b810465ffffffffffff168286018190529389905291815284518086019095526001600160d01b0390911684528301526114cb91859190613ca5565b610134546040517f726123b4000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b039091169063726123b4906024015f604051808303815f87803b158015611528575f80fd5b505af115801561153a573d5f803e3d5ffd5b5050610136546040516323b872dd60e01b81523060048201526001600160a01b0385811660248301526044820188905290911692506323b872dd91506064015f604051808303815f87803b158015611590575f80fd5b505af11580156115a2573d5f803e3d5ffd5b505050505050610f7360018055565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906115ea906001600160a01b03163033610fb3565b610133546001600160a01b0316801561161657604051637b1616c160e11b815260040160405180910390fd5b5050610133805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f611651613836565b815f0361168a576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33610136546040516331a9108f60e11b8152600481018790529192505f916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156116d9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116fd9190614e7f565b90506001600160a01b03811661173f576040517f7f51e10200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117488161126c565b61177e576040517f1c57424200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611788828661131a565b6117be576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f85815261013060209081526040918290208251808401909352546001600160d01b038116808452600160d01b90910465ffffffffffff16918301919091528510611835576040517fbd5fd08400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61183f86613d25565b825161184b9190614ef3565b90505f61185787613d25565b905061012d54826001600160d01b0316108061187e575061012d54816001600160d01b0316105b156118b5576040517fc2f5625a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118e988846040518060400160405280866001600160d01b03168152602001876020015165ffffffffffff16815250613ca5565b6040805180820182526001600160d01b03808516825260208681015165ffffffffffff9081168285019081525f8e81526101309093529482209351945116600160d01b029390911692909217905561012e8054829061194790614f1a565b91905081905590506101395f9054906101000a90046001600160a01b03166001600160a01b031663ab19fdd16040518060600160405280886001600160a01b031681526020018c815260200160405180604001604052805f6001600160d01b031681526020015f65ffffffffffff168152508152506040518060600160405280896001600160a01b0316815260200185815260200160405180604001604052805f6001600160d01b031681526020015f65ffffffffffff168152508152506040518363ffffffff1660e01b8152600401611a22929190614f95565b5f604051808303815f87803b158015611a39575f80fd5b505af1158015611a4b573d5f803e3d5ffd5b5050506001600160d01b038316855250611a66858286613da7565b604080516001600160a01b03881681526001600160d01b038581166020830152841681830152905182918b917f4c6f4301c366fcacd61611cde4448f4799931df3d6d6451b67e5d065f77557949181900360600190a398975050505050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611b01906001600160a01b03163033610fb3565b50610132805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611bd05760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401611168565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611c2b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614611ca75760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401611168565b611cb082613a7a565b611cbc82826001613ab3565b5050565b5f306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611d5f5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611168565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f611db67f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b5f611db642612b25565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611dfe906001600160a01b03163033610fb3565b6101365474010000000000000000000000000000000000000000900460ff1615611e54576040517fd133196200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061013680547fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b039092169190911774010000000000000000000000000000000000000000179055565b5f6112d38242612317565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611eea906001600160a01b03163033610fb3565b7389203edb30c2ecf12612e709afb87c85a170da0a5f81905261013760209081527f8bcd466e66a74972639fe49f36525a3ea82d0290670747e745243d99fd7a9576805460ff191660019081179091556040519081527f7aa63f9a2aa7db42378fcf8e7d24bf5b848f0c86c89ab303819493c8b9a8fb01910160405180910390a250565b5f80611f7983612708565b90505f5b8151811015611fbd57611fa9828281518110611f9b57611f9b614fb1565b602002602001015142612317565b611fb39084614fc5565b9250600101611f7d565b5050919050565b611fcc613889565b611fd4613836565b611fdd81611ea6565b5f03611ffc5760405163a02bf16760e01b815260040160405180910390fd5b610133546040517f66dec1ab00000000000000000000000000000000000000000000000000000000815260048101839052600160248201525f916001600160a01b0316906366dec1ab9060440160c060405180830381865afa158015612064573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120889190614ff7565b905080604001516fffffffffffffffffffffffffffffffff164214806120bb57505f828152610138602052604090205442145b156120f2576040517fd49d3acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610136546040516331a9108f60e11b8152600481018490525f916001600160a01b031690636352211e90602401602060405180830381865afa15801561213a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215e9190614e7f565b5f848152610130602090815260408083208151808301835290546001600160d01b038116825265ffffffffffff600160d01b90910481168285019081528351808501909452948352935190931691810191909152919250906121c39085908390613ca5565b610136546001600160a01b03166323b872dd336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152306024820152604481018790526064015f604051808303815f87803b158015612239575f80fd5b505af115801561224b573d5f803e3d5ffd5b5050610134546040517f5fa00c75000000000000000000000000000000000000000000000000000000008152600481018890526001600160a01b0386811660248301529091169250635fa00c7591506044015f604051808303815f87803b1580156122b4575f80fd5b505af11580156122c6573d5f803e3d5ffd5b50505050505050610f7360018055565b6097547f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c9061230f906001600160a01b03163033610fb3565b610f73613e4b565b610133546040517f893c37f200000000000000000000000000000000000000000000000000000000815260048101849052602481018390525f916001600160a01b03169063893c37f290604401602060405180830381865afa15801561237f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113a79190614eb5565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906123dc906001600160a01b03163033610fb3565b61012d8290556040518281527fc50a7f0bdf88c216b2541b0bdea26f22305460e39ffc672ec1a7501732c5ba819060200160405180910390a15050565b612421613836565b610f7381611fc4565b610136546040516331a9108f60e11b8152600481018390525f9182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612476573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061249a9190614e7f565b610139546040517fe520df0b000000000000000000000000000000000000000000000000000000008152600481018690529192505f916001600160a01b039091169063e520df0b90602401602060405180830381865afa158015612500573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125249190614e9a565b90508061253457505f9392505050565b610139546040517f587cde1e0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f92169063587cde1e90602401602060405180830381865afa158015612596573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125ba9190614e7f565b610132546040517f5f8dd6490000000000000000000000000000000000000000000000000000000081526001600160a01b038084166004830152929350911690635f8dd64990602401602060405180830381865afa15801561261e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126429190614e9a565b95945050505050565b5f612654613889565b61265c613836565b6126668383613e88565b90506112d360018055565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906126aa906001600160a01b03163033610fb3565b610139546001600160a01b031680156126d657604051637b1616c160e11b815260040160405180910390fd5b5050610139805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610136546040516370a0823160e01b81526001600160a01b03838116600483015260609216905f9082906370a0823190602401602060405180830381865afa158015612756573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061277a9190614eb5565b90505f8167ffffffffffffffff81111561279657612796614b50565b6040519080825280602002602001820160405280156127bf578160200160208202803683370190505b5090505f5b82811015612879576040517f2f745c590000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260248201839052851690632f745c5990604401602060405180830381865afa158015612830573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128549190614eb5565b82828151811061286657612866614fb1565b60209081029190910101526001016127c4565b50949350505050565b610136546040516370a0823160e01b81523060048201525f916001600160a01b031690829082906370a0823190602401602060405180830381865afa1580156128cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128f19190614eb5565b90505f5b818110156129ef576040517f2f745c59000000000000000000000000000000000000000000000000000000008152306004820152602481018290525f906001600160a01b03851690632f745c5990604401602060405180830381865afa158015612961573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129859190614eb5565b6040805180820182525f808252602091820181905283815261013082528290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff1690820152909150516129e4906001600160d01b031686614fc5565b9450506001016128f5565b50505090565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590612a2e906001600160a01b03163033610fb3565b610135546001600160a01b03168015612a5a57604051637b1616c160e11b815260040160405180910390fd5b5050610135805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b612a94613836565b610136546001600160a01b03163314612ad9576040517fabb21b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81815261013060209081526040918290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff1690820152612b1f84848484614254565b50505050565b610133546040517f56ee9ca2000000000000000000000000000000000000000000000000000000008152600481018390525f916001600160a01b0316906356ee9ca290602401602060405180830381865afa158015612b86573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112d39190614eb5565b5f54610100900460ff1615808015612bc857505f54600160ff909116105b80612be15750303b158015612be157505f5460ff166001145b612c535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401611168565b5f805460ff191660011790558015612c74575f805461ff0019166101001790555b612c7c6142d7565b612c84614349565b612c8d846143bb565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cc9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ced919061508b565b60ff16601214612d29576040517f224495f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61013180546001600160a01b0380881673ffffffffffffffffffffffffffffffffffffffff199283161790925561013580549286169290911691909117905561012d8290556040517fc50a7f0bdf88c216b2541b0bdea26f22305460e39ffc672ec1a7501732c5ba8190612da09084815260200190565b60405180910390a18015612ded575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b612dfc613889565b6097547ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc990612e35906001600160a01b03163033610fb3565b610136546040516331a9108f60e11b81526004810185905230916001600160a01b031690636352211e90602401602060405180830381865afa158015612e7d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ea19190614e7f565b6001600160a01b031614612ee1576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040516315f5987560e31b8152600481018590525f916001600160a01b03169063afacc3a890602401602060405180830381865afa158015612f29573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f4d9190614e7f565b6001600160a01b031614612f745760405163a02bf16760e01b815260040160405180910390fd5b610136546040516323b872dd60e01b81523060048201526001600160a01b03848116602483015260448201869052909116906323b872dd906064015f604051808303815f87803b158015612fc6575f80fd5b505af1158015612fd8573d5f803e3d5ffd5b50505050816001600160a01b03167ffe5a47ddd083557617250fa1aad6e9578f78201e8a189b20ccb7602eabde84168460405161301791815260200190565b60405180910390a250611cbc60018055565b613031613836565b3381830361306b576040517f93b50ef200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610136546040516331a9108f60e11b8152600481018590525f916001600160a01b031690636352211e90602401602060405180830381865afa1580156130b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130d79190614e7f565b610136546040516331a9108f60e11b8152600481018690529192505f916001600160a01b0390911690636352211e90602401602060405180830381865afa158015613124573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131489190614e7f565b9050806001600160a01b0316826001600160a01b031614613195576040517f5a2b356700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61319f838661131a565b15806131b257506131b0838561131a565b155b156131e9576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f858152610130602081815260408084208151808301835290546001600160d01b03808216835265ffffffffffff600160d01b928390048116848701528b8852958552958390208351808501909452549586168352909404909216908201526132528282613677565b613292576040517ff77597cb0000000000000000000000000000000000000000000000000000000081526004810188905260248101879052604401611168565b610133546040517f66dec1ab00000000000000000000000000000000000000000000000000000000815260048101899052600160248201525f916001600160a01b0316906366dec1ab9060440160c060405180830381865afa1580156132fa573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061331e9190614ff7565b90504281604001516fffffffffffffffffffffffffffffffff16148061335157505f888152610138602052604090205442145b15613368575f878152610138602052604090204290555b6101395460408051606080820183526001600160a01b0389811680845260208085018f90528486018a90528551938401865290835282018c905281840187905292517fd22e849d000000000000000000000000000000000000000000000000000000008152929093169263d22e849d926133e6929190600401614f95565b5f604051808303815f87803b1580156133fd575f80fd5b505af115801561340f573d5f803e3d5ffd5b5050610136546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018c90526001600160a01b0390911692506342966c6891506024015f604051808303815f87803b158015613470575f80fd5b505af1158015613482573d5f803e3d5ffd5b50506040805180820182525f80825260208083018281528e83526101308252848320935190516001600160d01b03909116600160d01b65ffffffffffff9283160217909355835180850190945290835287810151909116908201526134ec92508a91508590613ca5565b815183515f916134fb916150ab565b905061353188846040518060400160405280856001600160d01b03168152602001876020015165ffffffffffff16815250613ca5565b6040805180820182526001600160d01b0383811680835260208781015165ffffffffffff9081168286019081525f8f8152610130845287902095519051909116600160d01b02908416179093558751875185519184168252909216928201929092529182015288908a906001600160a01b038a16907f78ed2846b31baf196e1fe55d3f6a1b664b2cdeaf8b819a802686b60fb46652b89060600160405180910390a4505050505050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590613617906001600160a01b03163033610fb3565b6001600160a01b0383165f8181526101376020908152604091829020805460ff191686151590811790915591519182527f7aa63f9a2aa7db42378fcf8e7d24bf5b848f0c86c89ab303819493c8b9a8fb01910160405180910390a2505050565b5f806101335f9054906101000a90046001600160a01b03166001600160a01b03166322e67e716040518163ffffffff1660e01b8152600401602060405180830381865afa1580156136ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906136ee9190614eb5565b90505f81856020015165ffffffffffff166137099190614fc5565b90505f82856020015165ffffffffffff166137249190614fc5565b9050856020015165ffffffffffff16856020015165ffffffffffff1614158015613758575042811015806137585750428210155b15613768575f93505050506112d3565b50600195945050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906137ad906001600160a01b03163033610fb3565b610134546001600160a01b031680156137d957604051637b1616c160e11b815260040160405180910390fd5b5050610134805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f613814613889565b61381c613836565b6138268233613e88565b905061383160018055565b919050565b60655460ff16156110cc5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611168565b6002600154036138db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611168565b6002600155565b6040516001600160a01b03831660248201526044810182905261398b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614454565b505050565b60018055565b6040517ffdef91060000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063fdef9106906139e390889088908890889088906004016150cb565b602060405180830381865afa1580156139fe573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613a229190614e9a565b610bc4576040517f32dbe3b40000000000000000000000000000000000000000000000000000000081526001600160a01b03808816600483015280871660248301528516604482015260648101849052608401611168565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611cbc906001600160a01b03163033610fb3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613ae65761398b8361453a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613b40575060408051601f3d908101601f19168201909252613b3d91810190614eb5565b60015b613bb25760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401611168565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114613c475760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401611168565b5061398b838383614605565b613c5b614629565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610133546040517f9cfba62c0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690639cfba62c90613cf39086908690869060040161511d565b5f604051808303815f87803b158015613d0a575f80fd5b505af1158015613d1c573d5f803e3d5ffd5b50505050505050565b5f6001600160d01b03821115613da35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f30382062697473000000000000000000000000000000000000000000000000006064820152608401611168565b5090565b5f8281526101306020908152604080832084518386015165ffffffffffff16600160d01b026001600160d01b03909116179055805180820190915282815290810191909152613df890839083613ca5565b610136546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052909116906340c10f1990604401613cf3565b613e53613836565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613c883390565b5f825f03613ec2576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012d54831015613eff576040517fc2f5625a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61013554604080517fb97bde0e00000000000000000000000000000000000000000000000000000000815290515f926001600160a01b03169163b97bde0e9160048083019260209291908290030181865afa158015613f60573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613f849190614eb5565b90508361012f5f828254613f989190614fc5565b925050819055505f61012e5f8154613faf90614f1a565b91905081905590505f6040518060400160405280613fcc88613d25565b6001600160d01b03168152602001613fe38561467b565b65ffffffffffff9081169091525f84815261013060209081526040808320855183870151909516600160d01b026001600160d01b0390951694909417909355825180840190935281835282015290915061403f90839083613ca5565b610131546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015614086573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140aa9190614eb5565b90506140c533610131546001600160a01b031690308a6146f8565b6140cf8782614fc5565b610131546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015614116573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061413a9190614eb5565b14614171576040517f172c923300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61417d5f878585614254565b610136546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015260248201869052909116906340c10f19906044015f604051808303815f87803b1580156141e2575f80fd5b505af11580156141f4573d5f803e3d5ffd5b505050508383876001600160a01b03167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f98a61012f54604051614241929190918252602082015260400190565b60405180910390a4509095945050505050565b610139546040517fa2960aaa0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063a2960aaa906142a4908790879087908790600401615173565b5f604051808303815f87803b1580156142bb575f80fd5b505af11580156142cd573d5f803e3d5ffd5b5050505050505050565b5f54610100900460ff166143415760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6110cc614730565b5f54610100900460ff166143b35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6110cc61479a565b5f54610100900460ff166144255760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f6144a8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148109092919063ffffffff16565b905080515f14806144c85750808060200190518101906144c89190614e9a565b61398b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611168565b6001600160a01b0381163b6145b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401611168565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b61460e83614826565b5f8251118061461a5750805b1561398b57612b1f8383614865565b60655460ff166110cc5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611168565b5f65ffffffffffff821115613da35760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f38206269747300000000000000000000000000000000000000000000000000006064820152608401611168565b6040516001600160a01b0380851660248301528316604482015260648101829052612b1f9085906323b872dd60e01b90608401613927565b5f54610100900460ff166139905760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b5f54610100900460ff166148045760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6065805460ff19169055565b606061481e84845f8561488a565b949350505050565b61482f8161453a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b60606113a7838360405180606001604052806027815260200161522a60279139614978565b6060824710156149025760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401611168565b5f80866001600160a01b0316858760405161491d91906151dc565b5f6040518083038185875af1925050503d805f8114614957576040519150601f19603f3d011682016040523d82523d5f602084013e61495c565b606091505b509150915061496d878383876149ec565b979650505050505050565b60605f80856001600160a01b03168560405161499491906151dc565b5f60405180830381855af49150503d805f81146149cc576040519150601f19603f3d011682016040523d82523d5f602084013e6149d1565b606091505b50915091506149e2868383876149ec565b9695505050505050565b60608315614a5a5782515f03614a53576001600160a01b0385163b614a535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611168565b508161481e565b61481e8383815115614a6f5781518083602001fd5b8060405162461bcd60e51b815260040161116891906151f7565b6001600160a01b0381168114610f73575f80fd5b5f8060408385031215614aae575f80fd5b8235614ab981614a89565b91506020830135614ac981614a89565b809150509250929050565b5f60208284031215614ae4575f80fd5b5035919050565b5f60208284031215614afb575f80fd5b81356113a781614a89565b5f8060408385031215614b17575f80fd5b8235614b2281614a89565b946020939093013593505050565b5f8060408385031215614b41575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b6040516080810167ffffffffffffffff81118282101715614b8757614b87614b50565b60405290565b6040516060810167ffffffffffffffff81118282101715614b8757614b87614b50565b604051601f8201601f1916810167ffffffffffffffff81118282101715614bd957614bd9614b50565b604052919050565b5f8060408385031215614bf2575f80fd5b8235614bfd81614a89565b915060208381013567ffffffffffffffff80821115614c1a575f80fd5b818601915086601f830112614c2d575f80fd5b813581811115614c3f57614c3f614b50565b614c5184601f19601f84011601614bb0565b91508082528784828501011115614c66575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f8060408385031215614c94575f80fd5b823591506020830135614ac981614a89565b602080825282518282018190525f9190848201906040850190845b81811015614cdd57835183529284019291840191600101614cc1565b50909695505050505050565b81516001600160d01b0316815260208083015165ffffffffffff1690820152604081016112d3565b5f805f60608486031215614d23575f80fd5b8335614d2e81614a89565b92506020840135614d3e81614a89565b929592945050506040919091013590565b5f805f8060808587031215614d62575f80fd5b8435614d6d81614a89565b93506020850135614d7d81614a89565b92506040850135614d8d81614a89565b9396929550929360600135925050565b8015158114610f73575f80fd5b5f8060408385031215614dbb575f80fd5b8235614dc681614a89565b91506020830135614ac981614d9d565b5f60408284031215614de6575f80fd5b6040516040810181811067ffffffffffffffff82111715614e0957614e09614b50565b60405290508082356001600160d01b0381168114614e25575f80fd5b8152602083013565ffffffffffff81168114614e3f575f80fd5b6020919091015292915050565b5f8060808385031215614e5d575f80fd5b614e678484614dd6565b9150614e768460408501614dd6565b90509250929050565b5f60208284031215614e8f575f80fd5b81516113a781614a89565b5f60208284031215614eaa575f80fd5b81516113a781614d9d565b5f60208284031215614ec5575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156112d3576112d3614ecc565b6001600160d01b03828116828216039080821115614f1357614f13614ecc565b5092915050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614f4a57614f4a614ecc565b5060010190565b6001600160a01b03815116825260208101516020830152604081015161398b604084018280516001600160d01b0316825260209081015165ffffffffffff16910152565b6101008101614fa48285614f51565b6113a76080830184614f51565b634e487b7160e01b5f52603260045260245ffd5b808201808211156112d3576112d3614ecc565b80516fffffffffffffffffffffffffffffffff81168114613831575f80fd5b5f60c08284031215615007575f80fd5b61500f614b64565b82518152602061502160208501614fd8565b602083015261503260408501614fd8565b604083015284607f850112615045575f80fd5b61504d614b8d565b8060c086018781111561505e575f80fd5b606087015b8181101561507a5780518452928401928401615063565b505060608401525090949350505050565b5f6020828403121561509b575f80fd5b815160ff811681146113a7575f80fd5b6001600160d01b03818116838216019080821115614f1357614f13614ecc565b5f6001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a08401375f60a0848401015260a0601f19601f85011683010190509695505050505050565b83815260a0810161514c602083018580516001600160d01b0316825260209081015165ffffffffffff16910152565b82516001600160d01b03166060830152602083015165ffffffffffff16608083015261481e565b6001600160a01b038581168252841660208201526040810183905260a08101612642606083018480516001600160d01b0316825260209081015165ffffffffffff16910152565b5f5b838110156151d45781810151838201526020016151bc565b50505f910152565b5f82516151ed8184602087016151ba565b9190910192915050565b602081525f82518060208401526152158160408501602087016151ba565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564
Deployed Bytecode
0x608060405260043610610371575f3560e01c80638456cb59116101c8578063c3ff539c116100fd578063d68e8ecc1161009d578063f00a25971161006d578063f00a259714610a6e578063f3ee7e2c14610aa1578063f7d9d0c414610ac0578063fc0c546a14610adf575f80fd5b8063d68e8ecc146109dd578063da8ebd68146109fc578063e10d29ee14610a1b578063e63ab1e914610a3b575f80fd5b8063cf756fdf116100d8578063cf756fdf1461096a578063cf8acc6514610989578063d0cb39c6146109a8578063d1c2babb146109be575f80fd5b8063c3ff539c1461090d578063c412a9231461092c578063c60dec311461094b575f80fd5b8063a039d32c11610168578063b45a3c0e11610143578063b45a3c0e14610832578063bbd25c16146108aa578063bc2ed734146108be578063bee26609146108ed575f80fd5b8063a039d32c146107c8578063abdb84e7146107e7578063b12ab40f14610806575f80fd5b806391ddadf4116101a357806391ddadf41461074a578063924f0e631461076a5780639490895d1461078957806397f72300146107a9575f80fd5b80638456cb59146106f8578063893c37f21461070c5780638fcc9cfb1461072b575f80fd5b80634bc2a657116102a9578063671b37931161024957806372c4a9271161021957806372c4a9271461068757806375ee5515146106a65780637fcce7c8146106ba57806380c62199146106d9575f80fd5b8063671b3793146106015780636e61462a146106155780636e7b1445146106485780637165485d14610667575f80fd5b80635689141211610284578063568914121461058d5780635c60da1b146105a35780635c975abb146105b75780635f82abb9146105ce575f80fd5b80634bc2a657146105475780634f1ef2861461056657806352d1902d14610579575f80fd5b80634162169f1161031457806345b05d09116102ef57806345b05d09146104ca57806346c96aac146104e957806348dc9d2b146105095780634b19becc14610528575f80fd5b80634162169f1461045657806341b3d18514610487578063430c2081146104ab575f80fd5b806335faa4161161034f57806335faa416146103e05780633659cfe6146103f45780633d085a37146104135780633f4ba83a14610442575f80fd5b80630a29e4c0146103755780632e1a7d4d14610396578063313ce567146103b5575b5f80fd5b348015610380575f80fd5b5061039461038f366004614a9d565b610aff565b005b3480156103a1575f80fd5b506103946103b0366004614ad4565b610bcc565b3480156103c0575f80fd5b506103c9601281565b60405160ff90911681526020015b60405180910390f35b3480156103eb575f80fd5b50610394610f76565b3480156103ff575f80fd5b5061039461040e366004614aeb565b6110ce565b34801561041e575f80fd5b5061043261042d366004614aeb565b61126c565b60405190151581526020016103d7565b34801561044d575f80fd5b506103946112d9565b348015610461575f80fd5b506097546001600160a01b03165b6040516001600160a01b0390911681526020016103d7565b348015610492575f80fd5b5061049d61012d5481565b6040519081526020016103d7565b3480156104b6575f80fd5b506104326104c5366004614b06565b61131a565b3480156104d5575f80fd5b506103946104e4366004614ad4565b6113ae565b3480156104f4575f80fd5b506101325461046f906001600160a01b031681565b348015610514575f80fd5b50610394610523366004614aeb565b6115b1565b348015610533575f80fd5b5061049d610542366004614b30565b611648565b348015610552575f80fd5b50610394610561366004614aeb565b611ac8565b610394610574366004614be1565b611b32565b348015610584575f80fd5b5061049d611cc0565b348015610598575f80fd5b5061049d61012f5481565b3480156105ae575f80fd5b5061046f611d84565b3480156105c2575f80fd5b5060655460ff16610432565b3480156105d9575f80fd5b5061049d7ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc981565b34801561060c575f80fd5b5061049d611dbb565b348015610620575f80fd5b5061049d7f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599581565b348015610653575f80fd5b50610394610662366004614aeb565b611dc5565b348015610672575f80fd5b506101335461046f906001600160a01b031681565b348015610692575f80fd5b5061049d6106a1366004614ad4565b611ea6565b3480156106b1575f80fd5b50610394611eb1565b3480156106c5575f80fd5b5061049d6106d4366004614aeb565b611f6e565b3480156106e4575f80fd5b506103946106f3366004614ad4565b611fc4565b348015610703575f80fd5b506103946122d6565b348015610717575f80fd5b5061049d610726366004614b30565b612317565b348015610736575f80fd5b50610394610745366004614ad4565b6123a3565b348015610755575f80fd5b506101355461046f906001600160a01b031681565b348015610775575f80fd5b50610394610784366004614ad4565b612419565b348015610794575f80fd5b506101395461046f906001600160a01b031681565b3480156107b4575f80fd5b506104326107c3366004614ad4565b61242a565b3480156107d3575f80fd5b5061049d6107e2366004614c83565b61264b565b3480156107f2575f80fd5b50610394610801366004614aeb565b612671565b348015610811575f80fd5b50610825610820366004614aeb565b612708565b6040516103d79190614ca6565b34801561083d575f80fd5b5061089d61084c366004614ad4565b604080518082019091525f8082526020820152505f90815261013060209081526040918290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff169082015290565b6040516103d79190614ce9565b3480156108b5575f80fd5b5061049d612882565b3480156108c9575f80fd5b506104326108d8366004614aeb565b6101376020525f908152604090205460ff1681565b3480156108f8575f80fd5b506101365461046f906001600160a01b031681565b348015610918575f80fd5b50610394610927366004614aeb565b6129f5565b348015610937575f80fd5b50610394610946366004614d11565b612a8c565b348015610956575f80fd5b5061049d610965366004614ad4565b612b25565b348015610975575f80fd5b50610394610984366004614d4f565b612baa565b348015610994575f80fd5b506103946109a3366004614c83565b612df4565b3480156109b3575f80fd5b5061049d61012e5481565b3480156109c9575f80fd5b506103946109d8366004614b30565b613029565b3480156109e8575f80fd5b506103946109f7366004614daa565b6135de565b348015610a07575f80fd5b50610432610a16366004614e4c565b613677565b348015610a26575f80fd5b506101345461046f906001600160a01b031681565b348015610a46575f80fd5b5061049d7f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c81565b348015610a79575f80fd5b5061046f7f8845a8ca8d79f29a0e1842e589203edb30c2ecf12612e709afb87c85a170da0a81565b348015610aac575f80fd5b50610394610abb366004614aeb565b613774565b348015610acb575f80fd5b5061049d610ada366004614ad4565b61380b565b348015610aea575f80fd5b506101315461046f906001600160a01b031681565b610b07613836565b610139546001600160a01b03163314610b4c576040517fc817887a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610132546040517f0a29e4c00000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152838116602483015290911690630a29e4c0906044015f604051808303815f87803b158015610bb2575f80fd5b505af1158015610bc4573d5f803e3d5ffd5b505050505050565b610bd4613889565b610bdc613836565b5f33610134546040516315f5987560e31b8152600481018590529192506001600160a01b038084169291169063afacc3a890602401602060405180830381865afa158015610c2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c509190614e7f565b6001600160a01b031614610c90576040517f5a7f2a1000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040517faaff9440000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063aaff944090602401602060405180830381865afa158015610cf1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d159190614e9a565b610d325760405163a02bf16760e01b815260040160405180910390fd5b5f828152610130602090815260408083208151808301835290546001600160d01b038116808352600160d01b90910465ffffffffffff16938201939093526101345491517f7f8661a1000000000000000000000000000000000000000000000000000000008152600481018790529093916001600160a01b031690637f8661a1906024016020604051808303815f875af1158015610dd2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df69190614eb5565b90508015610e1d576101345461013154610e1d916001600160a01b039182169116836138e2565b6040805180820182525f80825260208083018281528983526101309091529281209151925165ffffffffffff16600160d01b026001600160d01b039390931692909217905561012f8054849290610e75908490614ee0565b9091555050610136546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b03909116906342966c68906024015f604051808303815f87803b158015610ed7575f80fd5b505af1158015610ee9573d5f803e3d5ffd5b50505050610f11848284610efd9190614ee0565b610131546001600160a01b031691906138e2565b846001600160a01b0385167fe08737ac48a1dab4b1a46c7dc9398bd5bfc6d7ad6fabb7cd8caa254de14def35610f478486614ee0565b61012f546040805192835242602084015282015260600160405180910390a350505050610f7360018055565b50565b610f7e613889565b6097547ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc990610fbb906001600160a01b031630335b845f36613996565b610131546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015611002573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110269190614eb5565b90505f61012f54826110389190614ee0565b9050805f03611073576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61108b33610131546001600160a01b031690836138e2565b60405181815233907fab2246061d7b0dd3631d037e3f6da75782ae489eeb9f6af878a4b25df9b07c779060200160405180910390a25050506110cc60018055565b565b6001600160a01b037f0000000000000000000000001566e01defda351575b54d90a85446e16cf5508e1630036111715760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f0000000000000000000000001566e01defda351575b54d90a85446e16cf5508e6001600160a01b03166111cc7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146112485760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401611168565b61125181613a7a565b604080515f80825260208201909252610f7391839190613ab3565b7389203edb30c2ecf12612e709afb87c85a170da0a5f9081526101376020527f8bcd466e66a74972639fe49f36525a3ea82d0290670747e745243d99fd7a95765460ff16806112d357506001600160a01b0382165f908152610137602052604090205460ff165b92915050565b6097547f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c90611312906001600160a01b03163033610fb3565b610f73613c53565b610136546040517f430c20810000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018490525f92169063430c208190604401602060405180830381865afa158015611383573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113a79190614e9a565b9392505050565b6113b6613889565b6113be613836565b610134546040516315f5987560e31b8152600481018390525f916001600160a01b03169063afacc3a890602401602060405180830381865afa158015611406573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142a9190614e7f565b9050336001600160a01b038216811461146f576040517f5a7f2a1000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820182525f808252858152610130602081815284832054600160d01b810465ffffffffffff168286018190529389905291815284518086019095526001600160d01b0390911684528301526114cb91859190613ca5565b610134546040517f726123b4000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b039091169063726123b4906024015f604051808303815f87803b158015611528575f80fd5b505af115801561153a573d5f803e3d5ffd5b5050610136546040516323b872dd60e01b81523060048201526001600160a01b0385811660248301526044820188905290911692506323b872dd91506064015f604051808303815f87803b158015611590575f80fd5b505af11580156115a2573d5f803e3d5ffd5b505050505050610f7360018055565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906115ea906001600160a01b03163033610fb3565b610133546001600160a01b0316801561161657604051637b1616c160e11b815260040160405180910390fd5b5050610133805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f611651613836565b815f0361168a576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33610136546040516331a9108f60e11b8152600481018790529192505f916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156116d9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116fd9190614e7f565b90506001600160a01b03811661173f576040517f7f51e10200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117488161126c565b61177e576040517f1c57424200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611788828661131a565b6117be576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f85815261013060209081526040918290208251808401909352546001600160d01b038116808452600160d01b90910465ffffffffffff16918301919091528510611835576040517fbd5fd08400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61183f86613d25565b825161184b9190614ef3565b90505f61185787613d25565b905061012d54826001600160d01b0316108061187e575061012d54816001600160d01b0316105b156118b5576040517fc2f5625a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118e988846040518060400160405280866001600160d01b03168152602001876020015165ffffffffffff16815250613ca5565b6040805180820182526001600160d01b03808516825260208681015165ffffffffffff9081168285019081525f8e81526101309093529482209351945116600160d01b029390911692909217905561012e8054829061194790614f1a565b91905081905590506101395f9054906101000a90046001600160a01b03166001600160a01b031663ab19fdd16040518060600160405280886001600160a01b031681526020018c815260200160405180604001604052805f6001600160d01b031681526020015f65ffffffffffff168152508152506040518060600160405280896001600160a01b0316815260200185815260200160405180604001604052805f6001600160d01b031681526020015f65ffffffffffff168152508152506040518363ffffffff1660e01b8152600401611a22929190614f95565b5f604051808303815f87803b158015611a39575f80fd5b505af1158015611a4b573d5f803e3d5ffd5b5050506001600160d01b038316855250611a66858286613da7565b604080516001600160a01b03881681526001600160d01b038581166020830152841681830152905182918b917f4c6f4301c366fcacd61611cde4448f4799931df3d6d6451b67e5d065f77557949181900360600190a398975050505050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611b01906001600160a01b03163033610fb3565b50610132805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b037f0000000000000000000000001566e01defda351575b54d90a85446e16cf5508e163003611bd05760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401611168565b7f0000000000000000000000001566e01defda351575b54d90a85446e16cf5508e6001600160a01b0316611c2b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614611ca75760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401611168565b611cb082613a7a565b611cbc82826001613ab3565b5050565b5f306001600160a01b037f0000000000000000000000001566e01defda351575b54d90a85446e16cf5508e1614611d5f5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611168565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f611db67f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b5f611db642612b25565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611dfe906001600160a01b03163033610fb3565b6101365474010000000000000000000000000000000000000000900460ff1615611e54576040517fd133196200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5061013680547fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b039092169190911774010000000000000000000000000000000000000000179055565b5f6112d38242612317565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611eea906001600160a01b03163033610fb3565b7389203edb30c2ecf12612e709afb87c85a170da0a5f81905261013760209081527f8bcd466e66a74972639fe49f36525a3ea82d0290670747e745243d99fd7a9576805460ff191660019081179091556040519081527f7aa63f9a2aa7db42378fcf8e7d24bf5b848f0c86c89ab303819493c8b9a8fb01910160405180910390a250565b5f80611f7983612708565b90505f5b8151811015611fbd57611fa9828281518110611f9b57611f9b614fb1565b602002602001015142612317565b611fb39084614fc5565b9250600101611f7d565b5050919050565b611fcc613889565b611fd4613836565b611fdd81611ea6565b5f03611ffc5760405163a02bf16760e01b815260040160405180910390fd5b610133546040517f66dec1ab00000000000000000000000000000000000000000000000000000000815260048101839052600160248201525f916001600160a01b0316906366dec1ab9060440160c060405180830381865afa158015612064573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120889190614ff7565b905080604001516fffffffffffffffffffffffffffffffff164214806120bb57505f828152610138602052604090205442145b156120f2576040517fd49d3acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610136546040516331a9108f60e11b8152600481018490525f916001600160a01b031690636352211e90602401602060405180830381865afa15801561213a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215e9190614e7f565b5f848152610130602090815260408083208151808301835290546001600160d01b038116825265ffffffffffff600160d01b90910481168285019081528351808501909452948352935190931691810191909152919250906121c39085908390613ca5565b610136546001600160a01b03166323b872dd336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152306024820152604481018790526064015f604051808303815f87803b158015612239575f80fd5b505af115801561224b573d5f803e3d5ffd5b5050610134546040517f5fa00c75000000000000000000000000000000000000000000000000000000008152600481018890526001600160a01b0386811660248301529091169250635fa00c7591506044015f604051808303815f87803b1580156122b4575f80fd5b505af11580156122c6573d5f803e3d5ffd5b50505050505050610f7360018055565b6097547f539440820030c4994db4e31b6b800deafd503688728f932addfe7a410515c14c9061230f906001600160a01b03163033610fb3565b610f73613e4b565b610133546040517f893c37f200000000000000000000000000000000000000000000000000000000815260048101849052602481018390525f916001600160a01b03169063893c37f290604401602060405180830381865afa15801561237f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113a79190614eb5565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906123dc906001600160a01b03163033610fb3565b61012d8290556040518281527fc50a7f0bdf88c216b2541b0bdea26f22305460e39ffc672ec1a7501732c5ba819060200160405180910390a15050565b612421613836565b610f7381611fc4565b610136546040516331a9108f60e11b8152600481018390525f9182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612476573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061249a9190614e7f565b610139546040517fe520df0b000000000000000000000000000000000000000000000000000000008152600481018690529192505f916001600160a01b039091169063e520df0b90602401602060405180830381865afa158015612500573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125249190614e9a565b90508061253457505f9392505050565b610139546040517f587cde1e0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f92169063587cde1e90602401602060405180830381865afa158015612596573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125ba9190614e7f565b610132546040517f5f8dd6490000000000000000000000000000000000000000000000000000000081526001600160a01b038084166004830152929350911690635f8dd64990602401602060405180830381865afa15801561261e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126429190614e9a565b95945050505050565b5f612654613889565b61265c613836565b6126668383613e88565b90506112d360018055565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906126aa906001600160a01b03163033610fb3565b610139546001600160a01b031680156126d657604051637b1616c160e11b815260040160405180910390fd5b5050610139805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610136546040516370a0823160e01b81526001600160a01b03838116600483015260609216905f9082906370a0823190602401602060405180830381865afa158015612756573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061277a9190614eb5565b90505f8167ffffffffffffffff81111561279657612796614b50565b6040519080825280602002602001820160405280156127bf578160200160208202803683370190505b5090505f5b82811015612879576040517f2f745c590000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260248201839052851690632f745c5990604401602060405180830381865afa158015612830573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128549190614eb5565b82828151811061286657612866614fb1565b60209081029190910101526001016127c4565b50949350505050565b610136546040516370a0823160e01b81523060048201525f916001600160a01b031690829082906370a0823190602401602060405180830381865afa1580156128cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128f19190614eb5565b90505f5b818110156129ef576040517f2f745c59000000000000000000000000000000000000000000000000000000008152306004820152602481018290525f906001600160a01b03851690632f745c5990604401602060405180830381865afa158015612961573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129859190614eb5565b6040805180820182525f808252602091820181905283815261013082528290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff1690820152909150516129e4906001600160d01b031686614fc5565b9450506001016128f5565b50505090565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590612a2e906001600160a01b03163033610fb3565b610135546001600160a01b03168015612a5a57604051637b1616c160e11b815260040160405180910390fd5b5050610135805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b612a94613836565b610136546001600160a01b03163314612ad9576040517fabb21b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81815261013060209081526040918290208251808401909352546001600160d01b0381168352600160d01b900465ffffffffffff1690820152612b1f84848484614254565b50505050565b610133546040517f56ee9ca2000000000000000000000000000000000000000000000000000000008152600481018390525f916001600160a01b0316906356ee9ca290602401602060405180830381865afa158015612b86573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112d39190614eb5565b5f54610100900460ff1615808015612bc857505f54600160ff909116105b80612be15750303b158015612be157505f5460ff166001145b612c535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401611168565b5f805460ff191660011790558015612c74575f805461ff0019166101001790555b612c7c6142d7565b612c84614349565b612c8d846143bb565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cc9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ced919061508b565b60ff16601214612d29576040517f224495f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61013180546001600160a01b0380881673ffffffffffffffffffffffffffffffffffffffff199283161790925561013580549286169290911691909117905561012d8290556040517fc50a7f0bdf88c216b2541b0bdea26f22305460e39ffc672ec1a7501732c5ba8190612da09084815260200190565b60405180910390a18015612ded575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b612dfc613889565b6097547ffdecf383ad5026ade6d21db07b04781efb7ede2811d8b5fe299044cc4bb91fc990612e35906001600160a01b03163033610fb3565b610136546040516331a9108f60e11b81526004810185905230916001600160a01b031690636352211e90602401602060405180830381865afa158015612e7d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ea19190614e7f565b6001600160a01b031614612ee1576040517f351261fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040516315f5987560e31b8152600481018590525f916001600160a01b03169063afacc3a890602401602060405180830381865afa158015612f29573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f4d9190614e7f565b6001600160a01b031614612f745760405163a02bf16760e01b815260040160405180910390fd5b610136546040516323b872dd60e01b81523060048201526001600160a01b03848116602483015260448201869052909116906323b872dd906064015f604051808303815f87803b158015612fc6575f80fd5b505af1158015612fd8573d5f803e3d5ffd5b50505050816001600160a01b03167ffe5a47ddd083557617250fa1aad6e9578f78201e8a189b20ccb7602eabde84168460405161301791815260200190565b60405180910390a250611cbc60018055565b613031613836565b3381830361306b576040517f93b50ef200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610136546040516331a9108f60e11b8152600481018590525f916001600160a01b031690636352211e90602401602060405180830381865afa1580156130b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906130d79190614e7f565b610136546040516331a9108f60e11b8152600481018690529192505f916001600160a01b0390911690636352211e90602401602060405180830381865afa158015613124573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131489190614e7f565b9050806001600160a01b0316826001600160a01b031614613195576040517f5a2b356700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61319f838661131a565b15806131b257506131b0838561131a565b155b156131e9576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f858152610130602081815260408084208151808301835290546001600160d01b03808216835265ffffffffffff600160d01b928390048116848701528b8852958552958390208351808501909452549586168352909404909216908201526132528282613677565b613292576040517ff77597cb0000000000000000000000000000000000000000000000000000000081526004810188905260248101879052604401611168565b610133546040517f66dec1ab00000000000000000000000000000000000000000000000000000000815260048101899052600160248201525f916001600160a01b0316906366dec1ab9060440160c060405180830381865afa1580156132fa573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061331e9190614ff7565b90504281604001516fffffffffffffffffffffffffffffffff16148061335157505f888152610138602052604090205442145b15613368575f878152610138602052604090204290555b6101395460408051606080820183526001600160a01b0389811680845260208085018f90528486018a90528551938401865290835282018c905281840187905292517fd22e849d000000000000000000000000000000000000000000000000000000008152929093169263d22e849d926133e6929190600401614f95565b5f604051808303815f87803b1580156133fd575f80fd5b505af115801561340f573d5f803e3d5ffd5b5050610136546040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018c90526001600160a01b0390911692506342966c6891506024015f604051808303815f87803b158015613470575f80fd5b505af1158015613482573d5f803e3d5ffd5b50506040805180820182525f80825260208083018281528e83526101308252848320935190516001600160d01b03909116600160d01b65ffffffffffff9283160217909355835180850190945290835287810151909116908201526134ec92508a91508590613ca5565b815183515f916134fb916150ab565b905061353188846040518060400160405280856001600160d01b03168152602001876020015165ffffffffffff16815250613ca5565b6040805180820182526001600160d01b0383811680835260208781015165ffffffffffff9081168286019081525f8f8152610130845287902095519051909116600160d01b02908416179093558751875185519184168252909216928201929092529182015288908a906001600160a01b038a16907f78ed2846b31baf196e1fe55d3f6a1b664b2cdeaf8b819a802686b60fb46652b89060600160405180910390a4505050505050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590613617906001600160a01b03163033610fb3565b6001600160a01b0383165f8181526101376020908152604091829020805460ff191686151590811790915591519182527f7aa63f9a2aa7db42378fcf8e7d24bf5b848f0c86c89ab303819493c8b9a8fb01910160405180910390a2505050565b5f806101335f9054906101000a90046001600160a01b03166001600160a01b03166322e67e716040518163ffffffff1660e01b8152600401602060405180830381865afa1580156136ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906136ee9190614eb5565b90505f81856020015165ffffffffffff166137099190614fc5565b90505f82856020015165ffffffffffff166137249190614fc5565b9050856020015165ffffffffffff16856020015165ffffffffffff1614158015613758575042811015806137585750428210155b15613768575f93505050506112d3565b50600195945050505050565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db5995906137ad906001600160a01b03163033610fb3565b610134546001600160a01b031680156137d957604051637b1616c160e11b815260040160405180910390fd5b5050610134805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f613814613889565b61381c613836565b6138268233613e88565b905061383160018055565b919050565b60655460ff16156110cc5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401611168565b6002600154036138db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611168565b6002600155565b6040516001600160a01b03831660248201526044810182905261398b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614454565b505050565b60018055565b6040517ffdef91060000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063fdef9106906139e390889088908890889088906004016150cb565b602060405180830381865afa1580156139fe573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613a229190614e9a565b610bc4576040517f32dbe3b40000000000000000000000000000000000000000000000000000000081526001600160a01b03808816600483015280871660248301528516604482015260648101849052608401611168565b6097547f5153bc4ddea3acc82e49822cf2356cf42e16e0ba80c942840692ca4dd7db599590611cbc906001600160a01b03163033610fb3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613ae65761398b8361453a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613b40575060408051601f3d908101601f19168201909252613b3d91810190614eb5565b60015b613bb25760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401611168565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114613c475760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401611168565b5061398b838383614605565b613c5b614629565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610133546040517f9cfba62c0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690639cfba62c90613cf39086908690869060040161511d565b5f604051808303815f87803b158015613d0a575f80fd5b505af1158015613d1c573d5f803e3d5ffd5b50505050505050565b5f6001600160d01b03821115613da35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f30382062697473000000000000000000000000000000000000000000000000006064820152608401611168565b5090565b5f8281526101306020908152604080832084518386015165ffffffffffff16600160d01b026001600160d01b03909116179055805180820190915282815290810191909152613df890839083613ca5565b610136546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052909116906340c10f1990604401613cf3565b613e53613836565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613c883390565b5f825f03613ec2576040517f1f2a200500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012d54831015613eff576040517fc2f5625a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61013554604080517fb97bde0e00000000000000000000000000000000000000000000000000000000815290515f926001600160a01b03169163b97bde0e9160048083019260209291908290030181865afa158015613f60573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613f849190614eb5565b90508361012f5f828254613f989190614fc5565b925050819055505f61012e5f8154613faf90614f1a565b91905081905590505f6040518060400160405280613fcc88613d25565b6001600160d01b03168152602001613fe38561467b565b65ffffffffffff9081169091525f84815261013060209081526040808320855183870151909516600160d01b026001600160d01b0390951694909417909355825180840190935281835282015290915061403f90839083613ca5565b610131546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015614086573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140aa9190614eb5565b90506140c533610131546001600160a01b031690308a6146f8565b6140cf8782614fc5565b610131546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015614116573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061413a9190614eb5565b14614171576040517f172c923300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61417d5f878585614254565b610136546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015260248201869052909116906340c10f19906044015f604051808303815f87803b1580156141e2575f80fd5b505af11580156141f4573d5f803e3d5ffd5b505050508383876001600160a01b03167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f98a61012f54604051614241929190918252602082015260400190565b60405180910390a4509095945050505050565b610139546040517fa2960aaa0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063a2960aaa906142a4908790879087908790600401615173565b5f604051808303815f87803b1580156142bb575f80fd5b505af11580156142cd573d5f803e3d5ffd5b5050505050505050565b5f54610100900460ff166143415760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6110cc614730565b5f54610100900460ff166143b35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6110cc61479a565b5f54610100900460ff166144255760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b5f6144a8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148109092919063ffffffff16565b905080515f14806144c85750808060200190518101906144c89190614e9a565b61398b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611168565b6001600160a01b0381163b6145b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401611168565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b61460e83614826565b5f8251118061461a5750805b1561398b57612b1f8383614865565b60655460ff166110cc5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401611168565b5f65ffffffffffff821115613da35760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f38206269747300000000000000000000000000000000000000000000000000006064820152608401611168565b6040516001600160a01b0380851660248301528316604482015260648101829052612b1f9085906323b872dd60e01b90608401613927565b5f54610100900460ff166139905760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b5f54610100900460ff166148045760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401611168565b6065805460ff19169055565b606061481e84845f8561488a565b949350505050565b61482f8161453a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a250565b60606113a7838360405180606001604052806027815260200161522a60279139614978565b6060824710156149025760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401611168565b5f80866001600160a01b0316858760405161491d91906151dc565b5f6040518083038185875af1925050503d805f8114614957576040519150601f19603f3d011682016040523d82523d5f602084013e61495c565b606091505b509150915061496d878383876149ec565b979650505050505050565b60605f80856001600160a01b03168560405161499491906151dc565b5f60405180830381855af49150503d805f81146149cc576040519150601f19603f3d011682016040523d82523d5f602084013e6149d1565b606091505b50915091506149e2868383876149ec565b9695505050505050565b60608315614a5a5782515f03614a53576001600160a01b0385163b614a535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611168565b508161481e565b61481e8383815115614a6f5781518083602001fd5b8060405162461bcd60e51b815260040161116891906151f7565b6001600160a01b0381168114610f73575f80fd5b5f8060408385031215614aae575f80fd5b8235614ab981614a89565b91506020830135614ac981614a89565b809150509250929050565b5f60208284031215614ae4575f80fd5b5035919050565b5f60208284031215614afb575f80fd5b81356113a781614a89565b5f8060408385031215614b17575f80fd5b8235614b2281614a89565b946020939093013593505050565b5f8060408385031215614b41575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52604160045260245ffd5b6040516080810167ffffffffffffffff81118282101715614b8757614b87614b50565b60405290565b6040516060810167ffffffffffffffff81118282101715614b8757614b87614b50565b604051601f8201601f1916810167ffffffffffffffff81118282101715614bd957614bd9614b50565b604052919050565b5f8060408385031215614bf2575f80fd5b8235614bfd81614a89565b915060208381013567ffffffffffffffff80821115614c1a575f80fd5b818601915086601f830112614c2d575f80fd5b813581811115614c3f57614c3f614b50565b614c5184601f19601f84011601614bb0565b91508082528784828501011115614c66575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f8060408385031215614c94575f80fd5b823591506020830135614ac981614a89565b602080825282518282018190525f9190848201906040850190845b81811015614cdd57835183529284019291840191600101614cc1565b50909695505050505050565b81516001600160d01b0316815260208083015165ffffffffffff1690820152604081016112d3565b5f805f60608486031215614d23575f80fd5b8335614d2e81614a89565b92506020840135614d3e81614a89565b929592945050506040919091013590565b5f805f8060808587031215614d62575f80fd5b8435614d6d81614a89565b93506020850135614d7d81614a89565b92506040850135614d8d81614a89565b9396929550929360600135925050565b8015158114610f73575f80fd5b5f8060408385031215614dbb575f80fd5b8235614dc681614a89565b91506020830135614ac981614d9d565b5f60408284031215614de6575f80fd5b6040516040810181811067ffffffffffffffff82111715614e0957614e09614b50565b60405290508082356001600160d01b0381168114614e25575f80fd5b8152602083013565ffffffffffff81168114614e3f575f80fd5b6020919091015292915050565b5f8060808385031215614e5d575f80fd5b614e678484614dd6565b9150614e768460408501614dd6565b90509250929050565b5f60208284031215614e8f575f80fd5b81516113a781614a89565b5f60208284031215614eaa575f80fd5b81516113a781614d9d565b5f60208284031215614ec5575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156112d3576112d3614ecc565b6001600160d01b03828116828216039080821115614f1357614f13614ecc565b5092915050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614f4a57614f4a614ecc565b5060010190565b6001600160a01b03815116825260208101516020830152604081015161398b604084018280516001600160d01b0316825260209081015165ffffffffffff16910152565b6101008101614fa48285614f51565b6113a76080830184614f51565b634e487b7160e01b5f52603260045260245ffd5b808201808211156112d3576112d3614ecc565b80516fffffffffffffffffffffffffffffffff81168114613831575f80fd5b5f60c08284031215615007575f80fd5b61500f614b64565b82518152602061502160208501614fd8565b602083015261503260408501614fd8565b604083015284607f850112615045575f80fd5b61504d614b8d565b8060c086018781111561505e575f80fd5b606087015b8181101561507a5780518452928401928401615063565b505060608401525090949350505050565b5f6020828403121561509b575f80fd5b815160ff811681146113a7575f80fd5b6001600160d01b03818116838216019080821115614f1357614f13614ecc565b5f6001600160a01b03808816835280871660208401525084604083015260806060830152826080830152828460a08401375f60a0848401015260a0601f19601f85011683010190509695505050505050565b83815260a0810161514c602083018580516001600160d01b0316825260209081015165ffffffffffff16910152565b82516001600160d01b03166060830152602083015165ffffffffffff16608083015261481e565b6001600160a01b038581168252841660208201526040810183905260a08101612642606083018480516001600160d01b0316825260209081015165ffffffffffff16910152565b5f5b838110156151d45781810151838201526020016151bc565b50505f910152565b5f82516151ed8184602087016151ba565b9190910192915050565b602081525f82518060208401526152158160408501602087016151ba565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564
Loading...
Loading
Loading...
Loading
 0x1566e01Defda351575B54d90a85446E16CF5508E
 
                                0x1566e01Defda351575B54d90a85446E16CF5508E
                            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.

