ETH Price: $2,524.94 (-2.74%)

Contract

0xf00ffF22a7CA039edCc0b8D32764ACCB5dD5cd08
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60a06040204647162024-08-05 20:21:3556 days ago1722889295IN
 Create: LiquidStaking
0 ETH0.028035796.00779661

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LiquidStaking

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
File 1 of 30 : LiquidStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {OwnableUpgradeable} from "@openzeppelin-contracts-upgradeable/access/OwnableUpgradeable.sol";
import {Initializable} from "@openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin-contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin-contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin-contracts-upgradeable/security/PausableUpgradeable.sol";
import {INodeOperatorsRegistry} from "./interfaces/INodeOperatorsRegistry.sol";
import {ILiquidStaking} from "./interfaces/ILiquidStaking.sol";
import {INETH} from "./interfaces/INETH.sol";
import {IVNFT} from "./interfaces/IVNFT.sol";
import {IDepositContract} from "./deposit/DepositContract.sol";
import {IWithdrawOracle} from "./interfaces/IWithdrawOracle.sol";
import {IELVault} from "./interfaces/IELVault.sol";
import {ERC721A__IERC721ReceiverUpgradeable} from "ERC721A-Upgradeable/ERC721AUpgradeable.sol";
import {IConsensusVault} from "./interfaces/IConsensusVault.sol";
import {IVaultManager} from "./interfaces/IVaultManager.sol";
import {IWithdrawalRequest} from "./interfaces/IWithdrawalRequest.sol";
import {IOFT, SendParam, MessagingFee} from "./interfaces/IOFT.sol";

/**
 * @title MultichainzLSD LiquidStaking Contract
 *
 * MultichainzLSD is a DAO that provides decentralized solutions for Ethereum liquidity,
 * The MultichainzLSD protocol is a smart contract for next-generation liquid staking derivatives,
 * which includes all the concepts of traditional liquid staking, re-staking, distributed validators, and validator NFTs in a single protocol.
 *
 * Our vision is to use our innovative liquidity solution to provide more options for the Ethereum liquidity market,
 * thereby making Ethereum staking more decentralized.
 */
contract LiquidStaking is
    ILiquidStaking,
    Initializable,
    UUPSUpgradeable,
    ReentrancyGuardUpgradeable,
    OwnableUpgradeable,
    PausableUpgradeable,
    ERC721A__IERC721ReceiverUpgradeable
{
    IDepositContract public depositContract;

    INodeOperatorsRegistry public nodeOperatorRegistryContract;

    INETH public nETHContract;

    IVNFT public vNFTContract;

    IWithdrawOracle public withdrawOracleContract;

    bytes public liquidStakingWithdrawalCredentials;

    // deposit fee rate
    uint256 public depositFeeRate; // 1% to 5%
    uint256 internal constant totalBasisPoints = 10000;

    uint256 internal constant DEPOSIT_SIZE = 32 ether;

    // operator's internal stake pool, key is operator_id
    mapping(uint256 => uint256) public operatorPoolBalances;

    // unused funds in the current liquidStaking pool
    uint256 internal operatorPoolBalancesSum;

    // State variables for Time-weighted Average Exchange Rate (TWAER)
    uint256 private contractStartTime;
    uint256 private lastUpdateTime;
    uint256 private cumulativeExchangeRate;

    // dao address
    address public dao;
    // dao treasury address
    address public daoVaultAddress;

    // v2 storage

    address public vaultManagerContractAddress;
    IConsensusVault public consensusVaultContract;
    IWithdrawalRequest public withdrawalRequestContract;

    // operator's internal nft stake pool, key is operator_id
    mapping(uint256 => uint256) public operatorNftPoolBalances;

    struct StakeInfo {
        uint256 operatorId;
        uint256 quota;
    }
    //store validator nft transfer details
    struct nftToken {
        address operator;
        address from;
        uint256 tokenId;
        bytes data;
    }

    // Mapping from tokenId to its details
    mapping(uint256 => nftToken) public receivedTokens;

    // key is user address, value is StakeInfo
    mapping(address => StakeInfo[]) internal stakeRecords;

    // key is quit operatorId, value is asign operatorId
    mapping(uint256 => uint256) public reAssignRecords;

    uint256 public operatorCanLoanAmounts;

    // key is operatorId, value is loan amounts
    mapping(uint256 => uint256) public operatorLoanRecords;
    // key is operatorId, value is loan blockNumber
    mapping(uint256 => uint256) public operatorLoadBlockNumbers;

    IOFT public xETHAdaptor;

    error PermissionDenied();
    error RequireBlacklistOperator();
    error AssignMustSameOperator();
    error InvalidParameter();
    error RequireOperatorTrusted();
    error InvalidAmount();
    error InvalidDaoVaultAddr();
    error UnstakeEthNoQuota();
    error OperatorLoanFailed();
    error InvalidWithdrawalCredentials();
    error InsufficientFunds();
    error OperatorHasArrears();
    error TotalEthIsZero();
    error TransferFailed();

    modifier onlyDao() {
        if (msg.sender != dao) revert PermissionDenied();
        _;
    }

    modifier onlyVaultManager() {
        if (msg.sender != vaultManagerContractAddress)
            revert PermissionDenied();
        _;
    }

    modifier onlyWithdrawalRequest() {
        if (msg.sender != address(withdrawalRequestContract))
            revert PermissionDenied();
        _;
    }

    function _authorizeUpgrade(address) internal override onlyOwner {}

    /**
     * @notice For operators added to the blacklist by dao,
     *
     * The Dao has the right to distribute the available balance on this operator to other active operators,
     * and the allocation share will be determined through proposals
     * @param _assignOperatorId blacklist operator id
     * @param _operatorId The operator id of the allocation share
     */
    function assignOperator(
        uint256 _assignOperatorId,
        uint256 _operatorId
    ) external onlyOwner {
        if (!nodeOperatorRegistryContract.isTrustedOperator(_operatorId))
            revert RequireOperatorTrusted();
        if (
            !nodeOperatorRegistryContract.isBlacklistOperator(_assignOperatorId)
        ) revert RequireBlacklistOperator();

        uint256 assignOperatorBalances = _assignOperator(
            _assignOperatorId,
            _operatorId
        );

        // Re-assign and ensure the balance transfer is properly handled.
        reAssignRecords[_assignOperatorId] = _operatorId;
        emit OperatorAssigned(
            _assignOperatorId,
            _operatorId,
            assignOperatorBalances
        );
    }

    function _assignOperator(
        uint256 _assignOperatorId,
        uint256 _operatorId
    ) internal returns (uint256) {
        uint256 assignOperatorBalances = operatorPoolBalances[
            _assignOperatorId
        ];
        uint256 loanAmounts = operatorLoanRecords[_assignOperatorId];
        if (loanAmounts > 0) {
            if (loanAmounts > assignOperatorBalances) {
                operatorLoanRecords[
                    _assignOperatorId
                ] -= assignOperatorBalances;
                assignOperatorBalances = 0;
            } else {
                operatorLoanRecords[_assignOperatorId] = 0;
                assignOperatorBalances -= loanAmounts;
            }
        }

        operatorPoolBalances[_operatorId] += assignOperatorBalances;
        operatorPoolBalances[_assignOperatorId] = 0;

        return assignOperatorBalances;
    }

    /**
     * @notice stake eth to designated operator, stake ETH to get nETH
     * @param _operatorId operator id
     */
    function stakeETH(
        uint256 _operatorId
    ) external payable nonReentrant whenNotPaused {
        if (msg.value < 1000 gwei) revert InvalidAmount();

        // Ensure operator is trusted and has sufficient pledge
        if (!nodeOperatorRegistryContract.isTrustedOperator(_operatorId))
            revert RequireOperatorTrusted();

        // Calculate and transfer the deposit fee if applicable
        uint256 depositFeeAmount = 0;
        uint256 depositPoolAmount = msg.value;
        if (depositFeeRate > 0) {
            depositFeeAmount = (msg.value * depositFeeRate) / totalBasisPoints;
            depositPoolAmount = msg.value - depositFeeAmount;
            if (daoVaultAddress == address(0)) revert InvalidDaoVaultAddr();
            payable(daoVaultAddress).transfer(depositFeeAmount);
        }

        // Update exchange rate before minting nETH
        _updateCumulativeExchangeRate();
        uint256 currentRate = _getCurrentExchangeRate();
        //Convert ETH to nETH
        uint256 amountOut = (depositPoolAmount * 1e18) / currentRate;

        nETHContract.whiteListMint(amountOut, msg.sender);
        _updateStakeFundLedger(_operatorId, depositPoolAmount);
        _stakeRecords(_operatorId, msg.sender, amountOut);

        emit EthStake(_operatorId, msg.sender, msg.value, amountOut);
    }

    function _updateStakeFundLedger(
        uint256 _operatorId,
        uint256 _amount
    ) internal {
        operatorPoolBalancesSum += _amount;

        uint256 loanAmounts = operatorLoanRecords[_operatorId];
        if (loanAmounts > 0) {
            if (loanAmounts > _amount) {
                operatorLoanRecords[_operatorId] -= _amount;
                _amount = 0;
            } else {
                operatorLoanRecords[_operatorId] = 0;
                operatorLoadBlockNumbers[_operatorId] = 0;
                _amount = _amount - loanAmounts;
            }
        }

        if (_amount > 0) {
            operatorPoolBalances[_operatorId] += _amount;
        }
    }

    function _stakeRecords(
        uint256 _operatorId,
        address _from,
        uint256 _amount
    ) internal {
        StakeInfo[] memory records = stakeRecords[_from];
        if (records.length == 0) {
            stakeRecords[_from].push(
                StakeInfo({operatorId: _operatorId, quota: _amount})
            );
        } else {
            for (uint256 i = 0; i < records.length; ++i) {
                if (records[i].operatorId == _operatorId) {
                    stakeRecords[_from][i].quota += _amount;
                    return;
                }
            }

            stakeRecords[_from].push(
                StakeInfo({operatorId: _operatorId, quota: _amount})
            );
        }
    }

    /**
     * @notice unstake neth to designated operator
     * @param _operatorId operator id
     * @param _amounts untake neth amount
     */
    function unstakeETH(
        uint256 _operatorId,
        uint256 _amounts,
        address onBehalfOf
    ) public nonReentrant whenNotPaused returns (uint256) {
        if (nETHContract.balanceOf(msg.sender) < _amounts)
            revert InsufficientFunds();

        // Update the exchange rate before processing the unstake
        _updateCumulativeExchangeRate();
        uint256 currentRate = _getCurrentExchangeRate();
        uint256 amountOut = (_amounts * currentRate) / 1e18; // Convert nETH to ETH

        _unstake(_operatorId, onBehalfOf, _amounts);
        uint256 targetOperatorId = _updateUnstakeFundLedger(
            amountOut,
            _operatorId
        );

        nETHContract.whiteListBurn(_amounts, msg.sender);
        payable(msg.sender).transfer(amountOut);

        emit EthUnstake(
            _operatorId,
            targetOperatorId,
            msg.sender,
            _amounts,
            amountOut
        );
        return amountOut;
    }

    function _unstake(
        uint256 _operatorId,
        address _from,
        uint256 _amount
    ) internal {
        StakeInfo[] memory records = stakeRecords[_from];
        if (records.length == 0) revert UnstakeEthNoQuota();

        for (uint256 i = 0; i < records.length; ++i) {
            if (records[i].operatorId == _operatorId) {
                if (stakeRecords[_from][i].quota < _amount)
                    revert UnstakeEthNoQuota();
                stakeRecords[_from][i].quota -= _amount;
                return;
            }
        }

        revert UnstakeEthNoQuota();
    }

    function _updateUnstakeFundLedger(
        uint256 _ethOutAmount,
        uint256 _operatorId
    ) internal returns (uint256) {
        uint256 targetOperatorId = _resolveFinalOperator(_operatorId);

        uint256 operatorBalances = operatorPoolBalances[targetOperatorId];
        if (operatorBalances >= _ethOutAmount) {
            operatorPoolBalances[targetOperatorId] -= _ethOutAmount;
        } else {
            // Handle the scenario where the balance is insufficient.
            _handleInsufficientBalance(targetOperatorId, _ethOutAmount);
        }

        operatorPoolBalancesSum -= _ethOutAmount;

        return targetOperatorId;
    }

    function _resolveFinalOperator(
        uint256 _operatorId
    ) internal view returns (uint256) {
        while (reAssignRecords[_operatorId] != 0) {
            _operatorId = reAssignRecords[_operatorId];
        }
        return _operatorId;
    }

    function _handleInsufficientBalance(
        uint256 targetOperatorId,
        uint256 _ethOutAmount
    ) internal {
        uint256 newLoanAmounts = _ethOutAmount -
            operatorPoolBalances[targetOperatorId];
        uint256 operatorLoanAmounts = operatorLoanRecords[targetOperatorId];

        if (operatorCanLoanAmounts >= (operatorLoanAmounts + newLoanAmounts)) {
            operatorLoanRecords[targetOperatorId] += newLoanAmounts;
            operatorPoolBalances[targetOperatorId] = 0;
        } else {
            revert OperatorLoanFailed();
        }
    }

    /**
     * @notice Stake 32 multiples of eth to get the corresponding number of vNFTs
     * @param _operatorId operator id
     */
    function stakeNFT(
        uint256 _operatorId
    ) external payable nonReentrant whenNotPaused {
        // operatorId must be a trusted operator
        if (!nodeOperatorRegistryContract.isTrustedOperator(_operatorId))
            revert RequireOperatorTrusted();
        if (msg.value == 0 || msg.value % DEPOSIT_SIZE != 0)
            revert InvalidAmount();

        uint256 mintNftsCount = msg.value / DEPOSIT_SIZE;
        for (uint256 i = 0; i < mintNftsCount; ++i) {
            vNFTContract.whiteListMint(
                bytes(""),
                liquidStakingWithdrawalCredentials,
                msg.sender,
                _operatorId
            );
        }

        operatorNftPoolBalances[_operatorId] += msg.value;

        emit NftStake(_operatorId, msg.sender, mintNftsCount);
    }

    /**
     * Operator function
     * @notice registers validators on network by operator
     * @param _pubkeys validator pubkeys
     * @param _signatures validator signatures
     * @param _depositDataRoots validator depositDataRoots
     */
    function registerValidator(
        bytes[] calldata _pubkeys,
        bytes[] calldata _signatures,
        bytes32[] calldata _depositDataRoots
    ) external nonReentrant whenNotPaused {
        if (
            _pubkeys.length != _signatures.length ||
            _pubkeys.length != _depositDataRoots.length
        ) {
            revert InvalidParameter();
        }
        // must be a trusted operator
        uint256 operatorId = nodeOperatorRegistryContract
            .isTrustedOperatorOfControllerAddress(msg.sender);
        if (operatorId == 0) revert RequireOperatorTrusted();

        if (
            (operatorPoolBalances[operatorId] +
                operatorNftPoolBalances[operatorId]) /
                DEPOSIT_SIZE <
            _pubkeys.length
        ) {
            revert InsufficientFunds();
        }

        uint256 userValidatorNumber = 0;
        for (uint256 i = 0; i < _pubkeys.length; ++i) {
            uint256 count = _stakeAndMint(
                operatorId,
                _pubkeys[i],
                _signatures[i],
                _depositDataRoots[i]
            );
            userValidatorNumber += count;
        }

        uint256 stakeAmount = DEPOSIT_SIZE * _pubkeys.length;
        uint256 userStakeAmount = DEPOSIT_SIZE * userValidatorNumber;
        uint256 poolStakeAmount = stakeAmount - userStakeAmount;
        operatorPoolBalances[operatorId] -= poolStakeAmount;
        operatorPoolBalancesSum -= poolStakeAmount;

        //added operation
        operatorNftPoolBalances[operatorId] -= userStakeAmount;

        // Ensure the operatorPoolBalances does not underflow
        require(operatorPoolBalances[operatorId] >= 0, "Pool underflow");
        require(operatorPoolBalancesSum >= 0, "Pool underflow");

        withdrawOracleContract.addPendingBalances(poolStakeAmount);
    }

    function _stakeAndMint(
        uint256 _operatorId,
        bytes calldata _pubkey,
        bytes calldata _signature,
        bytes32 deposit_data_root
    ) internal returns (uint256) {
        //beacon deposit
        depositContract.deposit{value: 32 ether}(
            _pubkey,
            liquidStakingWithdrawalCredentials,
            _signature,
            deposit_data_root
        );

        uint256 tokenId = vNFTContract.whiteListMint(
            _pubkey,
            liquidStakingWithdrawalCredentials,
            address(this),
            _operatorId
        );

        emit ValidatorRegistered(_operatorId, tokenId, _pubkey);

        return 1;
    }

    function l2StakeETH(
        SendParam memory _sendParam,
        uint256 _operatorId,
        address _onBehalfOf
    ) public payable nonReentrant whenNotPaused {
        if (msg.value < 1000 gwei) revert InvalidAmount();

        // Ensure operator is trusted and has sufficient pledge
        if (!nodeOperatorRegistryContract.isTrustedOperator(_operatorId))
            revert RequireOperatorTrusted();

        // Update exchange rate before minting nETH
        _updateCumulativeExchangeRate();
        uint256 currentRate = _getCurrentExchangeRate();
        //Convert ETH to nETH
        uint256 amountOut = (msg.value * 1e18) / currentRate;

        nETHContract.whiteListMint(amountOut, address(this));
        _updateStakeFundLedger(_operatorId, amountOut);
        _stakeRecords(_operatorId, _onBehalfOf, amountOut);

        nETHContract.approve(address(xETHAdaptor), amountOut);

        MessagingFee memory fee = xETHAdaptor.quoteSend(_sendParam, false);

        xETHAdaptor.send(_sendParam, fee, _onBehalfOf);

        emit EthStake(_operatorId, _onBehalfOf, msg.value, amountOut);
    }

    /**
     * @notice Update the status of the corresponding nft according to the report result of the oracle machine
     * @param _tokenIds token id
     * @param _exitBlockNumbers exit block number
     */
    function nftExitHandle(
        uint256[] memory _tokenIds,
        uint256[] memory _exitBlockNumbers
    ) external onlyVaultManager {
        // Sanity check: Ensure the lengths of _tokenIds and _exitBlockNumbers match
        require(_tokenIds.length == _exitBlockNumbers.length);

        vNFTContract.setNftExitBlockNumbers(_tokenIds, _exitBlockNumbers);

        for (uint256 i = 0; i < _tokenIds.length; ++i) {
            uint256 tokenId = _tokenIds[i];
            if (vNFTContract.ownerOf(tokenId) == address(this)) {
                vNFTContract.whiteListBurn(tokenId);
            }
        }

        emit NftExitBlockNumberSet(_tokenIds, _exitBlockNumbers);
    }

    /**
     * @notice According to the settlement results of the vaultManager, the income of the re-investment execution layer
     * @param _operatorIds operator id
     * @param _amounts reinvest amounts
     */
    function reinvestElRewards(
        uint256[] memory _operatorIds,
        uint256[] memory _amounts
    ) external onlyVaultManager {
        if (_operatorIds.length != _amounts.length) revert InvalidParameter();
        for (uint256 i = 0; i < _operatorIds.length; ++i) {
            uint256 operatorId = _operatorIds[i];
            uint256 _amount = _amounts[i];
            if (_amount == 0) {
                continue;
            }

            address vaultContractAddress = nodeOperatorRegistryContract
                .getNodeOperatorVaultContract(operatorId);
            IELVault(vaultContractAddress).reinvestment(_amount);

            _updateStakeFundLedger(operatorId, _amount);
            emit OperatorReinvestElRewards(operatorId, _amount);
        }
    }

    /**
     * @notice According to the reported results of the oracle machine, the income of the consensus layer is re-invested
     * @param _operatorIds operator id
     * @param _amounts reinvest amounts
     * @param _totalAmount totalAmount
     */
    function reinvestClRewards(
        uint256[] memory _operatorIds,
        uint256[] memory _amounts,
        uint256 _totalAmount
    ) external onlyVaultManager {
        if (_operatorIds.length != _amounts.length) revert InvalidParameter();
        consensusVaultContract.reinvestment(_totalAmount);

        uint256 totalReinvestRewards = 0;
        for (uint256 i = 0; i < _operatorIds.length; ++i) {
            uint256 operatorId = _operatorIds[i];
            uint256 _amount = _amounts[i];
            if (_amount == 0) {
                continue;
            }
            totalReinvestRewards += _amount;

            uint256 operatorPendingRequestAmount;
            uint256 operatorPendingPool;
            (
                operatorPendingRequestAmount,
                operatorPendingPool
            ) = withdrawalRequestContract.getOperatorLargeWithdrawalPendingInfo(
                operatorId
            );
            if (operatorPendingPool < operatorPendingRequestAmount) {
                uint256 withdrawalAmounts = 0;
                if (
                    operatorPendingPool + _amount >=
                    operatorPendingRequestAmount
                ) {
                    withdrawalAmounts =
                        operatorPendingRequestAmount -
                        operatorPendingPool;
                    _amount -= withdrawalAmounts;
                } else {
                    withdrawalAmounts = _amount;
                    _amount = 0;
                }
                withdrawalRequestContract.receiveWithdrawals{
                    value: withdrawalAmounts
                }(operatorId, withdrawalAmounts);
            }
            if (_amount != 0) {
                _updateStakeFundLedger(operatorId, _amount);
                emit OperatorReinvestClRewards(operatorId, _amount);
            }
        }

        if (_totalAmount != totalReinvestRewards) revert InvalidParameter();
    }

    /**
     * @notice When withdrawing a large amount, update the user's unstake quota
     * @param _operatorId operator id
     * @param _from user address
     * @param _amount unstakeETH amount
     */
    function largeWithdrawalUnstake(
        uint256 _operatorId,
        address _from,
        uint256 _amount
    ) external onlyWithdrawalRequest {
        _unstake(_operatorId, _from, _amount);
    }

    /**
     * @notice large withdrawals, when users claim eth, will trigger the burning of locked Neth
     * @param _totalRequestNethAmount totalRequestNethAmount will burn
     * @param _to burn neth address
     */
    function largeWithdrawalRequestBurnNeth(
        uint256 _totalRequestNethAmount,
        address _to
    ) external onlyWithdrawalRequest {
        nETHContract.whiteListBurn(_totalRequestNethAmount, address(_to));
    }

    /**
     * @notice When unstakeNFT, if the funds pledged by the user have not been deposited, the user is allowed to withdraw directly
     * @param _operatorId operator id
     * @param _tokenId tokenId
     * @param _to receiving address
     */

    function fastUnstakeNFT(
        uint256 _operatorId,
        uint256 _tokenId,
        address _to
    ) external onlyWithdrawalRequest {
        operatorNftPoolBalances[_operatorId] -= DEPOSIT_SIZE;

        payable(_to).transfer(DEPOSIT_SIZE);
        emit Transferred(_to, DEPOSIT_SIZE);
        vNFTContract.whiteListBurn(_tokenId);
    }

    /**
     * @notice Obtain the available amount that the user can unstake
     * @param _from user addresss
     */
    function getUnstakeQuota(
        address _from
    ) public view returns (StakeInfo[] memory) {
        return stakeRecords[_from];
    }

    /**
     * @notice Obtain the unstake amount available for users under a certain operator
     * @param _operatorId operator Id
     */
    function getOperatorNethUnstakePoolAmounts(
        uint256 _operatorId
    ) public view returns (uint256) {
        uint256 targetOperatorId = _operatorId;
        bool isQuit = nodeOperatorRegistryContract.isQuitOperator(_operatorId);
        if (isQuit) {
            uint256 reAssignOperatorId = reAssignRecords[_operatorId];
            if (reAssignOperatorId != 0) {
                targetOperatorId = reAssignOperatorId;
            }
        }

        uint256 operatorBalances = operatorPoolBalances[targetOperatorId];

        uint256 operatorLoanAmounts = operatorLoanRecords[targetOperatorId];

        if (operatorLoanAmounts >= operatorCanLoanAmounts) {
            return operatorBalances;
        }

        uint256 totalUnstakePoolAmounts = operatorBalances +
            operatorCanLoanAmounts -
            operatorLoanAmounts;
        if (totalUnstakePoolAmounts > operatorPoolBalancesSum) {
            return operatorPoolBalancesSum;
        }

        return totalUnstakePoolAmounts;
    }

    /**
     * @notice Users claim vNFT rewards
     * @dev There is no need to judge whether this nft belongs to the liquidStaking,
     *      because the liquidStaking cannot directly reward
     * @param _operatorId operator id
     * @param _tokenIds vNFT tokenIds
     * @param _totalNftRewards _totalNftRewards
     * @param _gasHeight update claim gasHeight
     * @param _owner _owner
     */
    function claimRewardsOfUser(
        uint256 _operatorId,
        uint256[] memory _tokenIds,
        uint256 _totalNftRewards,
        uint256 _gasHeight,
        address _owner
    ) external nonReentrant whenNotPaused onlyVaultManager {
        if (_tokenIds.length == 0 || _gasHeight > block.number)
            revert InvalidParameter();

        uint256[] memory exitBlockNumbers = vNFTContract.getNftExitBlockNumbers(
            _tokenIds
        );

        for (uint256 i = 0; i < _tokenIds.length; ++i) {
            uint256 tokenId = _tokenIds[i];

            if (exitBlockNumbers[i] != 0) {
                vNFTContract.whiteListBurn(tokenId);
            } else {
                vNFTContract.setUserNftGasHeight(tokenId, _gasHeight);
            }
        }

        address vaultContractAddress = nodeOperatorRegistryContract
            .getNodeOperatorVaultContract(_operatorId);
        IELVault(vaultContractAddress).transfer(_totalNftRewards, _owner);

        emit UserClaimRewards(_operatorId, _tokenIds, _totalNftRewards);
    }

    /**
     * @notice The operator claims the operation reward
     * @param _operatorId operator Id
     * @param _rewardAddresses reward address
     * @param _rewards _rewards
     */
    function claimRewardsOfOperator(
        uint256 _operatorId,
        address[] memory _rewardAddresses,
        uint256[] memory _rewards
    ) external nonReentrant whenNotPaused onlyVaultManager {
        // Sanity check: Ensure the lengths of _rewardAddresses and _rewards match
        if (_rewardAddresses.length != _rewards.length)
            revert InvalidParameter();

        if (operatorLoanRecords[_operatorId] != 0) revert OperatorHasArrears();
        address vaultContractAddress = nodeOperatorRegistryContract
            .getNodeOperatorVaultContract(_operatorId);

        for (uint256 i = 0; i < _rewardAddresses.length; ++i) {
            IELVault(vaultContractAddress).transfer(
                _rewards[i],
                _rewardAddresses[i]
            );
        }
    }

    /**
     * @notice The dao claims to belong to the dao reward
     * @param _operatorIds operators Id
     * @param _rewards rewards
     */
    function claimRewardsOfDao(
        uint256[] memory _operatorIds,
        uint256[] memory _rewards
    ) external nonReentrant whenNotPaused onlyVaultManager {
        // Sanity check: Ensure the lengths of _operatorIds and _rewards match
        if (_operatorIds.length != _rewards.length || _rewards.length == 0)
            revert InvalidParameter();
        for (uint256 i = 0; i < _operatorIds.length; ++i) {
            uint256 _operatorId = _operatorIds[i];
            address vaultContractAddress = nodeOperatorRegistryContract
                .getNodeOperatorVaultContract(_operatorId);
            IELVault(vaultContractAddress).transfer(
                _rewards[i],
                daoVaultAddress
            );
            emit DaoClaimRewards(_operatorId, _rewards[i]);
        }
    }

    /**
     * @notice Get the total amount of ETH in the protocol
     */
    function getTotalEthValue() public view returns (uint256) {
        return
            operatorPoolBalancesSum +
            withdrawOracleContract.getPendingBalances() +
            withdrawOracleContract.getClBalances() +
            withdrawOracleContract.getClVaultBalances() -
            withdrawOracleContract.getLastClSettleAmount() -
            withdrawalRequestContract.getTotalPendingClaimedAmounts();
    }

    /**
     * @notice nETH to ETH exchange rate
     * @param _nethAmountIn nETH amount
     */
    function _getEthOut(uint256 _nethAmountIn) internal view returns (uint256) {
        uint256 totalEth = getTotalEthValue();
        uint256 nethSupply = nETHContract.totalSupply();
        if (nethSupply == 0) {
            return _nethAmountIn;
        }

        return (_nethAmountIn * (totalEth)) / (nethSupply);
    }

    /**
     * @notice current exchange rate
     */
    function getCurrentExchangeRate() external view returns (uint256) {
        return _getCurrentExchangeRate();
    }

    function _getExchangeRate() internal view returns (uint256) {
        return _getEthOut(1 ether);
    }

    // Update the cumulativeRate based on the time-weighted average
    function _updateCumulativeExchangeRate() internal {
        uint256 currentTime = block.timestamp;
        uint256 timeElapsed = currentTime - lastUpdateTime;

        // Ensure at least some time has passed
        if (timeElapsed > 0) {
            uint256 currentRate = _getExchangeRate();
            // Update cumulativeRate using time-weighted average calculation
            cumulativeExchangeRate += currentRate * timeElapsed;
            lastUpdateTime = currentTime;
        }
    }

    // function to get the current exchange rate based on the cumulative rate over time
    function _getCurrentExchangeRate() internal view returns (uint256) {
        if (block.timestamp > lastUpdateTime) {
            uint256 timeElapsed = block.timestamp - lastUpdateTime;
            uint256 additionalRate = _getExchangeRate() * timeElapsed;
            uint256 totalTimeElapsed = block.timestamp - contractStartTime; //start time recorded on contract deployment
            return (cumulativeExchangeRate + additionalRate) / totalTimeElapsed;
        } else {
            return
                cumulativeExchangeRate / (block.timestamp - contractStartTime);
        }
    }

    /**
     * @notice Set LiquidStaking contract withdrawalCredentials
     * @param _liquidStakingWithdrawalCredentials new withdrawalCredentials
     */
    function setLiquidStakingWithdrawalCredentials(
        bytes calldata _liquidStakingWithdrawalCredentials
    ) external onlyDao {
        emit LiquidStakingWithdrawalCredentialsSet(
            liquidStakingWithdrawalCredentials,
            _liquidStakingWithdrawalCredentials
        );
        liquidStakingWithdrawalCredentials = _liquidStakingWithdrawalCredentials;
    }

    /**
     * @notice set dao address
     * @param _dao new dao address
     */
    function setDaoAddress(address _dao) external onlyOwner {
        if (_dao == address(0)) revert InvalidParameter();
        emit DaoAddressChanged(dao, _dao);
        dao = _dao;
    }

    function setAdaptorAddress(address _adaptor) external onlyOwner {
        if (_adaptor == address(0)) revert InvalidParameter();
        xETHAdaptor = IOFT(_adaptor);
        emit AdaptorAddressSet(_adaptor);
    }

    /**
     * @notice change liquidStaking contract setting
     * @param _daoVaultAddress new dao vault treasury address
     * @param _nodeOperatorRegistryContract new nodeOperatorRegistryContract
     * @param _withdrawOracleContractAddress new withdrawOracleContract address
     * @param _withdrawalRequestContractAddress new withdrawalRequestContract address
     * @param _vaultManagerContract new vaultManagerContract address
     * @param _depositContractAddress eth2 deposit address
     */
    function changeCountractSetting(
        address _daoVaultAddress,
        address _nodeOperatorRegistryContract,
        address _withdrawOracleContractAddress,
        address _withdrawalRequestContractAddress,
        address _vaultManagerContract,
        address _consensusVaultContractAddress,
        address _depositContractAddress
    ) external onlyOwner {
        if (_daoVaultAddress != address(0)) {
            emit DaoVaultAddressChanged(daoVaultAddress, _daoVaultAddress);
            daoVaultAddress = _daoVaultAddress;
        }
        if (_nodeOperatorRegistryContract != address(0)) {
            emit NodeOperatorRegistryContractSet(
                address(nodeOperatorRegistryContract),
                _nodeOperatorRegistryContract
            );
            nodeOperatorRegistryContract = INodeOperatorsRegistry(
                _nodeOperatorRegistryContract
            );
        }
        if (_withdrawOracleContractAddress != address(0)) {
            emit WithdrawOracleContractSet(
                address(withdrawOracleContract),
                _withdrawOracleContractAddress
            );
            withdrawOracleContract = IWithdrawOracle(
                _withdrawOracleContractAddress
            );
        }
        if (_withdrawalRequestContractAddress != address(0)) {
            emit WithdrawalRequestContractSet(
                address(withdrawalRequestContract),
                _withdrawalRequestContractAddress
            );
            withdrawalRequestContract = IWithdrawalRequest(
                _withdrawalRequestContractAddress
            );
        }
        if (_vaultManagerContract != address(0)) {
            emit VaultManagerContractSet(
                vaultManagerContractAddress,
                _vaultManagerContract
            );
            vaultManagerContractAddress = _vaultManagerContract;
        }

        if (_consensusVaultContractAddress != address(0)) {
            emit ConsensusVaultContractSet(
                address(consensusVaultContract),
                _consensusVaultContractAddress
            );
            consensusVaultContract = IConsensusVault(
                _consensusVaultContractAddress
            );
        }

        if (_depositContractAddress != address(0)) {
            emit DepositContractSet(
                address(depositContract),
                _depositContractAddress
            );

            depositContract = IDepositContract(_depositContractAddress);
        }
    }

    /**
     * @notice Set staking fee rate
     * @param _feeRate new stake fee rate 1% - 5%
     */
    function setDepositFeeRate(uint256 _feeRate) external onlyDao {
        if (_feeRate > 1000) revert InvalidParameter();
        emit DepositFeeRateSet(depositFeeRate, _feeRate);
        depositFeeRate = _feeRate;
    }

    /**
     * @notice Set new operatorCanLoanAmounts
     * @param _newCanLoanAmounts new _newCanloadAmounts
     */
    function setOperatorCanLoanAmounts(
        uint256 _newCanLoanAmounts
    ) public onlyDao {
        if (_newCanLoanAmounts > 1000 ether) revert InvalidParameter();
        emit OperatorCanLoanAmountsSet(
            operatorCanLoanAmounts,
            _newCanLoanAmounts
        );
        operatorCanLoanAmounts = _newCanLoanAmounts;
    }

    /**
     * @notice vNFT receiving function
     */

    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external override returns (bytes4) {
        // Storing the received token's details
        receivedTokens[tokenId] = nftToken(operator, from, tokenId, data);
        return
            bytes4(
                keccak256("onERC721Received(address,address,uint256,bytes)")
            );
    }

    /**
     * @notice Receive Rewards
     * @param _rewards rewards amount
     */
    function receiveRewards(uint256 _rewards) external payable {
        emit RewardsReceive(_rewards);
    }

    /**
     * @notice The protocol has been Paused
     */
    function isPaused() public view returns (bool) {
        return paused();
    }

    /**
     * @notice In the event of an emergency, stop protocol
     */
    function pauseProtocol() external onlyDao {
        _pause();
    }

    /**
     * @notice restart protocol
     */
    function unpauseProtocol() external onlyDao {
        _unpause();
    }

    function getOperatorNftPoolBalances(
        uint256 _operatorId
    ) external view returns (uint256) {
        return operatorNftPoolBalances[_operatorId];
    }
}

File 2 of 30 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.18;

import { ContextUpgradeable } from "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    function __Ownable_init(address initialOwner) internal onlyInitializing {
        __Ownable_init_unchained(initialOwner);
    }

    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

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

File 3 of 30 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.18;

/**
 * @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 Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1))
    bytes32 private constant _INITIALIZABLE_STORAGE =
        0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;

    /**
     * @dev The contract is already initialized.
     */
    error AlreadyInitialized();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 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() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        bool isTopLevelCall = !$._initializing;
        if (!(isTopLevelCall && $._initialized < 1) && !(address(this).code.length == 0 && $._initialized == 1)) {
            revert AlreadyInitialized();
        }
        $._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(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert AlreadyInitialized();
        }
        $._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() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @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 {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert AlreadyInitialized();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := _INITIALIZABLE_STORAGE
        }
    }
}

File 4 of 30 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.18;

import { IERC1822ProxiableUpgradeable } from "../../interfaces/draft-IERC1822Upgradeable.sol";
import { ERC1967UtilsUpgradeable } from "../ERC1967/ERC1967UtilsUpgradeable.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.
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable __self = address(this);

    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev The call is from an unauthorized context.
     */
    error UUPSUnauthorizedCallContext();

    /**
     * @dev The storage `slot` is unsupported as a UUID.
     */
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    /**
     * @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() {
        _checkProxy();
        _;
    }

    /**
     * @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() {
        _checkNotDelegated();
        _;
    }

    /**
     * @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 notDelegated returns (bytes32) {
        return ERC1967UtilsUpgradeable.IMPLEMENTATION_SLOT;
    }

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

    /**
     * @dev Reverts if the execution is not performed via delegatecall or the execution
     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967UtilsUpgradeable.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Reverts if the execution is performed via delegatecall.
     * See {notDelegated}.
     */
    function _checkNotDelegated() internal view virtual {
        if (address(this) != __self) {
            // Must not be called through delegatecall
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in ERC1967.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
        try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
            if (slot != ERC1967UtilsUpgradeable.IMPLEMENTATION_SLOT) {
                revert UUPSUnsupportedProxiableUUID(slot);
            }
            ERC1967UtilsUpgradeable.upgradeToAndCall(newImplementation, data);
        } catch {
            // The implementation is not UUPS
            revert ERC1967UtilsUpgradeable.ERC1967InvalidImplementation(newImplementation);
        }
    }

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

File 5 of 30 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.18;
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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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
        if (_status == _ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

File 6 of 30 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.18;

import { ContextUpgradeable } from "../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 {
    bool private _paused;

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

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

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

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

    /**
     * @dev Initializes the contract in unpaused state.
     */
    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 {
        if (paused()) {
            revert EnforcedPause();
        }
    }

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

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

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

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

File 7 of 30 : INodeOperatorsRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

/**
 * @title Node Operator registry
 *
 * Registration and management of Node Operator
 */
interface INodeOperatorsRegistry {
    /**
     * @notice Add node operator named `name` with reward address `rewardAddress` and _owner
     * @param _name Human-readable name
     * @param _controllerAddress Ethereum 1 address for the operator's management authority
     * @param _owner operator owner address
     * @param _rewardAddresses reward addresses
     * @param _ratios reward ratios
     * @return id a unique key of the added operator
     */
    function registerOperator(
        string calldata _name,
        address _controllerAddress,
        address _owner,
        address[] calldata _rewardAddresses,
        uint256[] calldata _ratios
    ) external returns (uint256 id);

    /**
     * @notice Set an operator as trusted
     * @param _id operator id
     */
    function setTrustedOperator(uint256 _id) external;

    /**
     * @notice Remove an operator as trusted
     * @param _id operator id
     */
    function removeTrustedOperator(uint256 _id) external;

    /**
     * @notice Set the name of the operator
     * @param _id operator id
     * @param _name operator new name
     */
    function setNodeOperatorName(uint256 _id, string memory _name) external;

    /**
     * @notice Set the rewardAddress of the operator
     * @param _id operator id
     * @param _rewardAddresses Ethereum 1 address which receives ETH rewards for this operator
     * @param _ratios reward ratios
     */
    function setNodeOperatorRewardAddress(uint256 _id, address[] memory _rewardAddresses, uint256[] memory _ratios)
        external;

    /**
     * @notice Set the controllerAddress of the operator
     * @param _id operator id
     * @param _controllerAddress Ethereum 1 address for the operator's management authority
     */
    function setNodeOperatorControllerAddress(uint256 _id, address _controllerAddress) external;

    /**
     * @notice Get information about an operator
     * @param _id operator id
     * @param _fullInfo Get all information
     */
    function getNodeOperator(uint256 _id, bool _fullInfo)
        external
        view
        returns (
            bool trusted,
            string memory name,
            address owner,
            address controllerAddress,
            address vaultContractAddress,
            uint256 registrationBlockNumber 

        );

    /**
     * @notice Get information about an operator vault contract address
     * @param _id operator id
     */
    function getNodeOperatorVaultContract(uint256 _id) external view returns (address vaultContractAddress);

    /**
     * @notice Get operator rewardSetting
     * @param operatorId operator id
     */
    function getNodeOperatorRewardSetting(uint256 operatorId)
        external
        view
        returns (address[] memory, uint256[] memory);

    /**
     * @notice Returns total number of node operators
     */
    function getNodeOperatorsCount() external view returns (uint256);

    /**
     * @notice Returns total number of trusted operators
     */
    function getTrustedOperatorsCount() external view returns (uint256);

    /**
     * @notice Returns whether an operator is trusted
     * @param _id operator id
     */
    function isTrustedOperator(uint256 _id) external view returns (bool);

    /**
     * @notice Returns whether an operator is trusted
     * @param _controllerAddress controller address
     */
    function isTrustedOperatorOfControllerAddress(address _controllerAddress) external view returns (uint256);

    /**
     * @notice get operator comission rate
     * @param _operatorIds operator id
     */
    function getOperatorCommissionRate(uint256[] memory _operatorIds) external view returns (uint256[] memory);
    /**
     * @notice Get operator owner address
     * @param _id operator id
     */
    function getNodeOperatorOwner(uint256 _id) external view returns (address);

    /**
     * @notice Returns whether an operator is Blacklist
     * @param _operatorId operator id
     */
    function isBlacklistOperator(uint256 _operatorId) external view returns (bool);

    /**
     * @notice Returns whether an operator is quit
     * @param _id operator id
     */
    function isQuitOperator(uint256 _id) external view returns (bool);

    event NodeOperatorRegistered(
        uint256 _id,
        string _name,
        address _controllerAddress,
        address _vaultContractAddress,
        address[] _rewardAddresses,
        uint256[] _ratios
    );
    event OperatorQuit(uint256 _operatorId, address operatorOwner);
    event NodeOperatorTrustedSet(uint256 _id, string _name, bool _trusted);
    event NodeOperatorTrustedRemove(uint256 _id, string _name, bool _trusted);
    event NodeOperatorBlacklistSet(uint256 _id);
    event NodeOperatorBlacklistRemove(uint256 _id);
    event NodeOperatorNameSet(uint256 _id, string _name);
    event NodeOperatorRewardAddressSet(uint256 _id, address[] _rewardAddresses, uint256[] _ratios);
    event NodeOperatorControllerAddressSet(uint256 _id, string _name, address _controllerAddress);
    event NodeOperatorOwnerAddressSet(uint256 _id, string _name, address _ownerAddress);
    event Transferred(address _to, uint256 _amount);
    event Withdraw(uint256 _amount, uint256 _operatorId, address _to);
    event LiquidStakingChanged(address _from, address _to);
    event DaoAddressChanged(address _oldDao, address _dao);
    event DaoVaultAddressChanged(address _oldDaoVaultAddress, address _daoVaultAddress);
    event PermissionlessBlockNumberSet(uint256 _blockNumber);
    event OperatorClaimRewards(uint256 _operatorId, uint256 _rewards);
    event DaoClaimRewards(uint256 _operatorId, uint256 _rewards);
    event CommissionRateChanged(uint256 _oldRate, uint256 _rate);
    event OperatorArrearsReduce(uint256 _operatorId, uint256 value);
    event OperatorArrearsIncrease(uint256 _operatorId, uint256 value);
    event VaultFactorContractSet(address _vaultFactoryContract, address _vaultFactoryContractAddress);
    event OperatorVaultContractReset(address _oldVaultContractAddress, address _vaultContractAddress);
    event DefaultOperatorCommissionRateChanged(
        uint256 _oldDefaultOperatorCommission, uint256 _defaultOperatorCommission
    );
}

File 8 of 30 : ILiquidStaking.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

import {SendParam} from "./IOFT.sol";

/**
 * @title Interface fro MTZ LiquidStaking Contract
 *
 * Multichainz provides decentralized solutions for Ethereum liquidity,
 *
 * The Multichainz protocol is a smart contract for next-generation liquid staking derivatives,
 * which includes all the concepts of traditional liquid staking, re-staking, distributed validators, and validator NFTs in a single protocol.
 *
 * Our vision is to use our innovative liquidity solution to provide more options for the Ethereum liquidity market,
 * thereby making Ethereum staking more decentralized.
 */

interface ILiquidStaking {
    function l2StakeETH(
        SendParam memory _sendParam,
        uint256 _operatorId,
        address _onBehalfOf
    ) external payable;

    //function l2UnstakeETH(
    //    uint256 operatorId,
    //    uint256 amount,
    //    address onBehalfOf,
    //    address receiver
    //    ) external;
    /**
     * @notice Receive Rewards
     * @param _rewards rewards amount
     */
    function receiveRewards(uint256 _rewards) external payable;

    /**
     * @notice Update the status of the corresponding nft according to the report result of the oracle machine
     * @param _tokenIds token id
     * @param _exitBlockNumbers exit block number
     */
    function nftExitHandle(
        uint256[] memory _tokenIds,
        uint256[] memory _exitBlockNumbers
    ) external;

    /**
     * @notice According to the settlement results of the vaultManager, the income of the re-investment execution layer
     * @param _operatorIds operator id
     * @param _amounts reinvest amounts
     */
    function reinvestElRewards(
        uint256[] memory _operatorIds,
        uint256[] memory _amounts
    ) external;

    /**
     * @notice According to the reported results of the oracle machine, the income of the consensus layer is re-invested
     * @param _operatorIds operator id
     * @param _amounts reinvest amounts
     * @param _totalAmount totalAmount
     */
    function reinvestClRewards(
        uint256[] memory _operatorIds,
        uint256[] memory _amounts,
        uint256 _totalAmount
    ) external;

    /**
     * @notice current exchange rate
     */
    function getCurrentExchangeRate() external view returns (uint256);

    function getOperatorNftPoolBalances(
        uint256 _operatorId
    ) external view returns (uint256);

    /**
     * @notice When withdrawing a large amount, update the user's unstake quota
     * @param _operatorId operator id
     * @param _from user address
     * @param _amount unstakeETH amount
     */

    function largeWithdrawalUnstake(
        uint256 _operatorId,
        address _from,
        uint256 _amount
    ) external;

    /**
     * @notice large withdrawals, when users claim eth, will trigger the burning of locked Neth
     * @param _totalRequestNethAmount totalRequestNethAmount will burn
     * @param _to burn neth address
     */
    function largeWithdrawalRequestBurnNeth(
        uint256 _totalRequestNethAmount,
        address _to
    ) external;

    /**
     * @notice When unstakeNFT, if the funds pledged by the user have not been deposited, the user is allowed to withdraw directly
     * @param _operatorId operator id
     * @param _tokenId tokenId
     * @param _to receiving address
     */
    function fastUnstakeNFT(
        uint256 _operatorId,
        uint256 _tokenId,
        address _to
    ) external;

    function registerValidator(
        bytes[] calldata _pubkeys,
        bytes[] calldata _signatures,
        bytes32[] calldata _depositDataRoots
    ) external;

    /**
     * @notice Users claim vNFT rewards
     * @dev There is no need to judge whether this nft belongs to the liquidStaking,
     *      because the liquidStaking cannot directly reward
     * @param _operatorId operator id
     * @param _tokenIds vNFT tokenIds
     * @param _totalNftRewards _totalNftRewards
     * @param _gasHeight update claim gasHeigt
     * @param _owner _owner
     */
    function claimRewardsOfUser(
        uint256 _operatorId,
        uint256[] memory _tokenIds,
        uint256 _totalNftRewards,
        uint256 _gasHeight,
        address _owner
    ) external;

    /**
     * @notice The operator claims the operation reward
     * @param _operatorId operator Id
     * @param _rewardAddresses reward address
     * @param _rewards _rewards
     */
    function claimRewardsOfOperator(
        uint256 _operatorId,
        address[] memory _rewardAddresses,
        uint256[] memory _rewards
    ) external;

    /**
     * @notice The dao claims to belong to the dao reward
     * @param _operatorIds operators Id
     * @param _rewards rewards
     */
    function claimRewardsOfDao(
        uint256[] memory _operatorIds,
        uint256[] memory _rewards
    ) external;

    event OperatorAssigned(
        uint256 indexed _blacklistOperatorId,
        uint256 _operatorId,
        uint256 _totalAmount
    );
    event EthStake(
        uint256 indexed _operatorId,
        address indexed _from,
        uint256 _amount,
        uint256 _amountOut
    );
    event EthUnstake(
        uint256 indexed _operatorId,
        uint256 targetOperatorId,
        address sender,
        uint256 _amounts,
        uint256 amountOut
    );
    event NftStake(
        uint256 indexed _operatorId,
        address indexed _from,
        uint256 _count
    );
    event ValidatorRegistered(
        uint256 indexed _operatorId,
        uint256 _tokenId,
        bytes _pubkey
    );
    event UserClaimRewards(
        uint256 _operatorId,
        uint256[] _tokenIds,
        uint256 _rewards
    );
    event Transferred(address _to, uint256 _amount);
    event AdaptorAddressSet(address _adaptor);
    event OperatorReinvestClRewards(uint256 _operatorId, uint256 _rewards);
    event OperatorReinvestElRewards(uint256 _operatorId, uint256 _rewards);
    event RewardsReceive(uint256 _rewards);
    event LiquidStakingWithdrawalCredentialsSet(
        bytes _oldLiquidStakingWithdrawalCredentials,
        bytes _liquidStakingWithdrawalCredentials
    );
    event WithdrawOracleContractSet(
        address _oldWithdrawOracleContractSet,
        address _withdrawOracleContractSetAddress
    );
    event NodeOperatorRegistryContractSet(
        address _oldNodeOperatorRegistryContract,
        address _nodeOperatorRegistryContract
    );
    event DaoAddressChanged(address _oldDao, address _dao);
    event DaoVaultAddressChanged(
        address _oldDaoVaultAddress,
        address _daoVaultAddress
    );
    event DepositFeeRateSet(uint256 _oldFeeRate, uint256 _feeRate);
    event OperatorClaimRewards(uint256 _operatorId, uint256 _rewards);
    event DaoClaimRewards(uint256 _operatorId, uint256 _rewards);
    event NftExitBlockNumberSet(uint256[] tokenIds, uint256[] exitBlockNumbers);
    event VaultManagerContractSet(
        address vaultManagerContractAddress,
        address _vaultManagerContract
    );
    event ConsensusVaultContractSet(
        address consensusVaultContractAddress,
        address _consensusVaultContract
    );
    event OperatorCanLoanAmountsSet(
        uint256 operatorCanLoanAmounts,
        uint256 _newCanloadAmounts
    );
    event WithdrawalRequestContractSet(
        address _withdrawalRequestContract,
        address _withdrawalRequestContractAddress
    );
    event OperatorSlashContractSet(
        address oldOperatorSlashContract,
        address _operatorSlashContract
    );
    event DepositContractSet(address depositContract, address _depositContract);

    event DepositContractUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );
}

File 9 of 30 : INETH.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.18;

import "@openzeppelin-contracts/token/ERC20/IERC20.sol";

/**
 * @title Interface for NETH
 */
interface INETH is IERC20 {
    /**
     * @notice mint nETHH
     * @param _amount mint amount
     * @param _account mint account
     */
    function whiteListMint(uint256 _amount, address _account) external;

    /**
     * @notice burn nETHH
     * @param _amount burn amount
     * @param _account burn account
     */
    function whiteListBurn(uint256 _amount, address _account) external;

    event LiquidStakingContractSet(address dao, address _liquidStakingContractAddress);
}

File 10 of 30 : IVNFT.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

import "../../lib/ERC721A-Upgradeable/contracts/IERC721AUpgradeable.sol";

interface IVNFT is IERC721AUpgradeable {
    function activeNfts() external view returns (uint256[] memory);

    /**
     * @notice Returns the validators that are active (may contain validator that are yet active on beacon chain)
     */
    function activeValidatorsOfStakingPool() external view returns (bytes[] memory);

    /**
     * @notice Returns the tokenId that are active (may contain validator that are yet active on beacon chain)
     */
    function activeNftsOfStakingPool() external view returns (uint256[] memory);

    /**
     * @notice get empty nft counts
     */
    function getEmptyNftCounts() external view returns (uint256);

    /**
     * @notice Checks if a validator exists
     * @param _pubkey - A 48 bytes representing the validator's public key
     */
    function validatorExists(bytes calldata _pubkey) external view returns (bool);

    /**
     * @notice Finds the validator's public key of a nft
     * @param _tokenId - tokenId of the validator nft
     */
    function validatorOf(uint256 _tokenId) external view returns (bytes memory);

    /**
     * @notice Finds all the validator's public key of a particular address
     * @param _owner - The particular address
     */
    function validatorsOfOwner(address _owner) external view returns (bytes[] memory);

    /**
     * @notice Finds the operator id of a nft
     * @param _tokenId - tokenId of the validator nft
     */
    function operatorOf(uint256 _tokenId) external view returns (uint256);

    /**
     * @notice Get the number of operator's active nft
     * @param _operatorId - operator id
     */
    function getActiveNftCountsOfOperator(uint256 _operatorId) external view returns (uint256);

    /**
     * @notice Get the number of operator's empty nft
     * @param _operatorId - operator id
     */
    function getEmptyNftCountsOfOperator(uint256 _operatorId) external view returns (uint256);

    /**
     * @notice Get the number of user's active nft
     * @param _operatorId - operator id
     */
    function getUserActiveNftCountsOfOperator(uint256 _operatorId) external view returns (uint256);

    /**
     * @notice Finds the tokenId of a validator
     * @dev Returns MAX_SUPPLY if not found
     * @param _pubkey - A 48 bytes representing the validator's public key
     */
    function tokenOfValidator(bytes calldata _pubkey) external view returns (uint256);

    /**
     * @notice Returns the last owner before the nft is burned
     * @param _tokenId - tokenId of the validator nft
     */
    function lastOwnerOf(uint256 _tokenId) external view returns (address);

    /**
     * @notice Mints a Validator nft (vNFT)
     * @param _pubkey -  A 48 bytes representing the validator's public key
     * @param _to - The recipient of the nft
     * @param _operatorId - The operator repsonsible for operating the physical node
     */
    function whiteListMint(
        bytes calldata _pubkey,
        bytes calldata _withdrawalCredentials,
        address _to,
        uint256 _operatorId
    ) external returns (uint256);

    /**
     * @notice Burns a Validator nft (vNFT)
     * @param _tokenId - tokenId of the validator nft
     */
    function whiteListBurn(uint256 _tokenId) external;

    /**
     * @notice Obtain the withdrawal voucher used by tokenid,
     * if it is bytes(""), it means it is not the user's nft, and the voucher will be the withdrawal contract address of the nodedao protocol
     * @param _tokenId - tokenId
     */
    function getUserNftWithdrawalCredentialOfTokenId(uint256 _tokenId) external view returns (bytes memory);

    /**
     * @notice The operator obtains the withdrawal voucher to be used for the next registration of the validator.
     *  // If it is bytes (""), it means that it is not the user's NFT, and the voucher will be the withdrawal contract address of the nodedao protocol.
     * @param _operatorId - operatorId
     */
    function getNextValidatorWithdrawalCredential(uint256 _operatorId) external view returns (bytes memory);

    /**
     * @notice set nft exit height
     * @param _tokenIds - tokenIds
     * @param _exitBlockNumbers - tokenIds
     */
    function setNftExitBlockNumbers(uint256[] memory _tokenIds, uint256[] memory _exitBlockNumbers) external;

    /**
     * @notice Get the number of nft exit height
     * @param _tokenIds - tokenIds
     */
    function getNftExitBlockNumbers(uint256[] memory _tokenIds) external view returns (uint256[] memory);

    /**
     * @notice set nft gas height
     * @param _tokenId - tokenId
     * @param _number - gas height
     */
    function setUserNftGasHeight(uint256 _tokenId, uint256 _number) external;

    /**
     * @notice Get the number of user's nft gas height
     * @param _tokenIds - tokenIds
     */
    function getUserNftGasHeight(uint256[] memory _tokenIds) external view returns (uint256[] memory);

    /**
     * @notice Get the number of total active nft counts
     */
    function getTotalActiveNftCounts() external view returns (uint256);
}

File 11 of 30 : DepositContract.sol
/**
 *Submitted for verification at Etherscan.io on 2020-10-14
*/

// ┏━━━┓━┏┓━┏┓━━┏━━━┓━━┏━━━┓━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━┏┓━━━━━┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━━┏┓━
// ┃┏━━┛┏┛┗┓┃┃━━┃┏━┓┃━━┃┏━┓┃━━━━┗┓┏┓┃━━━━━━━━━━━━━━━━━━┏┛┗┓━━━━┃┏━┓┃━━━━━━━━┏┛┗┓━━━━━━━━━━━━┏┛┗┓
// ┃┗━━┓┗┓┏┛┃┗━┓┗┛┏┛┃━━┃┃━┃┃━━━━━┃┃┃┃┏━━┓┏━━┓┏━━┓┏━━┓┏┓┗┓┏┛━━━━┃┃━┗┛┏━━┓┏━┓━┗┓┏┛┏━┓┏━━┓━┏━━┓┗┓┏┛
// ┃┏━━┛━┃┃━┃┏┓┃┏━┛┏┛━━┃┃━┃┃━━━━━┃┃┃┃┃┏┓┃┃┏┓┃┃┏┓┃┃━━┫┣┫━┃┃━━━━━┃┃━┏┓┃┏┓┃┃┏┓┓━┃┃━┃┏┛┗━┓┃━┃┏━┛━┃┃━
// ┃┗━━┓━┃┗┓┃┃┃┃┃┃┗━┓┏┓┃┗━┛┃━━━━┏┛┗┛┃┃┃━┫┃┗┛┃┃┗┛┃┣━━┃┃┃━┃┗┓━━━━┃┗━┛┃┃┗┛┃┃┃┃┃━┃┗┓┃┃━┃┗┛┗┓┃┗━┓━┃┗┓
// ┗━━━┛━┗━┛┗┛┗┛┗━━━┛┗┛┗━━━┛━━━━┗━━━┛┗━━┛┃┏━┛┗━━┛┗━━┛┗┛━┗━┛━━━━┗━━━┛┗━━┛┗┛┗┛━┗━┛┗┛━┗━━━┛┗━━┛━┗━┛
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

// SPDX-License-Identifier: CC0-1.0

pragma solidity ^0.8.18;

// This interface is designed to be compatible with the Vyper version.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
interface IDepositContract {
    /// @notice A processed deposit event.
    event DepositEvent(
        bytes pubkey,
        bytes withdrawal_credentials,
        bytes amount,
        bytes signature,
        bytes index
    );

    /// @notice Submit a Phase 0 DepositData object.
    /// @param pubkey A BLS12-381 public key.
    /// @param withdrawal_credentials Commitment to a public key for withdrawals.
    /// @param signature A BLS12-381 signature.
    /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.
    /// Used as a protection against malformed input.
    function deposit(
        bytes calldata pubkey,
        bytes calldata withdrawal_credentials,
        bytes calldata signature,
        bytes32 deposit_data_root
    ) external payable;

    /// @notice Query the current deposit root hash.
    /// @return The deposit root hash.
    function get_deposit_root() external view returns (bytes32);

    /// @notice Query the current deposit count.
    /// @return The deposit count encoded as a little endian 64-bit number.
    function get_deposit_count() external view returns (bytes memory);
}

// Based on official specification in https://eips.ethereum.org/EIPS/eip-165
interface ERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceId The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceId` and
    ///  `interfaceId` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceId) external pure returns (bool);
}

// This is a rewrite of the Vyper Eth2.0 deposit contract in Solidity.
// It tries to stay as close as possible to the original source code.
/// @notice This is the Ethereum 2.0 deposit contract interface.
/// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
contract DepositContract is IDepositContract, ERC165 {
    uint constant DEPOSIT_CONTRACT_TREE_DEPTH = 32;
    // NOTE: this also ensures `deposit_count` will fit into 64-bits
    uint constant MAX_DEPOSIT_COUNT = 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1;

    bytes32[DEPOSIT_CONTRACT_TREE_DEPTH] branch;
    uint256 deposit_count;

    bytes32[DEPOSIT_CONTRACT_TREE_DEPTH] zero_hashes;

    constructor() {
        // Compute hashes in empty sparse Merkle tree
        for (uint height = 0; height < DEPOSIT_CONTRACT_TREE_DEPTH - 1; height++)
            zero_hashes[height + 1] = sha256(abi.encodePacked(zero_hashes[height], zero_hashes[height]));
    }

    function get_deposit_root() override external view returns (bytes32) {
        bytes32 node;
        uint size = deposit_count;
        for (uint height = 0; height < DEPOSIT_CONTRACT_TREE_DEPTH; height++) {
            if ((size & 1) == 1)
                node = sha256(abi.encodePacked(branch[height], node));
            else
                node = sha256(abi.encodePacked(node, zero_hashes[height]));
            size /= 2;
        }
        return sha256(abi.encodePacked(
            node,
            to_little_endian_64(uint64(deposit_count)),
            bytes24(0)
        ));
    }

    function get_deposit_count() override external view returns (bytes memory) {
        return to_little_endian_64(uint64(deposit_count));
    }

    function deposit(
        bytes calldata pubkey,
        bytes calldata withdrawal_credentials,
        bytes calldata signature,
        bytes32 deposit_data_root
    ) override external payable {
        // Extended ABI length checks since dynamic types are used.
        require(pubkey.length == 48, "DepositContract: invalid pubkey length");
        require(withdrawal_credentials.length == 32, "DepositContract: invalid withdrawal_credentials length");
        require(signature.length == 96, "DepositContract: invalid signature length");

        // Check deposit amount
        require(msg.value >= 1 ether, "DepositContract: deposit value too low");
        require(msg.value % 1 gwei == 0, "DepositContract: deposit value not multiple of gwei");
        uint deposit_amount = msg.value / 1 gwei;
        require(deposit_amount <= type(uint64).max, "DepositContract: deposit value too high");

        // Emit `DepositEvent` log
        bytes memory amount = to_little_endian_64(uint64(deposit_amount));
        emit DepositEvent(
            pubkey,
            withdrawal_credentials,
            amount,
            signature,
            to_little_endian_64(uint64(deposit_count))
        );

        // Compute deposit data root (`DepositData` hash tree root)
        bytes32 pubkey_root = sha256(abi.encodePacked(pubkey, bytes16(0)));
        bytes32 signature_root = sha256(abi.encodePacked(
            sha256(abi.encodePacked(signature[:64])),
            sha256(abi.encodePacked(signature[64:], bytes32(0)))
        ));
        bytes32 node = sha256(abi.encodePacked(
            sha256(abi.encodePacked(pubkey_root, withdrawal_credentials)),
            sha256(abi.encodePacked(amount, bytes24(0), signature_root))
        ));

        // Verify computed and expected deposit data roots match
        require(node == deposit_data_root, "DepositContract: reconstructed DepositData does not match supplied deposit_data_root");

        // Avoid overflowing the Merkle tree (and prevent edge case in computing `branch`)
        require(deposit_count < MAX_DEPOSIT_COUNT, "DepositContract: merkle tree full");

        // Add deposit data root to Merkle tree (update a single `branch` node)
        deposit_count += 1;
        uint size = deposit_count;
        for (uint height = 0; height < DEPOSIT_CONTRACT_TREE_DEPTH; height++) {
            if ((size & 1) == 1) {
                branch[height] = node;
                return;
            }
            node = sha256(abi.encodePacked(branch[height], node));
            size /= 2;
        }
        // As the loop should always end prematurely with the `return` statement,
        // this code should be unreachable. We assert `false` just to be safe.
        assert(false);
    }

    function supportsInterface(bytes4 interfaceId) override external pure returns (bool) {
        return interfaceId == type(ERC165).interfaceId || interfaceId == type(IDepositContract).interfaceId;
    }

    function to_little_endian_64(uint64 value) internal pure returns (bytes memory ret) {
        ret = new bytes(8);
        bytes8 bytesValue = bytes8(value);
        // Byteswapping during copying to bytes.
        ret[0] = bytesValue[7];
        ret[1] = bytesValue[6];
        ret[2] = bytesValue[5];
        ret[3] = bytesValue[4];
        ret[4] = bytesValue[3];
        ret[5] = bytesValue[2];
        ret[6] = bytesValue[1];
        ret[7] = bytesValue[0];
    }
}

File 12 of 30 : IWithdrawOracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

interface IWithdrawOracle {
    /**
     * @return {uint256} The total balance of the consensus layer
     */
    function getClBalances() external view returns (uint256);

    /**
     * @return {uint256} Consensus Vault contract balance
     */
    function getClVaultBalances() external view returns (uint256);

    /**
     * @return {uint256} Consensus reward settle amounte
     */
    function getLastClSettleAmount() external view returns (uint256);

    /**
     * @return {uint256} The total balance of the pending validators
     */
    function getPendingBalances() external view returns (uint256);

    /**
     * @notice add pending validator value
     */
    function addPendingBalances(uint256 _pendingBalance) external;
}

File 13 of 30 : IELVault.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

/**
 * @title Interface for IELVault
 * @notice Vault will manage methods for rewards, commissions, tax
 */
interface IELVault {
    /**
     * @notice transfer ETH
     * @param _amount transfer amount
     * @param _to transfer to address
     */
    function transfer(uint256 _amount, address _to) external;

    /**
     * @notice transfer ETH
     * @param _amount transfer amount
     */
    function reinvestment(uint256 _amount) external;
}

File 14 of 30 : ERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AUpgradeable.sol';
import {ERC721AStorage} from './ERC721AStorage.sol';
import './ERC721A__Initializable.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721ReceiverUpgradeable {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable {
    using ERC721AStorage for ERC721AStorage.Layout;

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        __ERC721A_init_unchained(name_, symbol_);
    }

    function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        ERC721AStorage.layout()._name = name_;
        ERC721AStorage.layout()._symbol = symbol_;
        ERC721AStorage.layout()._currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return ERC721AStorage.layout()._currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return ERC721AStorage.layout()._currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return ERC721AStorage.layout()._burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);
        return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return
            (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return
            (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = ERC721AStorage.layout()._packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        ERC721AStorage.layout()._packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return ERC721AStorage.layout()._name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return ERC721AStorage.layout()._symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]);
    }

    /**
     * @dev Returns whether the ownership slot at `index` is initialized.
     * An uninitialized slot does not necessarily mean that the slot has no owner.
     */
    function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
        return ERC721AStorage.layout()._packedOwnerships[index] != 0;
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (ERC721AStorage.layout()._packedOwnerships[index] == 0) {
            ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = ERC721AStorage.layout()._packedOwnerships[tokenId];
            // If the data at the starting slot does not exist, start the scan.
            if (packed == 0) {
                if (tokenId >= ERC721AStorage.layout()._currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
                // Invariant:
                // There will always be an initialized ownership slot
                // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                // before an unintialized ownership slot
                // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                // Hence, `tokenId` will not underflow.
                //
                // We can directly compare the packed value.
                // If the address is zero, packed will be zero.
                for (;;) {
                    unchecked {
                        packed = ERC721AStorage.layout()._packedOwnerships[--tokenId];
                    }
                    if (packed == 0) continue;
                    if (packed & _BITMASK_BURNED == 0) return packed;
                    // Otherwise, the token is burned, and we must revert.
                    // This handles the case of batch burned tokens, where only the burned bit
                    // of the starting slot is set, and remaining slots are left uninitialized.
                    _revert(OwnerQueryForNonexistentToken.selector);
                }
            }
            // Otherwise, the data exists and we can skip the scan.
            // This is possible because we have already achieved the target condition.
            // This saves 2143 gas on transfers of initialized tokens.
            // If the token is not burned, return `packed`. Otherwise, revert.
            if (packed & _BITMASK_BURNED == 0) return packed;
        }
        _revert(OwnerQueryForNonexistentToken.selector);
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     */
    function approve(address to, uint256 tokenId) public payable virtual override {
        _approve(to, tokenId, true);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);

        return ERC721AStorage.layout()._tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return ERC721AStorage.layout()._operatorApprovals[owner][operator];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool result) {
        if (_startTokenId() <= tokenId) {
            if (tokenId < ERC721AStorage.layout()._currentIndex) {
                uint256 packed;
                while ((packed = ERC721AStorage.layout()._packedOwnerships[tokenId]) == 0) --tokenId;
                result = packed & _BITMASK_BURNED == 0;
            }
        }
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
        from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));

        if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`.
            ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
        uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
        assembly {
            // Emit the `Transfer` event.
            log4(
                0, // Start of data (0, since no data).
                0, // End of data (0, since no data).
                _TRANSFER_EVENT_SIGNATURE, // Signature.
                from, // `from`.
                toMasked, // `to`.
                tokenId // `tokenId`.
            )
        }
        if (toMasked == 0) _revert(TransferToZeroAddress.selector);

        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                _revert(TransferToNonERC721ReceiverImplementer.selector);
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try
            ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data)
        returns (bytes4 retval) {
            return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                _revert(TransferToNonERC721ReceiverImplementer.selector);
            }
            assembly {
                revert(add(32, reason), mload(reason))
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
        if (quantity == 0) _revert(MintZeroQuantity.selector);

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
            uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;

            if (toMasked == 0) _revert(MintToZeroAddress.selector);

            uint256 end = startTokenId + quantity;
            uint256 tokenId = startTokenId;

            do {
                assembly {
                    // Emit the `Transfer` event.
                    log4(
                        0, // Start of data (0, since no data).
                        0, // End of data (0, since no data).
                        _TRANSFER_EVENT_SIGNATURE, // Signature.
                        0, // `address(0)`.
                        toMasked, // `to`.
                        tokenId // `tokenId`.
                    )
                }
                // The `!=` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
            } while (++tokenId != end);

            ERC721AStorage.layout()._currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
        if (to == address(0)) _revert(MintToZeroAddress.selector);
        if (quantity == 0) _revert(MintZeroQuantity.selector);
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            ERC721AStorage.layout()._currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = ERC721AStorage.layout()._currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        _revert(TransferToNonERC721ReceiverImplementer.selector);
                    }
                } while (index < end);
                // Reentrancy protection.
                if (ERC721AStorage.layout()._currentIndex != end) _revert(bytes4(0));
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                       APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_approve(to, tokenId, false)`.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _approve(to, tokenId, false);
    }

    /**
     * @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:
     *
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        bool approvalCheck
    ) internal virtual {
        address owner = ownerOf(tokenId);

        if (approvalCheck && _msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                _revert(ApprovalCallerNotOwnerNorApproved.selector);
            }

        ERC721AStorage.layout()._tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            ERC721AStorage.layout()._burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = ERC721AStorage.layout()._packedOwnerships[index];
        if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        ERC721AStorage.layout()._packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }

    /**
     * @dev For more efficient reverts.
     */
    function _revert(bytes4 errorSelector) internal pure {
        assembly {
            mstore(0x00, errorSelector)
            revert(0x00, 0x04)
        }
    }
}

File 15 of 30 : IConsensusVault.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

/**
 * @title Interface for ConsensusVault
 * @notice Vault will manage methods for rewards, commissions, tax
 */
interface IConsensusVault {
    /**
     * @notice transfer ETH
     * @param _amount transfer amount
     * @param _to transfer to address
     */
    function transfer(uint256 _amount, address _to) external;

    /**
     * @notice transfer ETH
     * @param _amount transfer amount
     */
    function reinvestment(uint256 _amount) external;
}

File 16 of 30 : IVaultManager.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

import {WithdrawInfo, ExitValidatorInfo} from "../library/ConsensusStruct.sol";
/**
 * @title Interface for IVaultManager
 * @notice Vault will manage methods for rewards, commissions, tax
 */

interface IVaultManager {
    /**
     * @notice Settlement and reinvestment execution layer rewards
     * @param _operatorIds operator id
     */
    function settleAndReinvestElReward(uint256[] memory _operatorIds) external;

    /**
     * @notice Receive the oracle machine consensus layer information, initiate re-investment consensus layer rewards, trigger and update the exited nft
     * @param _withdrawInfo withdraw info
     * @param _exitValidatorInfo exit validator info
     * @param _nftExitDelayedTokenIds nft with delayed exit
     * @param _largeExitDelayedRequestIds large Requests for Delayed Exit
     * @param _thisTotalWithdrawAmount The total settlement amount reported this time
     */
    function reportConsensusData(
        WithdrawInfo[] memory _withdrawInfo,
        ExitValidatorInfo[] memory _exitValidatorInfo,
        uint256[] memory _nftExitDelayedTokenIds, // user nft
        uint256[] memory _largeExitDelayedRequestIds, // large unstake request id
        uint256 _thisTotalWithdrawAmount
    ) external;
}

File 17 of 30 : IWithdrawalRequest.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.18;

/**
 * @title Interface for WithdrawalRequest
 * @notice WithdrawalRequest contract
 */
interface IWithdrawalRequest {
    /**
     * @notice get nft unstake block number
     * @param _tokenId token id
     */
    function getNftUnstakeBlockNumber(uint256 _tokenId) external view returns (uint256);

    /**
     * @notice Get information about Withdrawal request
     * @param  _requestId request Id
     */
    function getWithdrawalOfRequestId(uint256 _requestId)
        external
        view
        returns (uint256, uint256, uint256, uint256, uint256, address, bool);

    /**
     * @notice Get information about operator's withdrawal request
     * @param  _operatorId operator Id
     */
    function getOperatorLargeWithdrawalPendingInfo(uint256 _operatorId) external view returns (uint256, uint256);

    /**
     * @notice receive eth for withdrawals
     * @param _operatorId _operator id
     * @param  _amount receive fund amount
     */
    function receiveWithdrawals(uint256 _operatorId, uint256 _amount) external payable;

    /**
     * @notice getTotalPendingClaimedAmounts: Used when calculating exchange rates
     */
    function getTotalPendingClaimedAmounts() external view returns (uint256);
}

File 18 of 30 : IOFT.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/**
 * @dev Struct representing token parameters for the OFT send() operation.
 */
struct SendParam {
    uint32 dstEid; // Destination endpoint ID.
    bytes32 to; // Recipient address.
    uint256 amountLD; // Amount to send in local decimals.
    uint256 minAmountLD; // Minimum amount to send in local decimals.
    bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.
    bytes composeMsg; // The composed message for the send() operation.
    bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.
}

/**
 * @dev Struct representing OFT limit information.
 * @dev These amounts can change dynamically and are up the the specific oft implementation.
 */
struct OFTLimit {
    uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.
    uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.
}

/**
 * @dev Struct representing OFT receipt information.
 */
struct OFTReceipt {
    uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.
    // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.
    uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.
}

/**
 * @dev Struct representing OFT fee details.
 * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.
 */
struct OFTFeeDetail {
    int256 feeAmountLD; // Amount of the fee in local decimals.
    string description; // Description of the fee.
}

struct MessagingFee {
    uint256 nativeFee;
    uint256 lzTokenFee;
}

struct MessagingReceipt {
    bytes32 guid;
    uint64 nonce;
    MessagingFee fee;
}

/**
 * @title IOFT
 * @dev Interface for the OftChain (OFT) token.
 * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.
 * @dev This specific interface ID is '0x02e49c2c'.
 */
interface IOFT {

    /**
     * @notice Retrieves interfaceID and the version of the OFT.
     * @return interfaceId The interface ID.
     * @return version The version.
     *
     * @dev interfaceId: This specific interface ID is '0x02e49c2c'.
     * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.
     * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.
     * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)
     */
    function oftVersion() external view returns (bytes4 interfaceId, uint64 version);

    /**
     * @notice Retrieves the address of the token associated with the OFT.
     * @return token The address of the ERC20 token implementation.
     */
    function token() external view returns (address);

    /**
     * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.
     * @return requiresApproval Needs approval of the underlying token implementation.
     *
     * @dev Allows things like wallet implementers to determine integration requirements,
     * without understanding the underlying token implementation.
     */
    function approvalRequired() external view returns (bool);

    /**
     * @notice Retrieves the shared decimals of the OFT.
     * @return sharedDecimals The shared decimals of the OFT.
     */
    function sharedDecimals() external view returns (uint8);

    /**
     * @notice Provides a quote for OFT-related operations.
     * @param _sendParam The parameters for the send operation.
     * @return limit The OFT limit information.
     * @return oftFeeDetails The details of OFT fees.
     * @return receipt The OFT receipt information.
     */
    function quoteOFT(
        SendParam calldata _sendParam
    ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);

    /**
     * @notice Provides a quote for the send() operation.
     * @param _sendParam The parameters for the send() operation.
     * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.
     * @return fee The calculated LayerZero messaging fee from the send() operation.
     *
     * @dev MessagingFee: LayerZero msg fee
     *  - nativeFee: The native fee.
     *  - lzTokenFee: The lzToken fee.
     */
    function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);

    /**
     * @notice Executes the send() operation.
     * @param _sendParam The parameters for the send operation.
     * @param _fee The fee information supplied by the caller.
     *      - nativeFee: The native fee.
     *      - lzTokenFee: The lzToken fee.
     * @param _refundAddress The address to receive any excess funds from fees etc. on the src.
     * @return receipt The LayerZero messaging receipt from the send() operation.
     * @return oftReceipt The OFT receipt information.
     *
     * @dev MessagingReceipt: LayerZero msg receipt
     *  - guid: The unique identifier for the sent message.
     *  - nonce: The nonce of the sent message.
     *  - fee: The LayerZero fee incurred for the message.
     */
    function send(
        SendParam calldata _sendParam,
        MessagingFee calldata _fee,
        address _refundAddress
    ) external payable returns (MessagingReceipt memory, OFTReceipt memory);
}

File 19 of 30 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.18;
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;
}

File 20 of 30 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.18;

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

File 21 of 30 : ERC1967UtilsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.18;

import { IBeaconUpgradeable } from "../beacon/IBeaconUpgradeable.sol";
import { AddressUpgradeable } from "../../utils/AddressUpgradeable.sol";
import { StorageSlotUpgradeable } from "../../utils/StorageSlotUpgradeable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967UtilsUpgradeable {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @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);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @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 {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlotUpgradeable.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            AddressUpgradeable.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    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 {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlotUpgradeable.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-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 the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    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 {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlotUpgradeable.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeaconUpgradeable(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

File 22 of 30 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 23 of 30 : IERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721AUpgradeable {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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`,
     * 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 be 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * 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 payable;

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

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

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 24 of 30 : ERC721AStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library ERC721AStorage {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    struct Layout {
        // =============================================================
        //                            STORAGE
        // =============================================================

        // The next token ID to be minted.
        uint256 _currentIndex;
        // The number of tokens burned.
        uint256 _burnCounter;
        // Token name
        string _name;
        // Token symbol
        string _symbol;
        // Mapping from token ID to ownership details
        // An empty struct value does not necessarily mean the token is unowned.
        // See {_packedOwnershipOf} implementation for details.
        //
        // Bits Layout:
        // - [0..159]   `addr`
        // - [160..223] `startTimestamp`
        // - [224]      `burned`
        // - [225]      `nextInitialized`
        // - [232..255] `extraData`
        mapping(uint256 => uint256) _packedOwnerships;
        // Mapping owner address to address data.
        //
        // Bits Layout:
        // - [0..63]    `balance`
        // - [64..127]  `numberMinted`
        // - [128..191] `numberBurned`
        // - [192..255] `aux`
        mapping(address => uint256) _packedAddressData;
        // Mapping from token ID to approved address.
        mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals;
        // Mapping from owner to operator approvals
        mapping(address => mapping(address => bool)) _operatorApprovals;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 25 of 30 : ERC721A__Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable diamond facet 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.
 *
 * 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.
 */

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

abstract contract ERC721A__Initializable {
    using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializerERC721A() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(
            ERC721A__InitializableStorage.layout()._initializing
                ? _isConstructor()
                : !ERC721A__InitializableStorage.layout()._initialized,
            'ERC721A__Initializable: contract is already initialized'
        );

        bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing;
        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = true;
            ERC721A__InitializableStorage.layout()._initialized = true;
        }

        _;

        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializingERC721A() {
        require(
            ERC721A__InitializableStorage.layout()._initializing,
            'ERC721A__Initializable: contract is not initializing'
        );
        _;
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        assembly {
            cs := extcodesize(self)
        }
        return cs == 0;
    }
}

File 26 of 30 : ConsensusStruct.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

struct WithdrawInfo {
    uint64 operatorId;
    // The income that should be issued by this operatorId in this settlement
    uint96 clReward;
    // For this settlement, whether operatorId has exit node, if no exit node is 0;
    // The value of one node exiting is 32 eth(or 32.9 ETH), and the value of two nodes exiting is 64eth (or 63 ETH).
    // If the value is less than 32, the corresponding amount will be punished
    // clCapital is the principal of nft exit held by the protocol
    uint96 clCapital;
}

struct ExitValidatorInfo {
    // Example Exit the token Id of the validator. No exit is an empty array.
    uint64 exitTokenId;
    // Height of exit block
    uint96 exitBlockNumber;

}

File 27 of 30 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.18;

/**
 * @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.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 28 of 30 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.18;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

File 29 of 30 : StorageSlotUpgradeable.sol
// 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.18;

/**
 * @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(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
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
        }
    }
}

File 30 of 30 : ERC721A__InitializableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base storage for the  initialization function for upgradeable diamond facet contracts
 **/

library ERC721A__InitializableStorage {
    struct Layout {
        /*
         * Indicates that the contract has been initialized.
         */
        bool _initialized;
        /*
         * Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

Settings
{
  "remappings": [
    "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "solmate/=lib/solmate/src/",
    "@contracts/=src/",
    "@ssv-network/=lib/ssv-network/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "ssv-network/=lib/ssv-network/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"AssignMustSameOperator","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidDaoVaultAddr","type":"error"},{"inputs":[],"name":"InvalidParameter","type":"error"},{"inputs":[],"name":"InvalidWithdrawalCredentials","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"OperatorHasArrears","type":"error"},{"inputs":[],"name":"OperatorLoanFailed","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PermissionDenied","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"RequireBlacklistOperator","type":"error"},{"inputs":[],"name":"RequireOperatorTrusted","type":"error"},{"inputs":[],"name":"TotalEthIsZero","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[],"name":"UnstakeEthNoQuota","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_adaptor","type":"address"}],"name":"AdaptorAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"consensusVaultContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_consensusVaultContract","type":"address"}],"name":"ConsensusVaultContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldDao","type":"address"},{"indexed":false,"internalType":"address","name":"_dao","type":"address"}],"name":"DaoAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"DaoClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldDaoVaultAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_daoVaultAddress","type":"address"}],"name":"DaoVaultAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositContract","type":"address"},{"indexed":false,"internalType":"address","name":"_depositContract","type":"address"}],"name":"DepositContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"DepositContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_feeRate","type":"uint256"}],"name":"DepositFeeRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOut","type":"uint256"}],"name":"EthStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetOperatorId","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amounts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"EthUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"_oldLiquidStakingWithdrawalCredentials","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_liquidStakingWithdrawalCredentials","type":"bytes"}],"name":"LiquidStakingWithdrawalCredentialsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"exitBlockNumbers","type":"uint256[]"}],"name":"NftExitBlockNumberSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_count","type":"uint256"}],"name":"NftStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldNodeOperatorRegistryContract","type":"address"},{"indexed":false,"internalType":"address","name":"_nodeOperatorRegistryContract","type":"address"}],"name":"NodeOperatorRegistryContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_blacklistOperatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_totalAmount","type":"uint256"}],"name":"OperatorAssigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"operatorCanLoanAmounts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newCanloadAmounts","type":"uint256"}],"name":"OperatorCanLoanAmountsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"OperatorClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"OperatorReinvestClRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"OperatorReinvestElRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOperatorSlashContract","type":"address"},{"indexed":false,"internalType":"address","name":"_operatorSlashContract","type":"address"}],"name":"OperatorSlashContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"RewardsReceive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Transferred","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":false,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"UserClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_operatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_pubkey","type":"bytes"}],"name":"ValidatorRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vaultManagerContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_vaultManagerContract","type":"address"}],"name":"VaultManagerContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldWithdrawOracleContractSet","type":"address"},{"indexed":false,"internalType":"address","name":"_withdrawOracleContractSetAddress","type":"address"}],"name":"WithdrawOracleContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_withdrawalRequestContract","type":"address"},{"indexed":false,"internalType":"address","name":"_withdrawalRequestContractAddress","type":"address"}],"name":"WithdrawalRequestContractSet","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assignOperatorId","type":"uint256"},{"internalType":"uint256","name":"_operatorId","type":"uint256"}],"name":"assignOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_daoVaultAddress","type":"address"},{"internalType":"address","name":"_nodeOperatorRegistryContract","type":"address"},{"internalType":"address","name":"_withdrawOracleContractAddress","type":"address"},{"internalType":"address","name":"_withdrawalRequestContractAddress","type":"address"},{"internalType":"address","name":"_vaultManagerContract","type":"address"},{"internalType":"address","name":"_consensusVaultContractAddress","type":"address"},{"internalType":"address","name":"_depositContractAddress","type":"address"}],"name":"changeCountractSetting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_operatorIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_rewards","type":"uint256[]"}],"name":"claimRewardsOfDao","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"address[]","name":"_rewardAddresses","type":"address[]"},{"internalType":"uint256[]","name":"_rewards","type":"uint256[]"}],"name":"claimRewardsOfOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"_totalNftRewards","type":"uint256"},{"internalType":"uint256","name":"_gasHeight","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"}],"name":"claimRewardsOfUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"consensusVaultContract","outputs":[{"internalType":"contract IConsensusVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dao","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daoVaultAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositContract","outputs":[{"internalType":"contract IDepositContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"fastUnstakeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentExchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"}],"name":"getOperatorNethUnstakePoolAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"}],"name":"getOperatorNftPoolBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalEthValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"}],"name":"getUnstakeQuota","outputs":[{"components":[{"internalType":"uint256","name":"operatorId","type":"uint256"},{"internalType":"uint256","name":"quota","type":"uint256"}],"internalType":"struct LiquidStaking.StakeInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"address","name":"_onBehalfOf","type":"address"}],"name":"l2StakeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalRequestNethAmount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"largeWithdrawalRequestBurnNeth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"largeWithdrawalUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidStakingWithdrawalCredentials","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nETHContract","outputs":[{"internalType":"contract INETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_exitBlockNumbers","type":"uint256[]"}],"name":"nftExitHandle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nodeOperatorRegistryContract","outputs":[{"internalType":"contract INodeOperatorsRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operatorCanLoanAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"operatorLoadBlockNumbers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"operatorLoanRecords","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"operatorNftPoolBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"operatorPoolBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseProtocol","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"reAssignRecords","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"receiveRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"receivedTokens","outputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_pubkeys","type":"bytes[]"},{"internalType":"bytes[]","name":"_signatures","type":"bytes[]"},{"internalType":"bytes32[]","name":"_depositDataRoots","type":"bytes32[]"}],"name":"registerValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_operatorIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256","name":"_totalAmount","type":"uint256"}],"name":"reinvestClRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_operatorIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"reinvestElRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adaptor","type":"address"}],"name":"setAdaptorAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"}],"name":"setDaoAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeRate","type":"uint256"}],"name":"setDepositFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_liquidStakingWithdrawalCredentials","type":"bytes"}],"name":"setLiquidStakingWithdrawalCredentials","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCanLoanAmounts","type":"uint256"}],"name":"setOperatorCanLoanAmounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"}],"name":"stakeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"}],"name":"stakeNFT","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_operatorId","type":"uint256"},{"internalType":"uint256","name":"_amounts","type":"uint256"},{"internalType":"address","name":"onBehalfOf","type":"address"}],"name":"unstakeETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"vNFTContract","outputs":[{"internalType":"contract IVNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultManagerContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawOracleContract","outputs":[{"internalType":"contract IWithdrawOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalRequestContract","outputs":[{"internalType":"contract IWithdrawalRequest","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xETHAdaptor","outputs":[{"internalType":"contract IOFT","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a0604052306080523480156012575f80fd5b506080516153576100395f395f8181613afe01528181613b270152613c6601526153575ff3fe608060405260043610610371575f3560e01c806379c5092b116101c8578063bc7b0d20116100fd578063dbf624891161009d578063f2fde38b1161006d578063f2fde38b14610a3b578063f5e415c714610a5a578063f93b6be514610a79578063fc03411f14610a8d575f80fd5b8063dbf62489146109ca578063e59546be146109de578063e94ad65b146109fd578063eef02d3b14610a1c575f80fd5b8063d4a47d6d116100d8578063d4a47d6d14610952578063d6a29dc514610968578063d77868da14610988578063d7791e261461099b575f80fd5b8063bc7b0d20146108e8578063bd97c75914610914578063bf9cfe6c14610933575f80fd5b80639a42e0ba11610168578063ad3cb1cc11610143578063ad3cb1cc14610865578063b187bd2614610895578063b36e2cce146108a9578063b3ee9d6b146108c8575f80fd5b80639a42e0ba146108085780639f575f0f14610827578063a6a0ac9614610846575f80fd5b80638628974b116101a35780638628974b1461078e5780638da5cb5b146107ad5780638e691b9a146107ca5780639a3cac6a146107e9575f80fd5b806379c5092b1461072d5780637d75de5514610759578063852cb9b814610778575f80fd5b80633d6a3844116102a957806352d1902d116102495780636eb604e0116102195780636eb604e0146106c75780636ecc20da146106da578063715018a6146106ed57806374ee7f8614610701575f80fd5b806352d1902d14610652578063545f8860146106665780635c975abb146106855780635d20c6be146106a8575f80fd5b8063420d1e5011610284578063420d1e50146105eb5780634277f6931461060b57806345dcb6391461061f5780634f1ef2861461063f575f80fd5b80633d6a3844146105675780633eca72131461059f5780634162169f146105cb575f80fd5b8063193615fe1161031457806337a203c8116102ef57806337a203c8146104e957806339007890146105085780633a548da1146105345780633ca967f314610553575f80fd5b8063193615fe1461047f5780632f7486f11461049e5780632fa2a2cc146104ca575f80fd5b806312ebdab41161034f57806312ebdab4146103f4578063142bd10014610415578063150b7a021461042857806315cf1a8f14610460575f80fd5b806303665fd514610375578063058d04ab146103b45780630d020de2146103d5575b5f80fd5b348015610380575f80fd5b506103a161038f36600461421c565b5f90815261010b602052604090205490565b6040519081526020015b60405180910390f35b3480156103bf575f80fd5b506103d36103ce366004614257565b610aac565b005b3480156103e0575f80fd5b506103d36103ef36600461436c565b610b31565b3480156103ff575f80fd5b50610408610ce9565b6040516103ab91906143f9565b6103d3610423366004614489565b610d75565b348015610433575f80fd5b506104476104423660046145c2565b61108d565b6040516001600160e01b031990911681526020016103ab565b34801561046b575f80fd5b506103d361047a36600461462f565b611184565b34801561048a575f80fd5b506103d3610499366004614734565b61133d565b3480156104a9575f80fd5b506103a16104b836600461421c565b6101116020525f908152604090205481565b3480156104d5575f80fd5b506103d36104e43660046147c6565b611613565b3480156104f4575f80fd5b506103d3610503366004614804565b611688565b348015610513575f80fd5b506103a161052236600461421c565b61010b6020525f908152604090205481565b34801561053f575f80fd5b506103d361054e36600461483a565b6117c0565b34801561055e575f80fd5b506103a16117f7565b348015610572575f80fd5b5061010754610587906001600160a01b031681565b6040516001600160a01b0390911681526020016103ab565b3480156105aa575f80fd5b506103a16105b936600461421c565b6101106020525f908152604090205481565b3480156105d6575f80fd5b5061010654610587906001600160a01b031681565b3480156105f6575f80fd5b5061011254610587906001600160a01b031681565b348015610616575f80fd5b506103a1611805565b34801561062a575f80fd5b5061010a54610587906001600160a01b031681565b6103d361064d36600461486f565b611a77565b34801561065d575f80fd5b506103a1611a96565b348015610671575f80fd5b506103d36106803660046148b1565b611ab1565b348015610690575f80fd5b5060c85460ff165b60405190151581526020016103ab565b3480156106b3575f80fd5b506103d36106c236600461436c565b611d4a565b6103d36106d536600461421c565b611f2a565b6103d36106e836600461421c565b612111565b3480156106f8575f80fd5b506103d361235c565b34801561070c575f80fd5b506103a161071b36600461421c565b6101016020525f908152604090205481565b348015610738575f80fd5b506103a161074736600461421c565b61010e6020525f908152604090205481565b348015610764575f80fd5b506103d3610773366004614918565b61236f565b348015610783575f80fd5b506103a16101005481565b348015610799575f80fd5b506103d36107a836600461436c565b612674565b3480156107b8575f80fd5b506096546001600160a01b0316610587565b3480156107d5575f80fd5b506103d36107e436600461421c565b612873565b3480156107f4575f80fd5b506103d3610803366004614257565b612905565b348015610813575f80fd5b5060fb54610587906001600160a01b031681565b348015610832575f80fd5b506103d3610841366004614981565b61299f565b348015610851575f80fd5b5060fe54610587906001600160a01b031681565b348015610870575f80fd5b50610408604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156108a0575f80fd5b50610698612a28565b3480156108b4575f80fd5b506103d36108c33660046149af565b612a35565b3480156108d3575f80fd5b5061010854610587906001600160a01b031681565b3480156108f3575f80fd5b50610907610902366004614257565b612bad565b6040516103ab91906149cf565b34801561091f575f80fd5b5060fc54610587906001600160a01b031681565b34801561093e575f80fd5b506103d361094d366004614a25565b612c33565b34801561095d575f80fd5b506103a161010f5481565b348015610973575f80fd5b5061010954610587906001600160a01b031681565b6103d361099636600461421c565b612f6b565b3480156109a6575f80fd5b506109ba6109b536600461421c565b612f9b565b6040516103ab9493929190614ab6565b3480156109d5575f80fd5b506103d3613058565b3480156109e9575f80fd5b506103d36109f836600461421c565b61308c565b348015610a08575f80fd5b5060fa54610587906001600160a01b031681565b348015610a27575f80fd5b506103a1610a3636600461421c565b613125565b348015610a46575f80fd5b506103d3610a55366004614257565b613227565b348015610a65575f80fd5b506103a1610a74366004614804565b613261565b348015610a84575f80fd5b506103d361342d565b348015610a98575f80fd5b5060fd54610587906001600160a01b031681565b610ab4613461565b6001600160a01b038116610adb57604051630309cb8760e51b815260040160405180910390fd5b61011280546001600160a01b0319166001600160a01b0383169081179091556040519081527f9df74405fa198cdaf5a912a179ded609cb3ae1669bb41a8523a4ee7643ebb7c0906020015b60405180910390a150565b610108546001600160a01b03163314610b5d57604051630782484160e21b815260040160405180910390fd5b8051825114610b7f57604051630309cb8760e51b815260040160405180910390fd5b5f5b8251811015610ce4575f838281518110610b9d57610b9d614ae8565b602002602001015190505f838381518110610bba57610bba614ae8565b60200260200101519050805f03610bd2575050610cdc565b60fb546040516322e44d7f60e21b8152600481018490525f916001600160a01b031690638b9135fc90602401602060405180830381865afa158015610c19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c3d9190614afc565b60405163396ccab160e11b8152600481018490529091506001600160a01b038216906372d99562906024015f604051808303815f87803b158015610c7f575f80fd5b505af1158015610c91573d5f803e3d5ffd5b50505050610c9f838361348e565b60408051848152602081018490527f933f5d3652cfb50d9224df3ff1b228450d2917a80b7338cc68a309f5b20c38f6910160405180910390a15050505b600101610b81565b505050565b60ff8054610cf690614b17565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2290614b17565b8015610d6d5780601f10610d4457610100808354040283529160200191610d6d565b820191905f5260205f20905b815481529060010190602001808311610d5057829003601f168201915b505050505081565b610d7d613546565b610d85613570565b64e8d4a51000341015610dab5760405163162908e360e11b815260040160405180910390fd5b60fb5460405163f2eeb33760e01b8152600481018490526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015610df2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e169190614b4f565b610e335760405163dc0ca7f360e01b815260040160405180910390fd5b610e3b613594565b5f610e446135e4565b90505f81610e5a34670de0b6b3a7640000614b82565b610e649190614bad565b60fc546040516319157fab60e21b8152600481018390523060248201529192506001600160a01b031690636455feac906044015f604051808303815f87803b158015610eae575f80fd5b505af1158015610ec0573d5f803e3d5ffd5b50505050610ece848261348e565b610ed9848483613668565b60fc546101125460405163095ea7b360e01b81526001600160a01b0391821660048201526024810184905291169063095ea7b3906044016020604051808303815f875af1158015610f2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f509190614b4f565b5061011254604051633b6f743b60e01b81525f916001600160a01b031690633b6f743b90610f849089908590600401614c35565b6040805180830381865afa158015610f9e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc29190614ca4565b6101125460405163c7c7f5b360e01b81529192506001600160a01b03169063c7c7f5b390610ff890899085908990600401614cbe565b60c0604051808303815f875af1158015611014573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110389190614d02565b505060408051348152602081018490526001600160a01b0386169187917f1cae59a31c3c6760aa08cb9c351432553e908b8e6f53e7c9ac22715c7d496179910160405180910390a3505050610ce46001603255565b5f6040518060800160405280876001600160a01b03168152602001866001600160a01b0316815260200185815260200184848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525093909452505086815261010c6020908152604091829020845181546001600160a01b03199081166001600160a01b0392831617835592860151600183018054909416911617909155908301516002820155606083015190915060038201906111569082614dd5565b507f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f98975050505050505050565b61118c613546565b611194613570565b610108546001600160a01b031633146111c057604051630782484160e21b815260040160405180910390fd5b80518251146111e257604051630309cb8760e51b815260040160405180910390fd5b5f83815261011060205260409020541561120f57604051631cb9e82d60e01b815260040160405180910390fd5b60fb546040516322e44d7f60e21b8152600481018590525f916001600160a01b031690638b9135fc90602401602060405180830381865afa158015611256573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061127a9190614afc565b90505f5b835181101561133157816001600160a01b031663b7760c8f8483815181106112a8576112a8614ae8565b60200260200101518684815181106112c2576112c2614ae8565b60200260200101516040518363ffffffff1660e01b81526004016112f99291909182526001600160a01b0316602082015260400190565b5f604051808303815f87803b158015611310575f80fd5b505af1158015611322573d5f803e3d5ffd5b5050505080600101905061127e565b5050610ce46001603255565b611345613546565b61134d613570565b848314158061135c5750848114155b1561137a57604051630309cb8760e51b815260040160405180910390fd5b60fb546040516308f5c9ff60e41b81523360048201525f916001600160a01b031690638f5c9ff090602401602060405180830381865afa1580156113c0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113e49190614e90565b9050805f036114065760405163dc0ca7f360e01b815260040160405180910390fd5b5f81815261010b60209081526040808320546101019092529091205487916801bc16d674ec800000916114399190614ea7565b6114439190614bad565b10156114625760405163356680b760e01b815260040160405180910390fd5b5f805b878110156114ef575f6114d8848b8b8581811061148457611484614ae8565b90506020028101906114969190614eba565b8b8b878181106114a8576114a8614ae8565b90506020028101906114ba9190614eba565b8b8b898181106114cc576114cc614ae8565b90506020020135613822565b90506114e48184614ea7565b925050600101611465565b505f611504886801bc16d674ec800000614b82565b90505f61151a836801bc16d674ec800000614b82565b90505f6115278284614efc565b9050806101015f8781526020019081526020015f205f82825461154a9190614efc565b92505081905550806101025f8282546115639190614efc565b90915550505f85815261010b602052604081208054849290611586908490614efc565b90915550505f8590526101016020526115a3565b60405180910390fd5b60fe546040516308e34ead60e41b8152600481018390526001600160a01b0390911690638e34ead0906024015f604051808303815f87803b1580156115e6575f80fd5b505af11580156115f8573d5f803e3d5ffd5b50505050505050505061160b6001603255565b505050505050565b610106546001600160a01b0316331461163f57604051630782484160e21b815260040160405180910390fd5b7f3af3c6f7639df17de134ac1099e1e1d389efdc16cda06cbfbc76142258d5d2fd60ff838360405161167393929190614fb0565b60405180910390a160ff610ce4828483614fd5565b61010a546001600160a01b031633146116b457604051630782484160e21b815260040160405180910390fd5b5f83815261010b6020526040812080546801bc16d674ec80000092906116db908490614efc565b90915550506040516001600160a01b038216905f906801bc16d674ec8000009082818181858883f19350505050158015611717573d5f803e3d5ffd5b50604080516001600160a01b03831681526801bc16d674ec80000060208201527fe6d858f14d755446648a6e0c8ab8b5a0f58ccc7920d4c910b0454e4dcd869af0910160405180910390a160fd5460405163c2c3a60d60e01b8152600481018490526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b1580156117a5575f80fd5b505af11580156117b7573d5f803e3d5ffd5b50505050505050565b61010a546001600160a01b031633146117ec57604051630782484160e21b815260040160405180910390fd5b610ce483838361395d565b5f6118006135e4565b905090565b61010a546040805163fdc88efd60e01b815290515f926001600160a01b03169163fdc88efd9160048083019260209291908290030181865afa15801561184d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118719190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b031663acfc654b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118e59190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b03166367fe13056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611935573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119599190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b0316630fd520f66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119a9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119cd9190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b031663f0b73e116040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a419190614e90565b61010254611a4f9190614ea7565b611a599190614ea7565b611a639190614ea7565b611a6d9190614efc565b6118009190614efc565b611a7f613af3565b611a8882613b97565b611a928282613b9f565b5050565b5f611a9f613c5b565b505f8051602061530283398151915290565b610108546001600160a01b03163314611add57604051630782484160e21b815260040160405180910390fd5b8151835114611aff57604051630309cb8760e51b815260040160405180910390fd5b6101095460405163396ccab160e11b8152600481018390526001600160a01b03909116906372d99562906024015f604051808303815f87803b158015611b43575f80fd5b505af1158015611b55573d5f803e3d5ffd5b505050505f805b8451811015611d23575f858281518110611b7857611b78614ae8565b602002602001015190505f858381518110611b9557611b95614ae8565b60200260200101519050805f03611bad575050611d1b565b611bb78185614ea7565b61010a546040516399405f3360e01b8152600481018590529195505f9182916001600160a01b0316906399405f33906024016040805180830381865afa158015611c03573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c27919061508e565b909250905081811015611ccc575f82611c408584614ea7565b10611c6257611c4f8284614efc565b9050611c5b8185614efc565b9350611c66565b505f925b61010a5460405163d3d2b2cb60e01b815260048101879052602481018390526001600160a01b039091169063d3d2b2cb9083906044015f604051808303818588803b158015611cb3575f80fd5b505af1158015611cc5573d5f803e3d5ffd5b5050505050505b8215611d1657611cdc848461348e565b60408051858152602081018590527f7e0fd5b648afd09ad3f3913bdf766931ac752a7ac7c392b7713362379923b0fe910160405180910390a15b505050505b600101611b5c565b50808214611d4457604051630309cb8760e51b815260040160405180910390fd5b50505050565b610108546001600160a01b03163314611d7657604051630782484160e21b815260040160405180910390fd5b8051825114611d83575f80fd5b60fd546040516333bf834560e11b81526001600160a01b039091169063677f068a90611db590859085906004016150ea565b5f604051808303815f87803b158015611dcc575f80fd5b505af1158015611dde573d5f803e3d5ffd5b505050505f5b8251811015611eec575f838281518110611e0057611e00614ae8565b602090810291909101015160fd546040516331a9108f60e11b81526004810183905291925030916001600160a01b0390911690636352211e90602401602060405180830381865afa158015611e57573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e7b9190614afc565b6001600160a01b031603611ee35760fd5460405163c2c3a60d60e01b8152600481018390526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b158015611ecc575f80fd5b505af1158015611ede573d5f803e3d5ffd5b505050505b50600101611de4565b507f20bcb7d77186ac511956250f550408a100cc464af62c11e5b60c40aa3ec9c42e8282604051611f1e9291906150ea565b60405180910390a15050565b611f32613546565b611f3a613570565b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015611f81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611fa59190614b4f565b611fc25760405163dc0ca7f360e01b815260040160405180910390fd5b341580611fe05750611fdd6801bc16d674ec8000003461510e565b15155b15611ffe5760405163162908e360e11b815260040160405180910390fd5b5f6120126801bc16d674ec80000034614bad565b90505f5b818110156120a85760fd54604080516020810182525f81529051630314cb0560e01b81526001600160a01b0390921691630314cb059161205f9160ff9033908990600401615121565b6020604051808303815f875af115801561207b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061209f9190614e90565b50600101612016565b505f82815261010b6020526040812080543492906120c7908490614ea7565b9091555050604051818152339083907f7acd64380f0b80d169f87cad8295b93ee2889c7f5c8f861bee0d1e4edb657afb9060200160405180910390a35061210e6001603255565b50565b612119613546565b612121613570565b64e8d4a510003410156121475760405163162908e360e11b815260040160405180910390fd5b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa15801561218e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121b29190614b4f565b6121cf5760405163dc0ca7f360e01b815260040160405180910390fd5b610100545f9034901561226b5761271061010054346121ee9190614b82565b6121f89190614bad565b91506122048234614efc565b610107549091506001600160a01b0316612231576040516338d2305b60e21b815260040160405180910390fd5b610107546040516001600160a01b039091169083156108fc029084905f818181858888f19350505050158015612269573d5f803e3d5ffd5b505b612273613594565b5f61227c6135e4565b90505f8161229284670de0b6b3a7640000614b82565b61229c9190614bad565b60fc546040516319157fab60e21b8152600481018390523360248201529192506001600160a01b031690636455feac906044015f604051808303815f87803b1580156122e6575f80fd5b505af11580156122f8573d5f803e3d5ffd5b50505050612306858461348e565b612311853383613668565b6040805134815260208101839052339187917f1cae59a31c3c6760aa08cb9c351432553e908b8e6f53e7c9ac22715c7d496179910160405180910390a35050505061210e6001603255565b612364613461565b61236d5f613ca4565b565b612377613546565b61237f613570565b610108546001600160a01b031633146123ab57604051630782484160e21b815260040160405180910390fd5b835115806123b857504382115b156123d657604051630309cb8760e51b815260040160405180910390fd5b60fd546040516379ff5d1d60e01b81525f916001600160a01b0316906379ff5d1d90612406908890600401615162565b5f60405180830381865afa158015612420573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526124479190810190615174565b90505f5b8551811015612559575f86828151811061246757612467614ae8565b6020026020010151905082828151811061248357612483614ae8565b60200260200101515f146124ef5760fd5460405163c2c3a60d60e01b8152600481018390526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b1580156124d4575f80fd5b505af11580156124e6573d5f803e3d5ffd5b50505050612550565b60fd54604051632e92d33560e21b815260048101839052602481018790526001600160a01b039091169063ba4b4cd4906044015f604051808303815f87803b158015612539575f80fd5b505af115801561254b573d5f803e3d5ffd5b505050505b5060010161244b565b5060fb546040516322e44d7f60e21b8152600481018890525f916001600160a01b031690638b9135fc90602401602060405180830381865afa1580156125a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125c59190614afc565b60405163b7760c8f60e01b8152600481018790526001600160a01b0385811660248301529192509082169063b7760c8f906044015f604051808303815f87803b158015612610575f80fd5b505af1158015612622573d5f803e3d5ffd5b505050507fe1419955066833fcc44409a448a939482f4bdc3af35be67c59740ea729ff4a0b878787604051612659939291906151ff565b60405180910390a1505061266d6001603255565b5050505050565b61267c613546565b612684613570565b610108546001600160a01b031633146126b057604051630782484160e21b815260040160405180910390fd5b805182511415806126c057508051155b156126de57604051630309cb8760e51b815260040160405180910390fd5b5f5b8251811015612868575f8382815181106126fc576126fc614ae8565b602090810291909101015160fb546040516322e44d7f60e21b8152600481018390529192505f916001600160a01b0390911690638b9135fc90602401602060405180830381865afa158015612753573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127779190614afc565b9050806001600160a01b031663b7760c8f85858151811061279a5761279a614ae8565b60209081029190910101516101075460405160e084901b6001600160e01b031916815260048101929092526001600160a01b031660248201526044015f604051808303815f87803b1580156127ed575f80fd5b505af11580156127ff573d5f803e3d5ffd5b505050507fd015384993a63fbb67be31c3c4491e03f64fa52369a08927fe6d4cba14286f218285858151811061283757612837614ae8565b6020026020010151604051612856929190918252602082015260400190565b60405180910390a150506001016126e0565b50611a926001603255565b610106546001600160a01b0316331461289f57604051630782484160e21b815260040160405180910390fd5b6103e88111156128c257604051630309cb8760e51b815260040160405180910390fd5b6101005460408051918252602082018390527f90e50637c808ab8723fa9e2137e8972173099a6773142dcf42f0a394f7cef34d910160405180910390a161010055565b61290d613461565b6001600160a01b03811661293457604051630309cb8760e51b815260040160405180910390fd5b610106546040517fd5b3b0e6e0098a82fa04cf04faff9109f98389a10c80f20eb7186b927416894691612974916001600160a01b03909116908490615227565b60405180910390a161010680546001600160a01b0319166001600160a01b0392909216919091179055565b61010a546001600160a01b031633146129cb57604051630782484160e21b815260040160405180910390fd5b60fc54604051638e433bc760e01b8152600481018490526001600160a01b03838116602483015290911690638e433bc7906044015f604051808303815f87803b158015612a16575f80fd5b505af115801561160b573d5f803e3d5ffd5b5f61180060c85460ff1690565b612a3d613461565b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015612a84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612aa89190614b4f565b612ac55760405163dc0ca7f360e01b815260040160405180910390fd5b60fb54604051633b781aad60e01b8152600481018490526001600160a01b0390911690633b781aad90602401602060405180830381865afa158015612b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b309190614b4f565b612b4d57604051631c2c851b60e31b815260040160405180910390fd5b5f612b588383613cf5565b5f84815261010e6020908152604091829020859055815185815290810183905291925084917f2fb596e064755189ea64f65d467239f889fbc89a0cc5f7c4ac32cea82547919b910160405180910390a2505050565b6001600160a01b0381165f90815261010d60209081526040808320805482518185028101850190935280835260609492939192909184015b82821015612c28578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190612be5565b505050509050919050565b612c3b613461565b6001600160a01b03871615612caf57610107546040517f74f93434acf49508438eb6f219ca22e7e1818b620ccb7acd411c8f520b27b64291612c8a916001600160a01b03909116908a90615227565b60405180910390a161010780546001600160a01b0319166001600160a01b0389161790555b6001600160a01b03861615612d215760fb546040517f2aa578b9d95064e7e90ca0af5e42ca5499f5e90bd32c4e401df52a686ac6993d91612cfd916001600160a01b03909116908990615227565b60405180910390a160fb80546001600160a01b0319166001600160a01b0388161790555b6001600160a01b03851615612d935760fe546040517fe99905f924cb6eb922bbd9ce3ee596b55f73aea6fc2e7b4151fa502a38f1157f91612d6f916001600160a01b03909116908890615227565b60405180910390a160fe80546001600160a01b0319166001600160a01b0387161790555b6001600160a01b03841615612e075761010a546040517fb3b3e321ffd1930a33d425b4d1453792a16fca40d763a14c9fc90005360d059891612de2916001600160a01b03909116908790615227565b60405180910390a161010a80546001600160a01b0319166001600160a01b0386161790555b6001600160a01b03831615612e7b57610108546040517f136260758ef216be6f30b5244361f089faf99890f23864c0a63e2d2def24963f91612e56916001600160a01b03909116908690615227565b60405180910390a161010880546001600160a01b0319166001600160a01b0385161790555b6001600160a01b03821615612eef57610109546040517f955eb996feefc76589abe69cb5c8a3dfdf8cfa4fa9cec1611c9c3e61de5f55bf91612eca916001600160a01b03909116908590615227565b60405180910390a161010980546001600160a01b0319166001600160a01b0384161790555b6001600160a01b038116156117b75760fa546040517f24ed34a18e6e66e495b19120172d087ab55c30822e4989848bd265c3caa6de9a91612f3d916001600160a01b03909116908490615227565b60405180910390a160fa80546001600160a01b0383166001600160a01b031990911617905550505050505050565b6040518181527f128bc67045828b9e917cda6b9717921b174e8e2d1f135074c8d45e41d4e69ec690602001610b26565b61010c6020525f908152604090208054600182015460028301546003840180546001600160a01b039485169594909316939192612fd790614b17565b80601f016020809104026020016040519081016040528092919081815260200182805461300390614b17565b801561304e5780601f106130255761010080835404028352916020019161304e565b820191905f5260205f20905b81548152906001019060200180831161303157829003601f168201915b5050505050905084565b610106546001600160a01b0316331461308457604051630782484160e21b815260040160405180910390fd5b61236d613da2565b610106546001600160a01b031633146130b857604051630782484160e21b815260040160405180910390fd5b683635c9adc5dea000008111156130e257604051630309cb8760e51b815260040160405180910390fd5b61010f5460408051918252602082018390527fe4ef8288470b9f1af2ad6df80093b6a682f279693121712af0247f814f2f31a4910160405180910390a161010f55565b60fb54604051634b08ea7160e11b8152600481018390525f91839183916001600160a01b031690639611d4e290602401602060405180830381865afa158015613170573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131949190614b4f565b905080156131b7575f84815261010e602052604090205480156131b5578092505b505b5f82815261010160209081526040808320546101109092529091205461010f5481106131e65750949350505050565b5f8161010f54846131f79190614ea7565b6132019190614efc565b90506101025481111561321d5750506101025495945050505050565b9695505050505050565b61322f613461565b6001600160a01b03811661325857604051631e4fbdf760e01b81525f600482015260240161159a565b61210e81613ca4565b5f61326a613546565b613272613570565b60fc546040516370a0823160e01b815233600482015284916001600160a01b0316906370a0823190602401602060405180830381865afa1580156132b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132dc9190614e90565b10156132fb5760405163356680b760e01b815260040160405180910390fd5b613303613594565b5f61330c6135e4565b90505f670de0b6b3a76400006133228387614b82565b61332c9190614bad565b905061333986858761395d565b5f6133448288613dfc565b60fc54604051638e433bc760e01b8152600481018990523360248201529192506001600160a01b031690638e433bc7906044015f604051808303815f87803b15801561338e575f80fd5b505af11580156133a0573d5f803e3d5ffd5b505060405133925084156108fc02915084905f818181858888f193505050501580156133ce573d5f803e3d5ffd5b50604080518281523360208201529081018790526060810183905287907fc2d18d1ab67a48ae80c3ef1d20c2f2a97201a23db7ca49e5de1edf05610fb0039060800160405180910390a2509150506134266001603255565b9392505050565b610106546001600160a01b0316331461345957604051630782484160e21b815260040160405180910390fd5b61236d613e73565b6096546001600160a01b0316331461236d5760405163118cdaa760e01b815233600482015260240161159a565b806101025f8282546134a09190614ea7565b90915550505f8281526101106020526040902054801561351857818111156134ee575f8381526101106020526040812080548492906134e0908490614efc565b909155505f92506135189050565b5f838152610110602090815260408083208390556101119091528120556135158183614efc565b91505b8115610ce4575f83815261010160205260408120805484929061353c908490614ea7565b9091555050505050565b60026032540361356957604051633ee5aeb560e01b815260040160405180910390fd5b6002603255565b60c85460ff161561236d5760405163d93c066560e01b815260040160405180910390fd5b6101045442905f906135a69083614efc565b90508015611a92575f6135b7613eac565b90506135c38282614b82565b6101055f8282546135d49190614ea7565b9091555050506101048290555050565b5f6101045442111561364c575f61010454426136009190614efc565b90505f8161360c613eac565b6136169190614b82565b90505f61010354426136289190614efc565b905080826101055461363a9190614ea7565b6136449190614bad565b935050505090565b6101035461365a9042614efc565b610105546118009190614bad565b6001600160a01b0382165f90815261010d6020908152604080832080548251818502810185019093528083529192909190849084015b828210156136e1578382905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250508152602001906001019061369e565b50505050905080515f03613742576001600160a01b0383165f90815261010d60209081526040808320815180830190925287825281830186815281546001818101845592865293909420915160029093029091019182559151910155611d44565b5f5b81518110156137ce578482828151811061376057613760614ae8565b60200260200101515f0151036137c6576001600160a01b0384165f90815261010d6020526040902080548491908390811061379d5761379d614ae8565b905f5260205f2090600202016001015f8282546137ba9190614ea7565b90915550505050505050565b600101613744565b50506001600160a01b03919091165f90815261010d60209081526040808320815180830190925294815280820193845284546001808201875595845291909220915160029091029091019081559051910155565b60fa546040516304512a2360e31b81525f916001600160a01b0316906322895118906801bc16d674ec80000090613868908a908a9060ff908b908b908b90600401615241565b5f604051808303818588803b15801561387f575f80fd5b505af1158015613891573d5f803e3d5ffd5b505060fd54604051630314cb0560e01b81525f94506001600160a01b039091169250630314cb0591506138d1908a908a9060ff9030908f9060040161528f565b6020604051808303815f875af11580156138ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139119190614e90565b9050877fd342ed204414e87cc9a5ba37eea0194e34bdc8a046bea5fdc36a00462499dccf828989604051613947939291906152d2565b60405180910390a2506001979650505050505050565b6001600160a01b0382165f90815261010d6020908152604080832080548251818502810185019093528083529192909190849084015b828210156139d6578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190613993565b50505050905080515f036139fd57604051633f8e3cf760e21b815260040160405180910390fd5b5f5b8151811015613ad95784828281518110613a1b57613a1b614ae8565b60200260200101515f015103613ad1576001600160a01b0384165f90815261010d60205260409020805484919083908110613a5857613a58614ae8565b905f5260205f209060020201600101541015613a8757604051633f8e3cf760e21b815260040160405180910390fd5b6001600160a01b0384165f90815261010d60205260409020805484919083908110613ab457613ab4614ae8565b905f5260205f2090600202016001015f8282546137ba9190614efc565b6001016139ff565b50604051633f8e3cf760e21b815260040160405180910390fd5b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480613b7957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316613b6d5f80516020615302833981519152546001600160a01b031690565b6001600160a01b031614155b1561236d5760405163703e46dd60e11b815260040160405180910390fd5b61210e613461565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613bf9575060408051601f3d908101601f19168201909252613bf691810190614e90565b60015b613c2157604051634c9c8ce360e01b81526001600160a01b038316600482015260240161159a565b5f805160206153028339815191528114613c5157604051632a87526960e21b81526004810182905260240161159a565b610ce48383613ebe565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461236d5760405163703e46dd60e11b815260040160405180910390fd5b609680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f82815261010160209081526040808320546101109092528220548015613d665781811115613d4a575f858152610110602052604081208054849290613d3c908490614efc565b909155505f9250613d669050565b5f8581526101106020526040812055613d638183614efc565b91505b5f848152610101602052604081208054849290613d84908490614ea7565b9091555050505f848152610101602052604081205590505b92915050565b613daa613570565b60c8805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613ddf3390565b6040516001600160a01b03909116815260200160405180910390a1565b5f80613e0783613f13565b5f8181526101016020526040902054909150848110613e49575f828152610101602052604081208054879290613e3e908490614efc565b90915550613e539050565b613e538286613f43565b846101025f828254613e659190614efc565b909155509195945050505050565b613e7b613fd1565b60c8805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33613ddf565b5f611800670de0b6b3a7640000613ff4565b613ec7826140a3565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613f0b57610ce48282614106565b611a92614178565b5f5b5f82815261010e602052604090205415613f3f575f91825261010e60205260409091205490613f15565b5090565b5f8281526101016020526040812054613f5c9083614efc565b5f8481526101106020526040902054909150613f788282614ea7565b61010f5410613fb8575f848152610110602052604081208054849290613f9f908490614ea7565b90915550505f8481526101016020526040812055611d44565b604051636264f98d60e11b815260040160405180910390fd5b60c85460ff1661236d57604051638dfc202b60e01b815260040160405180910390fd5b5f80613ffe611805565b90505f60fc5f9054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614051573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140759190614e90565b9050805f0361408657509192915050565b806140918386614b82565b61409b9190614bad565b949350505050565b806001600160a01b03163b5f036140d857604051634c9c8ce360e01b81526001600160a01b038216600482015260240161159a565b5f8051602061530283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161412291906152eb565b5f60405180830381855af49150503d805f811461415a576040519150601f19603f3d011682016040523d82523d5f602084013e61415f565b606091505b509150915061416f858383614197565b95945050505050565b341561236d5760405163b398979f60e01b815260040160405180910390fd5b6060826141ac576141a7826141f3565b613426565b81511580156141c357506001600160a01b0384163b155b156141ec57604051639996b31560e01b81526001600160a01b038516600482015260240161159a565b5080613426565b8051156142035780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f6020828403121561422c575f80fd5b5035919050565b6001600160a01b038116811461210e575f80fd5b803561425281614233565b919050565b5f60208284031215614267575f80fd5b813561342681614233565b634e487b7160e01b5f52604160045260245ffd5b60405160e081016001600160401b03811182821017156142a8576142a8614272565b60405290565b604051601f8201601f191681016001600160401b03811182821017156142d6576142d6614272565b604052919050565b5f6001600160401b038211156142f6576142f6614272565b5060051b60200190565b5f82601f83011261430f575f80fd5b8135602061432461431f836142de565b6142ae565b8083825260208201915060208460051b870101935086841115614345575f80fd5b602086015b84811015614361578035835291830191830161434a565b509695505050505050565b5f806040838503121561437d575f80fd5b82356001600160401b0380821115614393575f80fd5b61439f86838701614300565b935060208501359150808211156143b4575f80fd5b506143c185828601614300565b9150509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61342660208301846143cb565b803563ffffffff81168114614252575f80fd5b5f82601f83011261442d575f80fd5b81356001600160401b0381111561444657614446614272565b614459601f8201601f19166020016142ae565b81815284602083860101111561446d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f6060848603121561449b575f80fd5b83356001600160401b03808211156144b1575f80fd5b9085019060e082880312156144c4575f80fd5b6144cc614286565b6144d58361440b565b8152602083013560208201526040830135604082015260608301356060820152608083013582811115614506575f80fd5b6145128982860161441e565b60808301525060a083013582811115614529575f80fd5b6145358982860161441e565b60a08301525060c08301358281111561454c575f80fd5b6145588982860161441e565b60c083015250945050506020840135915061457560408501614247565b90509250925092565b5f8083601f84011261458e575f80fd5b5081356001600160401b038111156145a4575f80fd5b6020830191508360208285010111156145bb575f80fd5b9250929050565b5f805f805f608086880312156145d6575f80fd5b85356145e181614233565b945060208601356145f181614233565b93506040860135925060608601356001600160401b03811115614612575f80fd5b61461e8882890161457e565b969995985093965092949392505050565b5f805f60608486031215614641575f80fd5b833592506020808501356001600160401b038082111561465f575f80fd5b818701915087601f830112614672575f80fd5b813561468061431f826142de565b81815260059190911b8301840190848101908a83111561469e575f80fd5b938501935b828510156146c55784356146b681614233565b825293850193908501906146a3565b9650505060408701359250808311156146dc575f80fd5b50506146ea86828701614300565b9150509250925092565b5f8083601f840112614704575f80fd5b5081356001600160401b0381111561471a575f80fd5b6020830191508360208260051b85010111156145bb575f80fd5b5f805f805f8060608789031215614749575f80fd5b86356001600160401b038082111561475f575f80fd5b61476b8a838b016146f4565b90985096506020890135915080821115614783575f80fd5b61478f8a838b016146f4565b909650945060408901359150808211156147a7575f80fd5b506147b489828a016146f4565b979a9699509497509295939492505050565b5f80602083850312156147d7575f80fd5b82356001600160401b038111156147ec575f80fd5b6147f88582860161457e565b90969095509350505050565b5f805f60608486031215614816575f80fd5b8335925060208401359150604084013561482f81614233565b809150509250925092565b5f805f6060848603121561484c575f80fd5b83359250602084013561485e81614233565b929592945050506040919091013590565b5f8060408385031215614880575f80fd5b823561488b81614233565b915060208301356001600160401b038111156148a5575f80fd5b6143c18582860161441e565b5f805f606084860312156148c3575f80fd5b83356001600160401b03808211156148d9575f80fd5b6148e587838801614300565b945060208601359150808211156148fa575f80fd5b5061490786828701614300565b925050604084013590509250925092565b5f805f805f60a0868803121561492c575f80fd5b8535945060208601356001600160401b03811115614948575f80fd5b61495488828901614300565b9450506040860135925060608601359150608086013561497381614233565b809150509295509295909350565b5f8060408385031215614992575f80fd5b8235915060208301356149a481614233565b809150509250929050565b5f80604083850312156149c0575f80fd5b50508035926020909101359150565b602080825282518282018190525f919060409081850190868401855b82811015614a1857614a0884835180518252602090810151910152565b92840192908501906001016149eb565b5091979650505050505050565b5f805f805f805f60e0888a031215614a3b575f80fd5b8735614a4681614233565b96506020880135614a5681614233565b95506040880135614a6681614233565b94506060880135614a7681614233565b93506080880135614a8681614233565b925060a0880135614a9681614233565b915060c0880135614aa681614233565b8091505092959891949750929550565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061321d908301846143cb565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215614b0c575f80fd5b815161342681614233565b600181811c90821680614b2b57607f821691505b602082108103614b4957634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215614b5f575f80fd5b81518015158114613426575f80fd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417613d9c57613d9c614b6e565b634e487b7160e01b5f52601260045260245ffd5b5f82614bbb57614bbb614b99565b500490565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301525f608082015160e06080850152614c0260e08501826143cb565b905060a083015184820360a0860152614c1b82826143cb565b91505060c083015184820360c086015261416f82826143cb565b604081525f614c476040830185614bc0565b905082151560208301529392505050565b5f60408284031215614c68575f80fd5b604051604081018181106001600160401b0382111715614c8a57614c8a614272565b604052825181526020928301519281019290925250919050565b5f60408284031215614cb4575f80fd5b6134268383614c58565b608081525f614cd06080830186614bc0565b9050614ce9602083018580518252602090810151910152565b6001600160a01b03929092166060919091015292915050565b5f8082840360c0811215614d14575f80fd5b6080811215614d21575f80fd5b50604051606081016001600160401b038282108183111715614d4557614d45614272565b8160405285518352602086015191508082168214614d61575f80fd5b506020820152614d748560408601614c58565b60408201529150614d888460808501614c58565b90509250929050565b601f821115610ce457805f5260205f20601f840160051c81016020851015614db65750805b601f840160051c820191505b8181101561266d575f8155600101614dc2565b81516001600160401b03811115614dee57614dee614272565b614e0281614dfc8454614b17565b84614d91565b602080601f831160018114614e35575f8415614e1e5750858301515b5f19600386901b1c1916600185901b17855561160b565b5f85815260208120601f198616915b82811015614e6357888601518255948401946001909101908401614e44565b5085821015614e8057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215614ea0575f80fd5b5051919050565b80820180821115613d9c57613d9c614b6e565b5f808335601e19843603018112614ecf575f80fd5b8301803591506001600160401b03821115614ee8575f80fd5b6020019150368190038213156145bb575f80fd5b81810381811115613d9c57613d9c614b6e565b5f8154614f1b81614b17565b808552602060018381168015614f385760018114614f5257614f7d565b60ff1985168884015283151560051b880183019550614f7d565b865f52825f205f5b85811015614f755781548a8201860152908301908401614f5a565b890184019650505b505050505092915050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f614fc26040830186614f0f565b828103602084015261321d818587614f88565b6001600160401b03831115614fec57614fec614272565b61500083614ffa8354614b17565b83614d91565b5f601f841160018114615031575f851561501a5750838201355b5f19600387901b1c1916600186901b17835561266d565b5f83815260208120601f198716915b828110156150605786850135825560209485019460019092019101615040565b508682101561507c575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f806040838503121561509f575f80fd5b505080516020909101519092909150565b5f815180845260208085019450602084015f5b838110156150df578151875295820195908201906001016150c3565b509495945050505050565b604081525f6150fc60408301856150b0565b828103602084015261416f81856150b0565b5f8261511c5761511c614b99565b500690565b608081525f61513360808301876143cb565b82810360208401526151458187614f0f565b6001600160a01b0395909516604084015250506060015292915050565b602081525f61342660208301846150b0565b5f6020808385031215615185575f80fd5b82516001600160401b0381111561519a575f80fd5b8301601f810185136151aa575f80fd5b80516151b861431f826142de565b81815260059190911b820183019083810190878311156151d6575f80fd5b928401925b828410156151f4578351825292840192908401906151db565b979650505050505050565b838152606060208201525f61521760608301856150b0565b9050826040830152949350505050565b6001600160a01b0392831681529116602082015260400190565b608081525f61525460808301888a614f88565b82810360208401526152668188614f0f565b9050828103604084015261527b818688614f88565b915050826060830152979650505050505050565b608081525f6152a2608083018789614f88565b82810360208401526152b48187614f0f565b6001600160a01b039590951660408401525050606001529392505050565b838152604060208201525f61416f604083018486614f88565b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209495ab2db6ad49108afc2a2841ada7374033b20dc0496be159259315a6f0f53164736f6c63430008190033

Deployed Bytecode

0x608060405260043610610371575f3560e01c806379c5092b116101c8578063bc7b0d20116100fd578063dbf624891161009d578063f2fde38b1161006d578063f2fde38b14610a3b578063f5e415c714610a5a578063f93b6be514610a79578063fc03411f14610a8d575f80fd5b8063dbf62489146109ca578063e59546be146109de578063e94ad65b146109fd578063eef02d3b14610a1c575f80fd5b8063d4a47d6d116100d8578063d4a47d6d14610952578063d6a29dc514610968578063d77868da14610988578063d7791e261461099b575f80fd5b8063bc7b0d20146108e8578063bd97c75914610914578063bf9cfe6c14610933575f80fd5b80639a42e0ba11610168578063ad3cb1cc11610143578063ad3cb1cc14610865578063b187bd2614610895578063b36e2cce146108a9578063b3ee9d6b146108c8575f80fd5b80639a42e0ba146108085780639f575f0f14610827578063a6a0ac9614610846575f80fd5b80638628974b116101a35780638628974b1461078e5780638da5cb5b146107ad5780638e691b9a146107ca5780639a3cac6a146107e9575f80fd5b806379c5092b1461072d5780637d75de5514610759578063852cb9b814610778575f80fd5b80633d6a3844116102a957806352d1902d116102495780636eb604e0116102195780636eb604e0146106c75780636ecc20da146106da578063715018a6146106ed57806374ee7f8614610701575f80fd5b806352d1902d14610652578063545f8860146106665780635c975abb146106855780635d20c6be146106a8575f80fd5b8063420d1e5011610284578063420d1e50146105eb5780634277f6931461060b57806345dcb6391461061f5780634f1ef2861461063f575f80fd5b80633d6a3844146105675780633eca72131461059f5780634162169f146105cb575f80fd5b8063193615fe1161031457806337a203c8116102ef57806337a203c8146104e957806339007890146105085780633a548da1146105345780633ca967f314610553575f80fd5b8063193615fe1461047f5780632f7486f11461049e5780632fa2a2cc146104ca575f80fd5b806312ebdab41161034f57806312ebdab4146103f4578063142bd10014610415578063150b7a021461042857806315cf1a8f14610460575f80fd5b806303665fd514610375578063058d04ab146103b45780630d020de2146103d5575b5f80fd5b348015610380575f80fd5b506103a161038f36600461421c565b5f90815261010b602052604090205490565b6040519081526020015b60405180910390f35b3480156103bf575f80fd5b506103d36103ce366004614257565b610aac565b005b3480156103e0575f80fd5b506103d36103ef36600461436c565b610b31565b3480156103ff575f80fd5b50610408610ce9565b6040516103ab91906143f9565b6103d3610423366004614489565b610d75565b348015610433575f80fd5b506104476104423660046145c2565b61108d565b6040516001600160e01b031990911681526020016103ab565b34801561046b575f80fd5b506103d361047a36600461462f565b611184565b34801561048a575f80fd5b506103d3610499366004614734565b61133d565b3480156104a9575f80fd5b506103a16104b836600461421c565b6101116020525f908152604090205481565b3480156104d5575f80fd5b506103d36104e43660046147c6565b611613565b3480156104f4575f80fd5b506103d3610503366004614804565b611688565b348015610513575f80fd5b506103a161052236600461421c565b61010b6020525f908152604090205481565b34801561053f575f80fd5b506103d361054e36600461483a565b6117c0565b34801561055e575f80fd5b506103a16117f7565b348015610572575f80fd5b5061010754610587906001600160a01b031681565b6040516001600160a01b0390911681526020016103ab565b3480156105aa575f80fd5b506103a16105b936600461421c565b6101106020525f908152604090205481565b3480156105d6575f80fd5b5061010654610587906001600160a01b031681565b3480156105f6575f80fd5b5061011254610587906001600160a01b031681565b348015610616575f80fd5b506103a1611805565b34801561062a575f80fd5b5061010a54610587906001600160a01b031681565b6103d361064d36600461486f565b611a77565b34801561065d575f80fd5b506103a1611a96565b348015610671575f80fd5b506103d36106803660046148b1565b611ab1565b348015610690575f80fd5b5060c85460ff165b60405190151581526020016103ab565b3480156106b3575f80fd5b506103d36106c236600461436c565b611d4a565b6103d36106d536600461421c565b611f2a565b6103d36106e836600461421c565b612111565b3480156106f8575f80fd5b506103d361235c565b34801561070c575f80fd5b506103a161071b36600461421c565b6101016020525f908152604090205481565b348015610738575f80fd5b506103a161074736600461421c565b61010e6020525f908152604090205481565b348015610764575f80fd5b506103d3610773366004614918565b61236f565b348015610783575f80fd5b506103a16101005481565b348015610799575f80fd5b506103d36107a836600461436c565b612674565b3480156107b8575f80fd5b506096546001600160a01b0316610587565b3480156107d5575f80fd5b506103d36107e436600461421c565b612873565b3480156107f4575f80fd5b506103d3610803366004614257565b612905565b348015610813575f80fd5b5060fb54610587906001600160a01b031681565b348015610832575f80fd5b506103d3610841366004614981565b61299f565b348015610851575f80fd5b5060fe54610587906001600160a01b031681565b348015610870575f80fd5b50610408604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156108a0575f80fd5b50610698612a28565b3480156108b4575f80fd5b506103d36108c33660046149af565b612a35565b3480156108d3575f80fd5b5061010854610587906001600160a01b031681565b3480156108f3575f80fd5b50610907610902366004614257565b612bad565b6040516103ab91906149cf565b34801561091f575f80fd5b5060fc54610587906001600160a01b031681565b34801561093e575f80fd5b506103d361094d366004614a25565b612c33565b34801561095d575f80fd5b506103a161010f5481565b348015610973575f80fd5b5061010954610587906001600160a01b031681565b6103d361099636600461421c565b612f6b565b3480156109a6575f80fd5b506109ba6109b536600461421c565b612f9b565b6040516103ab9493929190614ab6565b3480156109d5575f80fd5b506103d3613058565b3480156109e9575f80fd5b506103d36109f836600461421c565b61308c565b348015610a08575f80fd5b5060fa54610587906001600160a01b031681565b348015610a27575f80fd5b506103a1610a3636600461421c565b613125565b348015610a46575f80fd5b506103d3610a55366004614257565b613227565b348015610a65575f80fd5b506103a1610a74366004614804565b613261565b348015610a84575f80fd5b506103d361342d565b348015610a98575f80fd5b5060fd54610587906001600160a01b031681565b610ab4613461565b6001600160a01b038116610adb57604051630309cb8760e51b815260040160405180910390fd5b61011280546001600160a01b0319166001600160a01b0383169081179091556040519081527f9df74405fa198cdaf5a912a179ded609cb3ae1669bb41a8523a4ee7643ebb7c0906020015b60405180910390a150565b610108546001600160a01b03163314610b5d57604051630782484160e21b815260040160405180910390fd5b8051825114610b7f57604051630309cb8760e51b815260040160405180910390fd5b5f5b8251811015610ce4575f838281518110610b9d57610b9d614ae8565b602002602001015190505f838381518110610bba57610bba614ae8565b60200260200101519050805f03610bd2575050610cdc565b60fb546040516322e44d7f60e21b8152600481018490525f916001600160a01b031690638b9135fc90602401602060405180830381865afa158015610c19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c3d9190614afc565b60405163396ccab160e11b8152600481018490529091506001600160a01b038216906372d99562906024015f604051808303815f87803b158015610c7f575f80fd5b505af1158015610c91573d5f803e3d5ffd5b50505050610c9f838361348e565b60408051848152602081018490527f933f5d3652cfb50d9224df3ff1b228450d2917a80b7338cc68a309f5b20c38f6910160405180910390a15050505b600101610b81565b505050565b60ff8054610cf690614b17565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2290614b17565b8015610d6d5780601f10610d4457610100808354040283529160200191610d6d565b820191905f5260205f20905b815481529060010190602001808311610d5057829003601f168201915b505050505081565b610d7d613546565b610d85613570565b64e8d4a51000341015610dab5760405163162908e360e11b815260040160405180910390fd5b60fb5460405163f2eeb33760e01b8152600481018490526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015610df2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e169190614b4f565b610e335760405163dc0ca7f360e01b815260040160405180910390fd5b610e3b613594565b5f610e446135e4565b90505f81610e5a34670de0b6b3a7640000614b82565b610e649190614bad565b60fc546040516319157fab60e21b8152600481018390523060248201529192506001600160a01b031690636455feac906044015f604051808303815f87803b158015610eae575f80fd5b505af1158015610ec0573d5f803e3d5ffd5b50505050610ece848261348e565b610ed9848483613668565b60fc546101125460405163095ea7b360e01b81526001600160a01b0391821660048201526024810184905291169063095ea7b3906044016020604051808303815f875af1158015610f2c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f509190614b4f565b5061011254604051633b6f743b60e01b81525f916001600160a01b031690633b6f743b90610f849089908590600401614c35565b6040805180830381865afa158015610f9e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc29190614ca4565b6101125460405163c7c7f5b360e01b81529192506001600160a01b03169063c7c7f5b390610ff890899085908990600401614cbe565b60c0604051808303815f875af1158015611014573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110389190614d02565b505060408051348152602081018490526001600160a01b0386169187917f1cae59a31c3c6760aa08cb9c351432553e908b8e6f53e7c9ac22715c7d496179910160405180910390a3505050610ce46001603255565b5f6040518060800160405280876001600160a01b03168152602001866001600160a01b0316815260200185815260200184848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525093909452505086815261010c6020908152604091829020845181546001600160a01b03199081166001600160a01b0392831617835592860151600183018054909416911617909155908301516002820155606083015190915060038201906111569082614dd5565b507f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f98975050505050505050565b61118c613546565b611194613570565b610108546001600160a01b031633146111c057604051630782484160e21b815260040160405180910390fd5b80518251146111e257604051630309cb8760e51b815260040160405180910390fd5b5f83815261011060205260409020541561120f57604051631cb9e82d60e01b815260040160405180910390fd5b60fb546040516322e44d7f60e21b8152600481018590525f916001600160a01b031690638b9135fc90602401602060405180830381865afa158015611256573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061127a9190614afc565b90505f5b835181101561133157816001600160a01b031663b7760c8f8483815181106112a8576112a8614ae8565b60200260200101518684815181106112c2576112c2614ae8565b60200260200101516040518363ffffffff1660e01b81526004016112f99291909182526001600160a01b0316602082015260400190565b5f604051808303815f87803b158015611310575f80fd5b505af1158015611322573d5f803e3d5ffd5b5050505080600101905061127e565b5050610ce46001603255565b611345613546565b61134d613570565b848314158061135c5750848114155b1561137a57604051630309cb8760e51b815260040160405180910390fd5b60fb546040516308f5c9ff60e41b81523360048201525f916001600160a01b031690638f5c9ff090602401602060405180830381865afa1580156113c0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113e49190614e90565b9050805f036114065760405163dc0ca7f360e01b815260040160405180910390fd5b5f81815261010b60209081526040808320546101019092529091205487916801bc16d674ec800000916114399190614ea7565b6114439190614bad565b10156114625760405163356680b760e01b815260040160405180910390fd5b5f805b878110156114ef575f6114d8848b8b8581811061148457611484614ae8565b90506020028101906114969190614eba565b8b8b878181106114a8576114a8614ae8565b90506020028101906114ba9190614eba565b8b8b898181106114cc576114cc614ae8565b90506020020135613822565b90506114e48184614ea7565b925050600101611465565b505f611504886801bc16d674ec800000614b82565b90505f61151a836801bc16d674ec800000614b82565b90505f6115278284614efc565b9050806101015f8781526020019081526020015f205f82825461154a9190614efc565b92505081905550806101025f8282546115639190614efc565b90915550505f85815261010b602052604081208054849290611586908490614efc565b90915550505f8590526101016020526115a3565b60405180910390fd5b60fe546040516308e34ead60e41b8152600481018390526001600160a01b0390911690638e34ead0906024015f604051808303815f87803b1580156115e6575f80fd5b505af11580156115f8573d5f803e3d5ffd5b50505050505050505061160b6001603255565b505050505050565b610106546001600160a01b0316331461163f57604051630782484160e21b815260040160405180910390fd5b7f3af3c6f7639df17de134ac1099e1e1d389efdc16cda06cbfbc76142258d5d2fd60ff838360405161167393929190614fb0565b60405180910390a160ff610ce4828483614fd5565b61010a546001600160a01b031633146116b457604051630782484160e21b815260040160405180910390fd5b5f83815261010b6020526040812080546801bc16d674ec80000092906116db908490614efc565b90915550506040516001600160a01b038216905f906801bc16d674ec8000009082818181858883f19350505050158015611717573d5f803e3d5ffd5b50604080516001600160a01b03831681526801bc16d674ec80000060208201527fe6d858f14d755446648a6e0c8ab8b5a0f58ccc7920d4c910b0454e4dcd869af0910160405180910390a160fd5460405163c2c3a60d60e01b8152600481018490526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b1580156117a5575f80fd5b505af11580156117b7573d5f803e3d5ffd5b50505050505050565b61010a546001600160a01b031633146117ec57604051630782484160e21b815260040160405180910390fd5b610ce483838361395d565b5f6118006135e4565b905090565b61010a546040805163fdc88efd60e01b815290515f926001600160a01b03169163fdc88efd9160048083019260209291908290030181865afa15801561184d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118719190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b031663acfc654b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118e59190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b03166367fe13056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611935573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119599190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b0316630fd520f66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119a9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119cd9190614e90565b60fe5f9054906101000a90046001600160a01b03166001600160a01b031663f0b73e116040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a419190614e90565b61010254611a4f9190614ea7565b611a599190614ea7565b611a639190614ea7565b611a6d9190614efc565b6118009190614efc565b611a7f613af3565b611a8882613b97565b611a928282613b9f565b5050565b5f611a9f613c5b565b505f8051602061530283398151915290565b610108546001600160a01b03163314611add57604051630782484160e21b815260040160405180910390fd5b8151835114611aff57604051630309cb8760e51b815260040160405180910390fd5b6101095460405163396ccab160e11b8152600481018390526001600160a01b03909116906372d99562906024015f604051808303815f87803b158015611b43575f80fd5b505af1158015611b55573d5f803e3d5ffd5b505050505f805b8451811015611d23575f858281518110611b7857611b78614ae8565b602002602001015190505f858381518110611b9557611b95614ae8565b60200260200101519050805f03611bad575050611d1b565b611bb78185614ea7565b61010a546040516399405f3360e01b8152600481018590529195505f9182916001600160a01b0316906399405f33906024016040805180830381865afa158015611c03573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c27919061508e565b909250905081811015611ccc575f82611c408584614ea7565b10611c6257611c4f8284614efc565b9050611c5b8185614efc565b9350611c66565b505f925b61010a5460405163d3d2b2cb60e01b815260048101879052602481018390526001600160a01b039091169063d3d2b2cb9083906044015f604051808303818588803b158015611cb3575f80fd5b505af1158015611cc5573d5f803e3d5ffd5b5050505050505b8215611d1657611cdc848461348e565b60408051858152602081018590527f7e0fd5b648afd09ad3f3913bdf766931ac752a7ac7c392b7713362379923b0fe910160405180910390a15b505050505b600101611b5c565b50808214611d4457604051630309cb8760e51b815260040160405180910390fd5b50505050565b610108546001600160a01b03163314611d7657604051630782484160e21b815260040160405180910390fd5b8051825114611d83575f80fd5b60fd546040516333bf834560e11b81526001600160a01b039091169063677f068a90611db590859085906004016150ea565b5f604051808303815f87803b158015611dcc575f80fd5b505af1158015611dde573d5f803e3d5ffd5b505050505f5b8251811015611eec575f838281518110611e0057611e00614ae8565b602090810291909101015160fd546040516331a9108f60e11b81526004810183905291925030916001600160a01b0390911690636352211e90602401602060405180830381865afa158015611e57573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e7b9190614afc565b6001600160a01b031603611ee35760fd5460405163c2c3a60d60e01b8152600481018390526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b158015611ecc575f80fd5b505af1158015611ede573d5f803e3d5ffd5b505050505b50600101611de4565b507f20bcb7d77186ac511956250f550408a100cc464af62c11e5b60c40aa3ec9c42e8282604051611f1e9291906150ea565b60405180910390a15050565b611f32613546565b611f3a613570565b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015611f81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611fa59190614b4f565b611fc25760405163dc0ca7f360e01b815260040160405180910390fd5b341580611fe05750611fdd6801bc16d674ec8000003461510e565b15155b15611ffe5760405163162908e360e11b815260040160405180910390fd5b5f6120126801bc16d674ec80000034614bad565b90505f5b818110156120a85760fd54604080516020810182525f81529051630314cb0560e01b81526001600160a01b0390921691630314cb059161205f9160ff9033908990600401615121565b6020604051808303815f875af115801561207b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061209f9190614e90565b50600101612016565b505f82815261010b6020526040812080543492906120c7908490614ea7565b9091555050604051818152339083907f7acd64380f0b80d169f87cad8295b93ee2889c7f5c8f861bee0d1e4edb657afb9060200160405180910390a35061210e6001603255565b50565b612119613546565b612121613570565b64e8d4a510003410156121475760405163162908e360e11b815260040160405180910390fd5b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa15801561218e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121b29190614b4f565b6121cf5760405163dc0ca7f360e01b815260040160405180910390fd5b610100545f9034901561226b5761271061010054346121ee9190614b82565b6121f89190614bad565b91506122048234614efc565b610107549091506001600160a01b0316612231576040516338d2305b60e21b815260040160405180910390fd5b610107546040516001600160a01b039091169083156108fc029084905f818181858888f19350505050158015612269573d5f803e3d5ffd5b505b612273613594565b5f61227c6135e4565b90505f8161229284670de0b6b3a7640000614b82565b61229c9190614bad565b60fc546040516319157fab60e21b8152600481018390523360248201529192506001600160a01b031690636455feac906044015f604051808303815f87803b1580156122e6575f80fd5b505af11580156122f8573d5f803e3d5ffd5b50505050612306858461348e565b612311853383613668565b6040805134815260208101839052339187917f1cae59a31c3c6760aa08cb9c351432553e908b8e6f53e7c9ac22715c7d496179910160405180910390a35050505061210e6001603255565b612364613461565b61236d5f613ca4565b565b612377613546565b61237f613570565b610108546001600160a01b031633146123ab57604051630782484160e21b815260040160405180910390fd5b835115806123b857504382115b156123d657604051630309cb8760e51b815260040160405180910390fd5b60fd546040516379ff5d1d60e01b81525f916001600160a01b0316906379ff5d1d90612406908890600401615162565b5f60405180830381865afa158015612420573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526124479190810190615174565b90505f5b8551811015612559575f86828151811061246757612467614ae8565b6020026020010151905082828151811061248357612483614ae8565b60200260200101515f146124ef5760fd5460405163c2c3a60d60e01b8152600481018390526001600160a01b039091169063c2c3a60d906024015f604051808303815f87803b1580156124d4575f80fd5b505af11580156124e6573d5f803e3d5ffd5b50505050612550565b60fd54604051632e92d33560e21b815260048101839052602481018790526001600160a01b039091169063ba4b4cd4906044015f604051808303815f87803b158015612539575f80fd5b505af115801561254b573d5f803e3d5ffd5b505050505b5060010161244b565b5060fb546040516322e44d7f60e21b8152600481018890525f916001600160a01b031690638b9135fc90602401602060405180830381865afa1580156125a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125c59190614afc565b60405163b7760c8f60e01b8152600481018790526001600160a01b0385811660248301529192509082169063b7760c8f906044015f604051808303815f87803b158015612610575f80fd5b505af1158015612622573d5f803e3d5ffd5b505050507fe1419955066833fcc44409a448a939482f4bdc3af35be67c59740ea729ff4a0b878787604051612659939291906151ff565b60405180910390a1505061266d6001603255565b5050505050565b61267c613546565b612684613570565b610108546001600160a01b031633146126b057604051630782484160e21b815260040160405180910390fd5b805182511415806126c057508051155b156126de57604051630309cb8760e51b815260040160405180910390fd5b5f5b8251811015612868575f8382815181106126fc576126fc614ae8565b602090810291909101015160fb546040516322e44d7f60e21b8152600481018390529192505f916001600160a01b0390911690638b9135fc90602401602060405180830381865afa158015612753573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127779190614afc565b9050806001600160a01b031663b7760c8f85858151811061279a5761279a614ae8565b60209081029190910101516101075460405160e084901b6001600160e01b031916815260048101929092526001600160a01b031660248201526044015f604051808303815f87803b1580156127ed575f80fd5b505af11580156127ff573d5f803e3d5ffd5b505050507fd015384993a63fbb67be31c3c4491e03f64fa52369a08927fe6d4cba14286f218285858151811061283757612837614ae8565b6020026020010151604051612856929190918252602082015260400190565b60405180910390a150506001016126e0565b50611a926001603255565b610106546001600160a01b0316331461289f57604051630782484160e21b815260040160405180910390fd5b6103e88111156128c257604051630309cb8760e51b815260040160405180910390fd5b6101005460408051918252602082018390527f90e50637c808ab8723fa9e2137e8972173099a6773142dcf42f0a394f7cef34d910160405180910390a161010055565b61290d613461565b6001600160a01b03811661293457604051630309cb8760e51b815260040160405180910390fd5b610106546040517fd5b3b0e6e0098a82fa04cf04faff9109f98389a10c80f20eb7186b927416894691612974916001600160a01b03909116908490615227565b60405180910390a161010680546001600160a01b0319166001600160a01b0392909216919091179055565b61010a546001600160a01b031633146129cb57604051630782484160e21b815260040160405180910390fd5b60fc54604051638e433bc760e01b8152600481018490526001600160a01b03838116602483015290911690638e433bc7906044015f604051808303815f87803b158015612a16575f80fd5b505af115801561160b573d5f803e3d5ffd5b5f61180060c85460ff1690565b612a3d613461565b60fb5460405163f2eeb33760e01b8152600481018390526001600160a01b039091169063f2eeb33790602401602060405180830381865afa158015612a84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612aa89190614b4f565b612ac55760405163dc0ca7f360e01b815260040160405180910390fd5b60fb54604051633b781aad60e01b8152600481018490526001600160a01b0390911690633b781aad90602401602060405180830381865afa158015612b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b309190614b4f565b612b4d57604051631c2c851b60e31b815260040160405180910390fd5b5f612b588383613cf5565b5f84815261010e6020908152604091829020859055815185815290810183905291925084917f2fb596e064755189ea64f65d467239f889fbc89a0cc5f7c4ac32cea82547919b910160405180910390a2505050565b6001600160a01b0381165f90815261010d60209081526040808320805482518185028101850190935280835260609492939192909184015b82821015612c28578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190612be5565b505050509050919050565b612c3b613461565b6001600160a01b03871615612caf57610107546040517f74f93434acf49508438eb6f219ca22e7e1818b620ccb7acd411c8f520b27b64291612c8a916001600160a01b03909116908a90615227565b60405180910390a161010780546001600160a01b0319166001600160a01b0389161790555b6001600160a01b03861615612d215760fb546040517f2aa578b9d95064e7e90ca0af5e42ca5499f5e90bd32c4e401df52a686ac6993d91612cfd916001600160a01b03909116908990615227565b60405180910390a160fb80546001600160a01b0319166001600160a01b0388161790555b6001600160a01b03851615612d935760fe546040517fe99905f924cb6eb922bbd9ce3ee596b55f73aea6fc2e7b4151fa502a38f1157f91612d6f916001600160a01b03909116908890615227565b60405180910390a160fe80546001600160a01b0319166001600160a01b0387161790555b6001600160a01b03841615612e075761010a546040517fb3b3e321ffd1930a33d425b4d1453792a16fca40d763a14c9fc90005360d059891612de2916001600160a01b03909116908790615227565b60405180910390a161010a80546001600160a01b0319166001600160a01b0386161790555b6001600160a01b03831615612e7b57610108546040517f136260758ef216be6f30b5244361f089faf99890f23864c0a63e2d2def24963f91612e56916001600160a01b03909116908690615227565b60405180910390a161010880546001600160a01b0319166001600160a01b0385161790555b6001600160a01b03821615612eef57610109546040517f955eb996feefc76589abe69cb5c8a3dfdf8cfa4fa9cec1611c9c3e61de5f55bf91612eca916001600160a01b03909116908590615227565b60405180910390a161010980546001600160a01b0319166001600160a01b0384161790555b6001600160a01b038116156117b75760fa546040517f24ed34a18e6e66e495b19120172d087ab55c30822e4989848bd265c3caa6de9a91612f3d916001600160a01b03909116908490615227565b60405180910390a160fa80546001600160a01b0383166001600160a01b031990911617905550505050505050565b6040518181527f128bc67045828b9e917cda6b9717921b174e8e2d1f135074c8d45e41d4e69ec690602001610b26565b61010c6020525f908152604090208054600182015460028301546003840180546001600160a01b039485169594909316939192612fd790614b17565b80601f016020809104026020016040519081016040528092919081815260200182805461300390614b17565b801561304e5780601f106130255761010080835404028352916020019161304e565b820191905f5260205f20905b81548152906001019060200180831161303157829003601f168201915b5050505050905084565b610106546001600160a01b0316331461308457604051630782484160e21b815260040160405180910390fd5b61236d613da2565b610106546001600160a01b031633146130b857604051630782484160e21b815260040160405180910390fd5b683635c9adc5dea000008111156130e257604051630309cb8760e51b815260040160405180910390fd5b61010f5460408051918252602082018390527fe4ef8288470b9f1af2ad6df80093b6a682f279693121712af0247f814f2f31a4910160405180910390a161010f55565b60fb54604051634b08ea7160e11b8152600481018390525f91839183916001600160a01b031690639611d4e290602401602060405180830381865afa158015613170573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131949190614b4f565b905080156131b7575f84815261010e602052604090205480156131b5578092505b505b5f82815261010160209081526040808320546101109092529091205461010f5481106131e65750949350505050565b5f8161010f54846131f79190614ea7565b6132019190614efc565b90506101025481111561321d5750506101025495945050505050565b9695505050505050565b61322f613461565b6001600160a01b03811661325857604051631e4fbdf760e01b81525f600482015260240161159a565b61210e81613ca4565b5f61326a613546565b613272613570565b60fc546040516370a0823160e01b815233600482015284916001600160a01b0316906370a0823190602401602060405180830381865afa1580156132b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132dc9190614e90565b10156132fb5760405163356680b760e01b815260040160405180910390fd5b613303613594565b5f61330c6135e4565b90505f670de0b6b3a76400006133228387614b82565b61332c9190614bad565b905061333986858761395d565b5f6133448288613dfc565b60fc54604051638e433bc760e01b8152600481018990523360248201529192506001600160a01b031690638e433bc7906044015f604051808303815f87803b15801561338e575f80fd5b505af11580156133a0573d5f803e3d5ffd5b505060405133925084156108fc02915084905f818181858888f193505050501580156133ce573d5f803e3d5ffd5b50604080518281523360208201529081018790526060810183905287907fc2d18d1ab67a48ae80c3ef1d20c2f2a97201a23db7ca49e5de1edf05610fb0039060800160405180910390a2509150506134266001603255565b9392505050565b610106546001600160a01b0316331461345957604051630782484160e21b815260040160405180910390fd5b61236d613e73565b6096546001600160a01b0316331461236d5760405163118cdaa760e01b815233600482015260240161159a565b806101025f8282546134a09190614ea7565b90915550505f8281526101106020526040902054801561351857818111156134ee575f8381526101106020526040812080548492906134e0908490614efc565b909155505f92506135189050565b5f838152610110602090815260408083208390556101119091528120556135158183614efc565b91505b8115610ce4575f83815261010160205260408120805484929061353c908490614ea7565b9091555050505050565b60026032540361356957604051633ee5aeb560e01b815260040160405180910390fd5b6002603255565b60c85460ff161561236d5760405163d93c066560e01b815260040160405180910390fd5b6101045442905f906135a69083614efc565b90508015611a92575f6135b7613eac565b90506135c38282614b82565b6101055f8282546135d49190614ea7565b9091555050506101048290555050565b5f6101045442111561364c575f61010454426136009190614efc565b90505f8161360c613eac565b6136169190614b82565b90505f61010354426136289190614efc565b905080826101055461363a9190614ea7565b6136449190614bad565b935050505090565b6101035461365a9042614efc565b610105546118009190614bad565b6001600160a01b0382165f90815261010d6020908152604080832080548251818502810185019093528083529192909190849084015b828210156136e1578382905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250508152602001906001019061369e565b50505050905080515f03613742576001600160a01b0383165f90815261010d60209081526040808320815180830190925287825281830186815281546001818101845592865293909420915160029093029091019182559151910155611d44565b5f5b81518110156137ce578482828151811061376057613760614ae8565b60200260200101515f0151036137c6576001600160a01b0384165f90815261010d6020526040902080548491908390811061379d5761379d614ae8565b905f5260205f2090600202016001015f8282546137ba9190614ea7565b90915550505050505050565b600101613744565b50506001600160a01b03919091165f90815261010d60209081526040808320815180830190925294815280820193845284546001808201875595845291909220915160029091029091019081559051910155565b60fa546040516304512a2360e31b81525f916001600160a01b0316906322895118906801bc16d674ec80000090613868908a908a9060ff908b908b908b90600401615241565b5f604051808303818588803b15801561387f575f80fd5b505af1158015613891573d5f803e3d5ffd5b505060fd54604051630314cb0560e01b81525f94506001600160a01b039091169250630314cb0591506138d1908a908a9060ff9030908f9060040161528f565b6020604051808303815f875af11580156138ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139119190614e90565b9050877fd342ed204414e87cc9a5ba37eea0194e34bdc8a046bea5fdc36a00462499dccf828989604051613947939291906152d2565b60405180910390a2506001979650505050505050565b6001600160a01b0382165f90815261010d6020908152604080832080548251818502810185019093528083529192909190849084015b828210156139d6578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190613993565b50505050905080515f036139fd57604051633f8e3cf760e21b815260040160405180910390fd5b5f5b8151811015613ad95784828281518110613a1b57613a1b614ae8565b60200260200101515f015103613ad1576001600160a01b0384165f90815261010d60205260409020805484919083908110613a5857613a58614ae8565b905f5260205f209060020201600101541015613a8757604051633f8e3cf760e21b815260040160405180910390fd5b6001600160a01b0384165f90815261010d60205260409020805484919083908110613ab457613ab4614ae8565b905f5260205f2090600202016001015f8282546137ba9190614efc565b6001016139ff565b50604051633f8e3cf760e21b815260040160405180910390fd5b306001600160a01b037f000000000000000000000000f00fff22a7ca039edcc0b8d32764accb5dd5cd08161480613b7957507f000000000000000000000000f00fff22a7ca039edcc0b8d32764accb5dd5cd086001600160a01b0316613b6d5f80516020615302833981519152546001600160a01b031690565b6001600160a01b031614155b1561236d5760405163703e46dd60e11b815260040160405180910390fd5b61210e613461565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613bf9575060408051601f3d908101601f19168201909252613bf691810190614e90565b60015b613c2157604051634c9c8ce360e01b81526001600160a01b038316600482015260240161159a565b5f805160206153028339815191528114613c5157604051632a87526960e21b81526004810182905260240161159a565b610ce48383613ebe565b306001600160a01b037f000000000000000000000000f00fff22a7ca039edcc0b8d32764accb5dd5cd08161461236d5760405163703e46dd60e11b815260040160405180910390fd5b609680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f82815261010160209081526040808320546101109092528220548015613d665781811115613d4a575f858152610110602052604081208054849290613d3c908490614efc565b909155505f9250613d669050565b5f8581526101106020526040812055613d638183614efc565b91505b5f848152610101602052604081208054849290613d84908490614ea7565b9091555050505f848152610101602052604081205590505b92915050565b613daa613570565b60c8805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613ddf3390565b6040516001600160a01b03909116815260200160405180910390a1565b5f80613e0783613f13565b5f8181526101016020526040902054909150848110613e49575f828152610101602052604081208054879290613e3e908490614efc565b90915550613e539050565b613e538286613f43565b846101025f828254613e659190614efc565b909155509195945050505050565b613e7b613fd1565b60c8805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33613ddf565b5f611800670de0b6b3a7640000613ff4565b613ec7826140a3565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613f0b57610ce48282614106565b611a92614178565b5f5b5f82815261010e602052604090205415613f3f575f91825261010e60205260409091205490613f15565b5090565b5f8281526101016020526040812054613f5c9083614efc565b5f8481526101106020526040902054909150613f788282614ea7565b61010f5410613fb8575f848152610110602052604081208054849290613f9f908490614ea7565b90915550505f8481526101016020526040812055611d44565b604051636264f98d60e11b815260040160405180910390fd5b60c85460ff1661236d57604051638dfc202b60e01b815260040160405180910390fd5b5f80613ffe611805565b90505f60fc5f9054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015614051573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140759190614e90565b9050805f0361408657509192915050565b806140918386614b82565b61409b9190614bad565b949350505050565b806001600160a01b03163b5f036140d857604051634c9c8ce360e01b81526001600160a01b038216600482015260240161159a565b5f8051602061530283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161412291906152eb565b5f60405180830381855af49150503d805f811461415a576040519150601f19603f3d011682016040523d82523d5f602084013e61415f565b606091505b509150915061416f858383614197565b95945050505050565b341561236d5760405163b398979f60e01b815260040160405180910390fd5b6060826141ac576141a7826141f3565b613426565b81511580156141c357506001600160a01b0384163b155b156141ec57604051639996b31560e01b81526001600160a01b038516600482015260240161159a565b5080613426565b8051156142035780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f6020828403121561422c575f80fd5b5035919050565b6001600160a01b038116811461210e575f80fd5b803561425281614233565b919050565b5f60208284031215614267575f80fd5b813561342681614233565b634e487b7160e01b5f52604160045260245ffd5b60405160e081016001600160401b03811182821017156142a8576142a8614272565b60405290565b604051601f8201601f191681016001600160401b03811182821017156142d6576142d6614272565b604052919050565b5f6001600160401b038211156142f6576142f6614272565b5060051b60200190565b5f82601f83011261430f575f80fd5b8135602061432461431f836142de565b6142ae565b8083825260208201915060208460051b870101935086841115614345575f80fd5b602086015b84811015614361578035835291830191830161434a565b509695505050505050565b5f806040838503121561437d575f80fd5b82356001600160401b0380821115614393575f80fd5b61439f86838701614300565b935060208501359150808211156143b4575f80fd5b506143c185828601614300565b9150509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61342660208301846143cb565b803563ffffffff81168114614252575f80fd5b5f82601f83011261442d575f80fd5b81356001600160401b0381111561444657614446614272565b614459601f8201601f19166020016142ae565b81815284602083860101111561446d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f6060848603121561449b575f80fd5b83356001600160401b03808211156144b1575f80fd5b9085019060e082880312156144c4575f80fd5b6144cc614286565b6144d58361440b565b8152602083013560208201526040830135604082015260608301356060820152608083013582811115614506575f80fd5b6145128982860161441e565b60808301525060a083013582811115614529575f80fd5b6145358982860161441e565b60a08301525060c08301358281111561454c575f80fd5b6145588982860161441e565b60c083015250945050506020840135915061457560408501614247565b90509250925092565b5f8083601f84011261458e575f80fd5b5081356001600160401b038111156145a4575f80fd5b6020830191508360208285010111156145bb575f80fd5b9250929050565b5f805f805f608086880312156145d6575f80fd5b85356145e181614233565b945060208601356145f181614233565b93506040860135925060608601356001600160401b03811115614612575f80fd5b61461e8882890161457e565b969995985093965092949392505050565b5f805f60608486031215614641575f80fd5b833592506020808501356001600160401b038082111561465f575f80fd5b818701915087601f830112614672575f80fd5b813561468061431f826142de565b81815260059190911b8301840190848101908a83111561469e575f80fd5b938501935b828510156146c55784356146b681614233565b825293850193908501906146a3565b9650505060408701359250808311156146dc575f80fd5b50506146ea86828701614300565b9150509250925092565b5f8083601f840112614704575f80fd5b5081356001600160401b0381111561471a575f80fd5b6020830191508360208260051b85010111156145bb575f80fd5b5f805f805f8060608789031215614749575f80fd5b86356001600160401b038082111561475f575f80fd5b61476b8a838b016146f4565b90985096506020890135915080821115614783575f80fd5b61478f8a838b016146f4565b909650945060408901359150808211156147a7575f80fd5b506147b489828a016146f4565b979a9699509497509295939492505050565b5f80602083850312156147d7575f80fd5b82356001600160401b038111156147ec575f80fd5b6147f88582860161457e565b90969095509350505050565b5f805f60608486031215614816575f80fd5b8335925060208401359150604084013561482f81614233565b809150509250925092565b5f805f6060848603121561484c575f80fd5b83359250602084013561485e81614233565b929592945050506040919091013590565b5f8060408385031215614880575f80fd5b823561488b81614233565b915060208301356001600160401b038111156148a5575f80fd5b6143c18582860161441e565b5f805f606084860312156148c3575f80fd5b83356001600160401b03808211156148d9575f80fd5b6148e587838801614300565b945060208601359150808211156148fa575f80fd5b5061490786828701614300565b925050604084013590509250925092565b5f805f805f60a0868803121561492c575f80fd5b8535945060208601356001600160401b03811115614948575f80fd5b61495488828901614300565b9450506040860135925060608601359150608086013561497381614233565b809150509295509295909350565b5f8060408385031215614992575f80fd5b8235915060208301356149a481614233565b809150509250929050565b5f80604083850312156149c0575f80fd5b50508035926020909101359150565b602080825282518282018190525f919060409081850190868401855b82811015614a1857614a0884835180518252602090810151910152565b92840192908501906001016149eb565b5091979650505050505050565b5f805f805f805f60e0888a031215614a3b575f80fd5b8735614a4681614233565b96506020880135614a5681614233565b95506040880135614a6681614233565b94506060880135614a7681614233565b93506080880135614a8681614233565b925060a0880135614a9681614233565b915060c0880135614aa681614233565b8091505092959891949750929550565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061321d908301846143cb565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215614b0c575f80fd5b815161342681614233565b600181811c90821680614b2b57607f821691505b602082108103614b4957634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215614b5f575f80fd5b81518015158114613426575f80fd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417613d9c57613d9c614b6e565b634e487b7160e01b5f52601260045260245ffd5b5f82614bbb57614bbb614b99565b500490565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301525f608082015160e06080850152614c0260e08501826143cb565b905060a083015184820360a0860152614c1b82826143cb565b91505060c083015184820360c086015261416f82826143cb565b604081525f614c476040830185614bc0565b905082151560208301529392505050565b5f60408284031215614c68575f80fd5b604051604081018181106001600160401b0382111715614c8a57614c8a614272565b604052825181526020928301519281019290925250919050565b5f60408284031215614cb4575f80fd5b6134268383614c58565b608081525f614cd06080830186614bc0565b9050614ce9602083018580518252602090810151910152565b6001600160a01b03929092166060919091015292915050565b5f8082840360c0811215614d14575f80fd5b6080811215614d21575f80fd5b50604051606081016001600160401b038282108183111715614d4557614d45614272565b8160405285518352602086015191508082168214614d61575f80fd5b506020820152614d748560408601614c58565b60408201529150614d888460808501614c58565b90509250929050565b601f821115610ce457805f5260205f20601f840160051c81016020851015614db65750805b601f840160051c820191505b8181101561266d575f8155600101614dc2565b81516001600160401b03811115614dee57614dee614272565b614e0281614dfc8454614b17565b84614d91565b602080601f831160018114614e35575f8415614e1e5750858301515b5f19600386901b1c1916600185901b17855561160b565b5f85815260208120601f198616915b82811015614e6357888601518255948401946001909101908401614e44565b5085821015614e8057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215614ea0575f80fd5b5051919050565b80820180821115613d9c57613d9c614b6e565b5f808335601e19843603018112614ecf575f80fd5b8301803591506001600160401b03821115614ee8575f80fd5b6020019150368190038213156145bb575f80fd5b81810381811115613d9c57613d9c614b6e565b5f8154614f1b81614b17565b808552602060018381168015614f385760018114614f5257614f7d565b60ff1985168884015283151560051b880183019550614f7d565b865f52825f205f5b85811015614f755781548a8201860152908301908401614f5a565b890184019650505b505050505092915050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f614fc26040830186614f0f565b828103602084015261321d818587614f88565b6001600160401b03831115614fec57614fec614272565b61500083614ffa8354614b17565b83614d91565b5f601f841160018114615031575f851561501a5750838201355b5f19600387901b1c1916600186901b17835561266d565b5f83815260208120601f198716915b828110156150605786850135825560209485019460019092019101615040565b508682101561507c575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f806040838503121561509f575f80fd5b505080516020909101519092909150565b5f815180845260208085019450602084015f5b838110156150df578151875295820195908201906001016150c3565b509495945050505050565b604081525f6150fc60408301856150b0565b828103602084015261416f81856150b0565b5f8261511c5761511c614b99565b500690565b608081525f61513360808301876143cb565b82810360208401526151458187614f0f565b6001600160a01b0395909516604084015250506060015292915050565b602081525f61342660208301846150b0565b5f6020808385031215615185575f80fd5b82516001600160401b0381111561519a575f80fd5b8301601f810185136151aa575f80fd5b80516151b861431f826142de565b81815260059190911b820183019083810190878311156151d6575f80fd5b928401925b828410156151f4578351825292840192908401906151db565b979650505050505050565b838152606060208201525f61521760608301856150b0565b9050826040830152949350505050565b6001600160a01b0392831681529116602082015260400190565b608081525f61525460808301888a614f88565b82810360208401526152668188614f0f565b9050828103604084015261527b818688614f88565b915050826060830152979650505050505050565b608081525f6152a2608083018789614f88565b82810360208401526152b48187614f0f565b6001600160a01b039590951660408401525050606001529392505050565b838152604060208201525f61416f604083018486614f88565b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209495ab2db6ad49108afc2a2841ada7374033b20dc0496be159259315a6f0f53164736f6c63430008190033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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