ETH Price: $3,211.14 (-3.33%)

Contract

0x36a5d40AC8Acb7cEc9C0e61c4d1fD338eBF6E414
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
211807452024-11-13 19:05:1166 days ago1731524711
0x36a5d40A...8eBF6E414
0 ETH
211806542024-11-13 18:46:5966 days ago1731523619
0x36a5d40A...8eBF6E414
0 ETH
211806542024-11-13 18:46:5966 days ago1731523619
0x36a5d40A...8eBF6E414
0 ETH
211806542024-11-13 18:46:5966 days ago1731523619
0x36a5d40A...8eBF6E414
0 ETH
211806542024-11-13 18:46:5966 days ago1731523619
0x36a5d40A...8eBF6E414
0 ETH
211806122024-11-13 18:38:3566 days ago1731523115
0x36a5d40A...8eBF6E414
0 ETH
211806122024-11-13 18:38:3566 days ago1731523115
0x36a5d40A...8eBF6E414
0 ETH
211806122024-11-13 18:38:3566 days ago1731523115
0x36a5d40A...8eBF6E414
0 ETH
211806122024-11-13 18:38:3566 days ago1731523115
0x36a5d40A...8eBF6E414
0 ETH
211804252024-11-13 18:00:4766 days ago1731520847
0x36a5d40A...8eBF6E414
0 ETH
211804252024-11-13 18:00:4766 days ago1731520847
0x36a5d40A...8eBF6E414
0 ETH
211804252024-11-13 18:00:4766 days ago1731520847
0x36a5d40A...8eBF6E414
0 ETH
211804252024-11-13 18:00:4766 days ago1731520847
0x36a5d40A...8eBF6E414
0 ETH
211803282024-11-13 17:41:2366 days ago1731519683
0x36a5d40A...8eBF6E414
0 ETH
211803282024-11-13 17:41:2366 days ago1731519683
0x36a5d40A...8eBF6E414
0 ETH
211803282024-11-13 17:41:2366 days ago1731519683
0x36a5d40A...8eBF6E414
0 ETH
211803282024-11-13 17:41:2366 days ago1731519683
0x36a5d40A...8eBF6E414
0 ETH
211803002024-11-13 17:35:4766 days ago1731519347
0x36a5d40A...8eBF6E414
0 ETH
211803002024-11-13 17:35:4766 days ago1731519347
0x36a5d40A...8eBF6E414
0 ETH
211803002024-11-13 17:35:4766 days ago1731519347
0x36a5d40A...8eBF6E414
0 ETH
211803002024-11-13 17:35:4766 days ago1731519347
0x36a5d40A...8eBF6E414
0 ETH
211802952024-11-13 17:34:4766 days ago1731519287
0x36a5d40A...8eBF6E414
0 ETH
211802952024-11-13 17:34:4766 days ago1731519287
0x36a5d40A...8eBF6E414
0 ETH
211802952024-11-13 17:34:4766 days ago1731519287
0x36a5d40A...8eBF6E414
0 ETH
211802952024-11-13 17:34:4766 days ago1731519287
0x36a5d40A...8eBF6E414
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StaderOracle

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 23 : StaderOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import './library/UtilLib.sol';

import './interfaces/IPoolUtils.sol';
import './interfaces/IStaderOracle.sol';
import './interfaces/ISocializingPool.sol';
import './interfaces/INodeRegistry.sol';
import './interfaces/IStaderStakePoolManager.sol';

import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol';
import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol';

contract StaderOracle is IStaderOracle, AccessControlUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
    bool public override erInspectionMode;
    bool public override isPORFeedBasedERData;
    SDPriceData public lastReportedSDPriceData;
    IStaderConfig public override staderConfig;
    ExchangeRate public inspectionModeExchangeRate;
    ExchangeRate public exchangeRate;
    ValidatorStats public validatorStats;

    uint256 public constant MAX_ER_UPDATE_FREQUENCY = 7200 * 7; // 7 days
    uint256 public constant ER_CHANGE_MAX_BPS = 10000;
    uint256 public override erChangeLimit;
    uint256 public constant MIN_TRUSTED_NODES = 5;
    uint256 public override trustedNodeChangeCoolingPeriod;

    /// @inheritdoc IStaderOracle
    uint256 public override trustedNodesCount;
    /// @inheritdoc IStaderOracle
    uint256 public override lastReportedMAPDIndex;
    uint256 public override erInspectionModeStartBlock;
    uint256 public override lastTrustedNodeCountChangeBlock;

    // indicate the health of protocol on beacon chain
    // enabled by `MANAGER` if heavy slashing on protocol on beacon chain
    bool public override safeMode;

    /// @inheritdoc IStaderOracle
    mapping(address => bool) public override isTrustedNode;
    mapping(bytes32 => bool) private nodeSubmissionKeys;
    mapping(bytes32 => uint8) private submissionCountKeys;
    mapping(bytes32 => uint16) public override missedAttestationPenalty;
    /// @inheritdoc IStaderOracle
    mapping(uint8 => uint256) public override lastReportingBlockNumberForWithdrawnValidatorsByPoolId;
    /// @inheritdoc IStaderOracle
    mapping(uint8 => uint256) public override lastReportingBlockNumberForValidatorVerificationDetailByPoolId;

    uint256[] private sdPrices;

    bytes32 public constant ETHX_ER_UF = keccak256('ETHX_ER_UF'); // ETHx Exchange Rate, Balances Update Frequency
    bytes32 public constant SD_PRICE_UF = keccak256('SD_PRICE_UF'); // SD Price Update Frequency Key
    bytes32 public constant VALIDATOR_STATS_UF = keccak256('VALIDATOR_STATS_UF'); // Validator Status Update Frequency Key
    bytes32 public constant WITHDRAWN_VALIDATORS_UF = keccak256('WITHDRAWN_VALIDATORS_UF'); // Withdrawn Validator Update Frequency Key
    bytes32 public constant MISSED_ATTESTATION_PENALTY_UF = keccak256('MISSED_ATTESTATION_PENALTY_UF'); // Missed Attestation Penalty Update Frequency Key
    // Ready to Deposit Validators Update Frequency Key
    bytes32 public constant VALIDATOR_VERIFICATION_DETAIL_UF = keccak256('VALIDATOR_VERIFICATION_DETAIL_UF');
    mapping(bytes32 => uint256) public updateFrequencyMap;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    function initialize(address _admin, address _staderConfig) external initializer {
        UtilLib.checkNonZeroAddress(_admin);
        UtilLib.checkNonZeroAddress(_staderConfig);

        __AccessControl_init();
        __Pausable_init();
        __ReentrancyGuard_init();
        erChangeLimit = 500; //5% deviation threshold
        setUpdateFrequency(ETHX_ER_UF, 7200);
        setUpdateFrequency(SD_PRICE_UF, 7200);
        setUpdateFrequency(VALIDATOR_STATS_UF, 7200);
        setUpdateFrequency(WITHDRAWN_VALIDATORS_UF, 14400);
        setUpdateFrequency(MISSED_ATTESTATION_PENALTY_UF, 50400);
        setUpdateFrequency(VALIDATOR_VERIFICATION_DETAIL_UF, 7200);
        staderConfig = IStaderConfig(_staderConfig);
        _grantRole(DEFAULT_ADMIN_ROLE, _admin);
        emit UpdatedStaderConfig(_staderConfig);
    }

    /// @inheritdoc IStaderOracle
    function addTrustedNode(address _nodeAddress) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        UtilLib.checkNonZeroAddress(_nodeAddress);
        if (isTrustedNode[_nodeAddress]) {
            revert NodeAlreadyTrusted();
        }
        if (block.number < lastTrustedNodeCountChangeBlock + trustedNodeChangeCoolingPeriod) {
            revert CooldownNotComplete();
        }
        lastTrustedNodeCountChangeBlock = block.number;

        isTrustedNode[_nodeAddress] = true;
        trustedNodesCount++;

        emit TrustedNodeAdded(_nodeAddress);
    }

    /// @inheritdoc IStaderOracle
    function removeTrustedNode(address _nodeAddress) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        UtilLib.checkNonZeroAddress(_nodeAddress);
        if (!isTrustedNode[_nodeAddress]) {
            revert NodeNotTrusted();
        }
        if (block.number < lastTrustedNodeCountChangeBlock + trustedNodeChangeCoolingPeriod) {
            revert CooldownNotComplete();
        }
        lastTrustedNodeCountChangeBlock = block.number;

        isTrustedNode[_nodeAddress] = false;
        trustedNodesCount--;

        emit TrustedNodeRemoved(_nodeAddress);
    }

    /// @inheritdoc IStaderOracle
    function submitExchangeRateData(ExchangeRate calldata _exchangeRate)
        external
        override
        trustedNodeOnly
        checkMinTrustedNodes
        checkERInspectionMode
        whenNotPaused
    {
        if (isPORFeedBasedERData) {
            revert InvalidERDataSource();
        }
        if (_exchangeRate.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_exchangeRate.reportingBlockNumber % updateFrequencyMap[ETHX_ER_UF] > 0) {
            revert InvalidReportingBlock();
        }

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(
            abi.encode(
                msg.sender,
                _exchangeRate.reportingBlockNumber,
                _exchangeRate.totalETHBalance,
                _exchangeRate.totalETHXSupply
            )
        );
        bytes32 submissionCountKey = keccak256(
            abi.encode(_exchangeRate.reportingBlockNumber, _exchangeRate.totalETHBalance, _exchangeRate.totalETHXSupply)
        );
        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);
        // Emit balances submitted event
        emit ExchangeRateSubmitted(
            msg.sender,
            _exchangeRate.reportingBlockNumber,
            _exchangeRate.totalETHBalance,
            _exchangeRate.totalETHXSupply,
            block.timestamp
        );

        if (
            submissionCount >= trustedNodesCount / 2 + 1 &&
            _exchangeRate.reportingBlockNumber > exchangeRate.reportingBlockNumber
        ) {
            updateWithInLimitER(
                _exchangeRate.totalETHBalance,
                _exchangeRate.totalETHXSupply,
                _exchangeRate.reportingBlockNumber
            );
        }
    }

    /// @inheritdoc IStaderOracle
    function updateERFromPORFeed() external override checkERInspectionMode whenNotPaused {
        if (!isPORFeedBasedERData) {
            revert InvalidERDataSource();
        }
        (uint256 newTotalETHBalance, uint256 newTotalETHXSupply, uint256 reportingBlockNumber) = getPORFeedData();
        updateWithInLimitER(newTotalETHBalance, newTotalETHXSupply, reportingBlockNumber);
    }

    /**
     * @notice update the exchange rate when er change limit crossed, after verifying `inspectionModeExchangeRate` data
     * @dev `erInspectionMode` must be true to call this function
     */
    function closeERInspectionMode() external override whenNotPaused {
        if (!erInspectionMode) {
            revert ERChangeLimitNotCrossed();
        }
        disableERInspectionMode();
        _updateExchangeRate(
            inspectionModeExchangeRate.totalETHBalance,
            inspectionModeExchangeRate.totalETHXSupply,
            inspectionModeExchangeRate.reportingBlockNumber
        );
    }

    // turn off erInspectionMode if `inspectionModeExchangeRate` is incorrect so that oracle/POR can push new data
    function disableERInspectionMode() public override whenNotPaused {
        if (
            !staderConfig.onlyManagerRole(msg.sender) &&
            erInspectionModeStartBlock + MAX_ER_UPDATE_FREQUENCY > block.number
        ) {
            revert CooldownNotComplete();
        }
        erInspectionMode = false;
    }

    /// @notice submits merkle root and handles reward
    /// sends user rewards to Stader Stake Pool Manager
    /// sends protocol rewards to stader treasury
    /// updates operator reward balances on socializing pool
    /// @param _rewardsData contains rewards merkleRoot and rewards split info
    /// @dev _rewardsData.index should not be zero
    function submitSocializingRewardsMerkleRoot(RewardsData calldata _rewardsData)
        external
        override
        nonReentrant
        trustedNodeOnly
        checkMinTrustedNodes
        whenNotPaused
    {
        if (_rewardsData.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_rewardsData.reportingBlockNumber != getMerkleRootReportableBlockByPoolId(_rewardsData.poolId)) {
            revert InvalidReportingBlock();
        }
        if (_rewardsData.index != getCurrentRewardsIndexByPoolId(_rewardsData.poolId)) {
            revert InvalidMerkleRootIndex();
        }

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(
            abi.encode(
                msg.sender,
                _rewardsData.index,
                _rewardsData.merkleRoot,
                _rewardsData.poolId,
                _rewardsData.operatorETHRewards,
                _rewardsData.userETHRewards,
                _rewardsData.protocolETHRewards,
                _rewardsData.operatorSDRewards
            )
        );
        bytes32 submissionCountKey = keccak256(
            abi.encode(
                _rewardsData.index,
                _rewardsData.merkleRoot,
                _rewardsData.poolId,
                _rewardsData.operatorETHRewards,
                _rewardsData.userETHRewards,
                _rewardsData.protocolETHRewards,
                _rewardsData.operatorSDRewards
            )
        );

        // Emit merkle root submitted event
        emit SocializingRewardsMerkleRootSubmitted(
            msg.sender,
            _rewardsData.index,
            _rewardsData.merkleRoot,
            _rewardsData.poolId,
            block.number
        );

        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);

        if ((submissionCount >= trustedNodesCount / 2 + 1)) {
            address socializingPool = IPoolUtils(staderConfig.getPoolUtils()).getSocializingPoolAddress(
                _rewardsData.poolId
            );
            ISocializingPool(socializingPool).handleRewards(_rewardsData);

            emit SocializingRewardsMerkleRootUpdated(
                _rewardsData.index,
                _rewardsData.merkleRoot,
                _rewardsData.poolId,
                block.number
            );
        }
    }

    function submitSDPrice(SDPriceData calldata _sdPriceData) external override trustedNodeOnly checkMinTrustedNodes {
        if (_sdPriceData.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_sdPriceData.reportingBlockNumber != getSDPriceReportableBlock()) {
            revert InvalidReportingBlock();
        }
        if (_sdPriceData.reportingBlockNumber <= lastReportedSDPriceData.reportingBlockNumber) {
            revert ReportingPreviousCycleData();
        }

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(abi.encode(msg.sender, _sdPriceData.reportingBlockNumber));
        bytes32 submissionCountKey = keccak256(abi.encode(_sdPriceData.reportingBlockNumber));
        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);
        // clean the sd price array before the start of every round of submissions
        if (submissionCount == 1) {
            delete sdPrices;
        }
        insertSDPrice(_sdPriceData.sdPriceInETH);
        // Emit SD Price submitted event
        emit SDPriceSubmitted(msg.sender, _sdPriceData.sdPriceInETH, _sdPriceData.reportingBlockNumber, block.number);

        // price can be derived once more than 66% percent oracles have submitted price
        if ((submissionCount >= (2 * trustedNodesCount) / 3 + 1)) {
            lastReportedSDPriceData = _sdPriceData;
            lastReportedSDPriceData.sdPriceInETH = getMedianValue(sdPrices);

            // Emit SD Price updated event
            emit SDPriceUpdated(_sdPriceData.sdPriceInETH, _sdPriceData.reportingBlockNumber, block.number);
        }
    }

    function insertSDPrice(uint256 _sdPrice) internal {
        sdPrices.push(_sdPrice);
        if (sdPrices.length == 1) return;

        uint256 j = sdPrices.length - 1;
        while ((j >= 1) && (_sdPrice < sdPrices[j - 1])) {
            sdPrices[j] = sdPrices[j - 1];
            j--;
        }
        sdPrices[j] = _sdPrice;
    }

    function getMedianValue(uint256[] storage dataArray) internal view returns (uint256 _medianValue) {
        uint256 len = dataArray.length;
        return (dataArray[(len - 1) / 2] + dataArray[len / 2]) / 2;
    }

    /// @inheritdoc IStaderOracle
    function submitValidatorStats(ValidatorStats calldata _validatorStats)
        external
        override
        trustedNodeOnly
        checkMinTrustedNodes
        whenNotPaused
    {
        if (_validatorStats.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_validatorStats.reportingBlockNumber % updateFrequencyMap[VALIDATOR_STATS_UF] > 0) {
            revert InvalidReportingBlock();
        }

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(
            abi.encode(
                msg.sender,
                _validatorStats.reportingBlockNumber,
                _validatorStats.exitingValidatorsBalance,
                _validatorStats.exitedValidatorsBalance,
                _validatorStats.slashedValidatorsBalance,
                _validatorStats.exitingValidatorsCount,
                _validatorStats.exitedValidatorsCount,
                _validatorStats.slashedValidatorsCount
            )
        );
        bytes32 submissionCountKey = keccak256(
            abi.encode(
                _validatorStats.reportingBlockNumber,
                _validatorStats.exitingValidatorsBalance,
                _validatorStats.exitedValidatorsBalance,
                _validatorStats.slashedValidatorsBalance,
                _validatorStats.exitingValidatorsCount,
                _validatorStats.exitedValidatorsCount,
                _validatorStats.slashedValidatorsCount
            )
        );

        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);
        // Emit validator stats submitted event
        emit ValidatorStatsSubmitted(
            msg.sender,
            _validatorStats.reportingBlockNumber,
            _validatorStats.exitingValidatorsBalance,
            _validatorStats.exitedValidatorsBalance,
            _validatorStats.slashedValidatorsBalance,
            _validatorStats.exitingValidatorsCount,
            _validatorStats.exitedValidatorsCount,
            _validatorStats.slashedValidatorsCount,
            block.timestamp
        );

        if (
            submissionCount >= trustedNodesCount / 2 + 1 &&
            _validatorStats.reportingBlockNumber > validatorStats.reportingBlockNumber
        ) {
            validatorStats = _validatorStats;

            // Emit stats updated event
            emit ValidatorStatsUpdated(
                _validatorStats.reportingBlockNumber,
                _validatorStats.exitingValidatorsBalance,
                _validatorStats.exitedValidatorsBalance,
                _validatorStats.slashedValidatorsBalance,
                _validatorStats.exitingValidatorsCount,
                _validatorStats.exitedValidatorsCount,
                _validatorStats.slashedValidatorsCount,
                block.timestamp
            );
        }
    }

    /// @inheritdoc IStaderOracle
    function submitWithdrawnValidators(WithdrawnValidators calldata _withdrawnValidators)
        external
        override
        nonReentrant
        trustedNodeOnly
        checkMinTrustedNodes
        whenNotPaused
    {
        if (_withdrawnValidators.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_withdrawnValidators.reportingBlockNumber % updateFrequencyMap[WITHDRAWN_VALIDATORS_UF] > 0) {
            revert InvalidReportingBlock();
        }

        bytes memory encodedPubkeys = abi.encode(_withdrawnValidators.sortedPubkeys);
        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(
            abi.encode(
                msg.sender,
                _withdrawnValidators.poolId,
                _withdrawnValidators.reportingBlockNumber,
                encodedPubkeys
            )
        );
        bytes32 submissionCountKey = keccak256(
            abi.encode(_withdrawnValidators.poolId, _withdrawnValidators.reportingBlockNumber, encodedPubkeys)
        );

        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);
        // Emit withdrawn validators submitted event
        emit WithdrawnValidatorsSubmitted(
            msg.sender,
            _withdrawnValidators.poolId,
            _withdrawnValidators.reportingBlockNumber,
            _withdrawnValidators.sortedPubkeys,
            block.timestamp
        );

        if (
            submissionCount >= trustedNodesCount / 2 + 1 &&
            _withdrawnValidators.reportingBlockNumber >
            lastReportingBlockNumberForWithdrawnValidatorsByPoolId[_withdrawnValidators.poolId]
        ) {
            lastReportingBlockNumberForWithdrawnValidatorsByPoolId[_withdrawnValidators.poolId] = _withdrawnValidators
                .reportingBlockNumber;

            INodeRegistry(IPoolUtils(staderConfig.getPoolUtils()).getNodeRegistry(_withdrawnValidators.poolId))
                .withdrawnValidators(_withdrawnValidators.sortedPubkeys);

            // Emit withdrawn validators updated event
            emit WithdrawnValidatorsUpdated(
                _withdrawnValidators.poolId,
                _withdrawnValidators.reportingBlockNumber,
                _withdrawnValidators.sortedPubkeys,
                block.timestamp
            );
        }
    }

    /// @inheritdoc IStaderOracle
    function submitValidatorVerificationDetail(ValidatorVerificationDetail calldata _validatorVerificationDetail)
        external
        override
        nonReentrant
        trustedNodeOnly
        checkMinTrustedNodes
        whenNotPaused
    {
        if (_validatorVerificationDetail.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (
            _validatorVerificationDetail.reportingBlockNumber % updateFrequencyMap[VALIDATOR_VERIFICATION_DETAIL_UF] > 0
        ) {
            revert InvalidReportingBlock();
        }

        bytes memory encodedPubkeys = abi.encode(
            _validatorVerificationDetail.sortedReadyToDepositPubkeys,
            _validatorVerificationDetail.sortedFrontRunPubkeys,
            _validatorVerificationDetail.sortedInvalidSignaturePubkeys
        );

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(
            abi.encode(
                msg.sender,
                _validatorVerificationDetail.poolId,
                _validatorVerificationDetail.reportingBlockNumber,
                encodedPubkeys
            )
        );
        bytes32 submissionCountKey = keccak256(
            abi.encode(
                _validatorVerificationDetail.poolId,
                _validatorVerificationDetail.reportingBlockNumber,
                encodedPubkeys
            )
        );

        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);
        // Emit validator verification detail submitted event
        emit ValidatorVerificationDetailSubmitted(
            msg.sender,
            _validatorVerificationDetail.poolId,
            _validatorVerificationDetail.reportingBlockNumber,
            _validatorVerificationDetail.sortedReadyToDepositPubkeys,
            _validatorVerificationDetail.sortedFrontRunPubkeys,
            _validatorVerificationDetail.sortedInvalidSignaturePubkeys,
            block.timestamp
        );

        if (
            submissionCount >= trustedNodesCount / 2 + 1 &&
            _validatorVerificationDetail.reportingBlockNumber >
            lastReportingBlockNumberForValidatorVerificationDetailByPoolId[_validatorVerificationDetail.poolId]
        ) {
            lastReportingBlockNumberForValidatorVerificationDetailByPoolId[
                _validatorVerificationDetail.poolId
            ] = _validatorVerificationDetail.reportingBlockNumber;
            INodeRegistry(IPoolUtils(staderConfig.getPoolUtils()).getNodeRegistry(_validatorVerificationDetail.poolId))
                .markValidatorReadyToDeposit(
                    _validatorVerificationDetail.sortedReadyToDepositPubkeys,
                    _validatorVerificationDetail.sortedFrontRunPubkeys,
                    _validatorVerificationDetail.sortedInvalidSignaturePubkeys
                );

            // Emit validator verification detail updated event
            emit ValidatorVerificationDetailUpdated(
                _validatorVerificationDetail.poolId,
                _validatorVerificationDetail.reportingBlockNumber,
                _validatorVerificationDetail.sortedReadyToDepositPubkeys,
                _validatorVerificationDetail.sortedFrontRunPubkeys,
                _validatorVerificationDetail.sortedInvalidSignaturePubkeys,
                block.timestamp
            );
        }
    }

    /// @inheritdoc IStaderOracle
    function submitMissedAttestationPenalties(MissedAttestationPenaltyData calldata _mapd)
        external
        override
        trustedNodeOnly
        checkMinTrustedNodes
        whenNotPaused
    {
        if (_mapd.reportingBlockNumber >= block.number) {
            revert ReportingFutureBlockData();
        }
        if (_mapd.reportingBlockNumber != getMissedAttestationPenaltyReportableBlock()) {
            revert InvalidReportingBlock();
        }
        if (_mapd.index != lastReportedMAPDIndex + 1) {
            revert InvalidMAPDIndex();
        }

        bytes memory encodedPubkeys = abi.encode(_mapd.sortedPubkeys);

        // Get submission keys
        bytes32 nodeSubmissionKey = keccak256(abi.encode(msg.sender, _mapd.index, encodedPubkeys));
        bytes32 submissionCountKey = keccak256(abi.encode(_mapd.index, encodedPubkeys));
        uint8 submissionCount = attestSubmission(nodeSubmissionKey, submissionCountKey);

        // Emit missed attestation penalty submitted event
        emit MissedAttestationPenaltySubmitted(
            msg.sender,
            _mapd.index,
            block.number,
            _mapd.reportingBlockNumber,
            _mapd.sortedPubkeys
        );

        if ((submissionCount >= trustedNodesCount / 2 + 1)) {
            lastReportedMAPDIndex = _mapd.index;
            uint256 keyCount = _mapd.sortedPubkeys.length;
            for (uint256 i; i < keyCount; ) {
                bytes32 pubkeyRoot = UtilLib.getPubkeyRoot(_mapd.sortedPubkeys[i]);
                missedAttestationPenalty[pubkeyRoot]++;
                unchecked {
                    ++i;
                }
            }
            emit MissedAttestationPenaltyUpdated(_mapd.index, block.number, _mapd.sortedPubkeys);
        }
    }

    /// @inheritdoc IStaderOracle
    function enableSafeMode() external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        safeMode = true;
        emit SafeModeEnabled();
    }

    function disableSafeMode() external override onlyRole(DEFAULT_ADMIN_ROLE) {
        safeMode = false;
        emit SafeModeDisabled();
    }

    function updateTrustedNodeChangeCoolingPeriod(uint256 _trustedNodeChangeCoolingPeriod) external {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        trustedNodeChangeCoolingPeriod = _trustedNodeChangeCoolingPeriod;
        emit TrustedNodeChangeCoolingPeriodUpdated(_trustedNodeChangeCoolingPeriod);
    }

    //update the address of staderConfig
    function updateStaderConfig(address _staderConfig) external onlyRole(DEFAULT_ADMIN_ROLE) {
        UtilLib.checkNonZeroAddress(_staderConfig);
        staderConfig = IStaderConfig(_staderConfig);
        emit UpdatedStaderConfig(_staderConfig);
    }

    function setERUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        if (_updateFrequency > MAX_ER_UPDATE_FREQUENCY) {
            revert InvalidUpdate();
        }
        setUpdateFrequency(ETHX_ER_UF, _updateFrequency);
    }

    function togglePORFeedBasedERData() external override checkERInspectionMode {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        isPORFeedBasedERData = !isPORFeedBasedERData;
        emit ERDataSourceToggled(isPORFeedBasedERData);
    }

    //update the deviation threshold value, 0 deviationThreshold not allowed
    function updateERChangeLimit(uint256 _erChangeLimit) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        if (_erChangeLimit == 0 || _erChangeLimit > ER_CHANGE_MAX_BPS) {
            revert ERPermissibleChangeOutofBounds();
        }
        erChangeLimit = _erChangeLimit;
        emit UpdatedERChangeLimit(erChangeLimit);
    }

    function setSDPriceUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        setUpdateFrequency(SD_PRICE_UF, _updateFrequency);
    }

    function setValidatorStatsUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        setUpdateFrequency(VALIDATOR_STATS_UF, _updateFrequency);
    }

    function setWithdrawnValidatorsUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        setUpdateFrequency(WITHDRAWN_VALIDATORS_UF, _updateFrequency);
    }

    function setValidatorVerificationDetailUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        setUpdateFrequency(VALIDATOR_VERIFICATION_DETAIL_UF, _updateFrequency);
    }

    function setMissedAttestationPenaltyUpdateFrequency(uint256 _updateFrequency) external override {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        setUpdateFrequency(MISSED_ATTESTATION_PENALTY_UF, _updateFrequency);
    }

    function setUpdateFrequency(bytes32 _key, uint256 _updateFrequency) internal {
        if (_updateFrequency == 0) {
            revert ZeroFrequency();
        }
        if (_updateFrequency == updateFrequencyMap[_key]) {
            revert FrequencyUnchanged();
        }
        updateFrequencyMap[_key] = _updateFrequency;

        emit UpdateFrequencyUpdated(_updateFrequency);
    }

    function getERReportableBlock() external view override returns (uint256) {
        return getReportableBlockFor(ETHX_ER_UF);
    }

    function getMerkleRootReportableBlockByPoolId(uint8 _poolId) public view override returns (uint256) {
        (, , uint256 currentEndBlock) = ISocializingPool(
            IPoolUtils(staderConfig.getPoolUtils()).getSocializingPoolAddress(_poolId)
        ).getRewardDetails();
        return currentEndBlock;
    }

    function getSDPriceReportableBlock() public view override returns (uint256) {
        return getReportableBlockFor(SD_PRICE_UF);
    }

    function getValidatorStatsReportableBlock() external view override returns (uint256) {
        return getReportableBlockFor(VALIDATOR_STATS_UF);
    }

    function getWithdrawnValidatorReportableBlock() external view override returns (uint256) {
        return getReportableBlockFor(WITHDRAWN_VALIDATORS_UF);
    }

    function getValidatorVerificationDetailReportableBlock() external view override returns (uint256) {
        return getReportableBlockFor(VALIDATOR_VERIFICATION_DETAIL_UF);
    }

    function getMissedAttestationPenaltyReportableBlock() public view override returns (uint256) {
        return getReportableBlockFor(MISSED_ATTESTATION_PENALTY_UF);
    }

    function getReportableBlockFor(bytes32 _key) internal view returns (uint256) {
        uint256 updateFrequency = updateFrequencyMap[_key];
        if (updateFrequency == 0) {
            revert UpdateFrequencyNotSet();
        }
        return (block.number / updateFrequency) * updateFrequency;
    }

    function getCurrentRewardsIndexByPoolId(uint8 _poolId) public view returns (uint256) {
        return
            ISocializingPool(IPoolUtils(staderConfig.getPoolUtils()).getSocializingPoolAddress(_poolId))
                .getCurrentRewardsIndex();
    }

    function getValidatorStats() external view override returns (ValidatorStats memory) {
        return (validatorStats);
    }

    function getExchangeRate() external view override returns (ExchangeRate memory) {
        return (exchangeRate);
    }

    function attestSubmission(bytes32 _nodeSubmissionKey, bytes32 _submissionCountKey)
        internal
        returns (uint8 _submissionCount)
    {
        // Check & update node submission status
        if (nodeSubmissionKeys[_nodeSubmissionKey]) {
            revert DuplicateSubmissionFromNode();
        }
        nodeSubmissionKeys[_nodeSubmissionKey] = true;
        submissionCountKeys[_submissionCountKey]++;
        _submissionCount = submissionCountKeys[_submissionCountKey];
    }

    function getSDPriceInETH() external view override returns (uint256) {
        return lastReportedSDPriceData.sdPriceInETH;
    }

    function getPORFeedData()
        internal
        view
        returns (
            uint256,
            uint256,
            uint256
        )
    {
        (, int256 totalETHBalanceInInt, , , ) = AggregatorV3Interface(staderConfig.getETHBalancePORFeedProxy())
            .latestRoundData();
        (, int256 totalETHXSupplyInInt, , , ) = AggregatorV3Interface(staderConfig.getETHXSupplyPORFeedProxy())
            .latestRoundData();
        return (uint256(totalETHBalanceInInt), uint256(totalETHXSupplyInInt), block.number);
    }

    function updateWithInLimitER(
        uint256 _newTotalETHBalance,
        uint256 _newTotalETHXSupply,
        uint256 _reportingBlockNumber
    ) internal {
        uint256 currentExchangeRate = UtilLib.computeExchangeRate(
            exchangeRate.totalETHBalance,
            exchangeRate.totalETHXSupply,
            staderConfig
        );
        uint256 newExchangeRate = UtilLib.computeExchangeRate(_newTotalETHBalance, _newTotalETHXSupply, staderConfig);
        if (
            !(newExchangeRate >= (currentExchangeRate * (ER_CHANGE_MAX_BPS - erChangeLimit)) / ER_CHANGE_MAX_BPS &&
                newExchangeRate <= ((currentExchangeRate * (ER_CHANGE_MAX_BPS + erChangeLimit)) / ER_CHANGE_MAX_BPS))
        ) {
            erInspectionMode = true;
            erInspectionModeStartBlock = block.number;
            inspectionModeExchangeRate.totalETHBalance = _newTotalETHBalance;
            inspectionModeExchangeRate.totalETHXSupply = _newTotalETHXSupply;
            inspectionModeExchangeRate.reportingBlockNumber = _reportingBlockNumber;
            emit ERInspectionModeActivated(erInspectionMode, block.timestamp);
            return;
        }
        _updateExchangeRate(_newTotalETHBalance, _newTotalETHXSupply, _reportingBlockNumber);
    }

    function _updateExchangeRate(
        uint256 _totalETHBalance,
        uint256 _totalETHXSupply,
        uint256 _reportingBlockNumber
    ) internal {
        exchangeRate.totalETHBalance = _totalETHBalance;
        exchangeRate.totalETHXSupply = _totalETHXSupply;
        exchangeRate.reportingBlockNumber = _reportingBlockNumber;

        // Emit balances updated event
        emit ExchangeRateUpdated(
            exchangeRate.reportingBlockNumber,
            exchangeRate.totalETHBalance,
            exchangeRate.totalETHXSupply,
            block.timestamp
        );
    }

    /**
     * @dev Triggers stopped state.
     * Contract must not be paused.
     */
    function pause() external {
        UtilLib.onlyManagerRole(msg.sender, staderConfig);
        _pause();
    }

    /**
     * @dev Returns to normal state.
     * Contract must be paused
     */
    function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _unpause();
    }

    modifier checkERInspectionMode() {
        if (erInspectionMode) {
            revert InspectionModeActive();
        }
        _;
    }

    modifier trustedNodeOnly() {
        if (!isTrustedNode[msg.sender]) {
            revert NotATrustedNode();
        }
        _;
    }

    modifier checkMinTrustedNodes() {
        if (trustedNodesCount < MIN_TRUSTED_NODES) {
            revert InsufficientTrustedNodes();
        }
        _;
    }
}

File 2 of 23 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 3 of 23 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(account),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _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 4 of 23 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

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

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

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 10 of 23 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @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 11 of 23 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 12 of 23 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 13 of 23 : SignedMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMathUpgradeable {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 14 of 23 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 15 of 23 : INodeRegistry.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.16;

import '../library/ValidatorStatus.sol';

struct Validator {
    ValidatorStatus status; // status of validator
    bytes pubkey; //pubkey of the validator
    bytes preDepositSignature; //signature for 1 ETH deposit on beacon chain
    bytes depositSignature; //signature for 31 ETH deposit on beacon chain
    address withdrawVaultAddress; //withdrawal vault address of validator
    uint256 operatorId; // stader network assigned Id
    uint256 depositBlock; // block number of the 31ETH deposit
    uint256 withdrawnBlock; //block number when oracle report validator as withdrawn
}

struct Operator {
    bool active; // operator status
    bool optedForSocializingPool; // operator opted for socializing pool
    string operatorName; // name of the operator
    address payable operatorRewardAddress; //Eth1 address of node for reward
    address operatorAddress; //address of operator to interact with stader
}

// Interface for the NodeRegistry contract
interface INodeRegistry {
    // Errors
    error DuplicatePoolIDOrPoolNotAdded();
    error OperatorAlreadyOnBoardedInProtocol();
    error maxKeyLimitReached();
    error OperatorNotOnBoarded();
    error InvalidKeyCount();
    error InvalidStartAndEndIndex();
    error OperatorIsDeactivate();
    error MisMatchingInputKeysSize();
    error PageNumberIsZero();
    error UNEXPECTED_STATUS();
    error PubkeyAlreadyExist();
    error NotEnoughSDCollateral();
    error TooManyVerifiedKeysReported();
    error TooManyWithdrawnKeysReported();

    // Events
    event AddedValidatorKey(address indexed nodeOperator, bytes pubkey, uint256 validatorId);
    event ValidatorMarkedAsFrontRunned(bytes pubkey, uint256 validatorId);
    event ValidatorWithdrawn(bytes pubkey, uint256 validatorId);
    event ValidatorStatusMarkedAsInvalidSignature(bytes pubkey, uint256 validatorId);
    event UpdatedValidatorDepositBlock(uint256 validatorId, uint256 depositBlock);
    event UpdatedMaxNonTerminalKeyPerOperator(uint64 maxNonTerminalKeyPerOperator);
    event UpdatedInputKeyCountLimit(uint256 batchKeyDepositLimit);
    event UpdatedStaderConfig(address staderConfig);
    event UpdatedOperatorDetails(address indexed nodeOperator, string operatorName, address rewardAddress);
    event IncreasedTotalActiveValidatorCount(uint256 totalActiveValidatorCount);
    event UpdatedVerifiedKeyBatchSize(uint256 verifiedKeysBatchSize);
    event UpdatedWithdrawnKeyBatchSize(uint256 withdrawnKeysBatchSize);
    event DecreasedTotalActiveValidatorCount(uint256 totalActiveValidatorCount);

    function withdrawnValidators(bytes[] calldata _pubkeys) external;

    function markValidatorReadyToDeposit(
        bytes[] calldata _readyToDepositPubkey,
        bytes[] calldata _frontRunPubkey,
        bytes[] calldata _invalidSignaturePubkey
    ) external;

    // return validator struct for a validator Id
    function validatorRegistry(uint256)
        external
        view
        returns (
            ValidatorStatus status,
            bytes calldata pubkey,
            bytes calldata preDepositSignature,
            bytes calldata depositSignature,
            address withdrawVaultAddress,
            uint256 operatorId,
            uint256 depositTime,
            uint256 withdrawnTime
        );

    // returns the operator struct given operator Id
    function operatorStructById(uint256)
        external
        view
        returns (
            bool active,
            bool optedForSocializingPool,
            string calldata operatorName,
            address payable operatorRewardAddress,
            address operatorAddress
        );

    // Returns the last block the operator changed the opt-in status for socializing pool
    function getSocializingPoolStateChangeBlock(uint256 _operatorId) external view returns (uint256);

    function getAllActiveValidators(uint256 _pageNumber, uint256 _pageSize) external view returns (Validator[] memory);

    function getValidatorsByOperator(
        address _operator,
        uint256 _pageNumber,
        uint256 _pageSize
    ) external view returns (Validator[] memory);

    /**
     *
     * @param _nodeOperator @notice operator total non withdrawn keys within a specified validator list
     * @param _startIndex start index in validator queue to start with
     * @param _endIndex  up to end index of validator queue to to count
     */
    function getOperatorTotalNonTerminalKeys(
        address _nodeOperator,
        uint256 _startIndex,
        uint256 _endIndex
    ) external view returns (uint64);

    // returns the total number of queued validators across all operators
    function getTotalQueuedValidatorCount() external view returns (uint256);

    // returns the total number of active validators across all operators
    function getTotalActiveValidatorCount() external view returns (uint256);

    function getCollateralETH() external view returns (uint256);

    function getOperatorTotalKeys(uint256 _operatorId) external view returns (uint256 totalKeys);

    function operatorIDByAddress(address) external view returns (uint256);

    function getOperatorRewardAddress(uint256 _operatorId) external view returns (address payable);

    function isExistingPubkey(bytes calldata _pubkey) external view returns (bool);

    function isExistingOperator(address _operAddr) external view returns (bool);

    function POOL_ID() external view returns (uint8);

    function inputKeyCountLimit() external view returns (uint16);

    function nextOperatorId() external view returns (uint256);

    function nextValidatorId() external view returns (uint256);

    function maxNonTerminalKeyPerOperator() external view returns (uint64);

    function verifiedKeyBatchSize() external view returns (uint256);

    function totalActiveValidatorCount() external view returns (uint256);

    function validatorIdByPubkey(bytes calldata _pubkey) external view returns (uint256);

    function validatorIdsByOperatorId(uint256, uint256) external view returns (uint256);
}

File 16 of 23 : IPoolUtils.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.16;

import './INodeRegistry.sol';

// Interface for the PoolUtils contract
interface IPoolUtils {
    // Errors
    error EmptyNameString();
    error PoolIdNotPresent();
    error PubkeyDoesNotExit();
    error PubkeyAlreadyExist();
    error NameCrossedMaxLength();
    error InvalidLengthOfPubkey();
    error OperatorIsNotOnboarded();
    error InvalidLengthOfSignature();
    error ExistingOrMismatchingPoolId();

    // Events
    event PoolAdded(uint8 indexed poolId, address poolAddress);
    event PoolAddressUpdated(uint8 indexed poolId, address poolAddress);
    event DeactivatedPool(uint8 indexed poolId, address poolAddress);
    event UpdatedStaderConfig(address staderConfig);
    event ExitValidator(bytes pubkey);

    // returns the details of a specific pool
    function poolAddressById(uint8) external view returns (address poolAddress);

    function poolIdArray(uint256) external view returns (uint8);

    function getPoolIdArray() external view returns (uint8[] memory);

    // Pool functions
    function addNewPool(uint8 _poolId, address _poolAddress) external;

    function updatePoolAddress(uint8 _poolId, address _poolAddress) external;

    function processValidatorExitList(bytes[] calldata _pubkeys) external;

    function getOperatorTotalNonTerminalKeys(
        uint8 _poolId,
        address _nodeOperator,
        uint256 _startIndex,
        uint256 _endIndex
    ) external view returns (uint256);

    function getSocializingPoolAddress(uint8 _poolId) external view returns (address);

    // Pool getters
    function getProtocolFee(uint8 _poolId) external view returns (uint256); // returns the protocol fee (0-10000)

    function getOperatorFee(uint8 _poolId) external view returns (uint256); // returns the operator fee (0-10000)

    function getTotalActiveValidatorCount() external view returns (uint256); //returns total active validators across all pools

    function getActiveValidatorCountByPool(uint8 _poolId) external view returns (uint256); // returns the total number of active validators in a specific pool

    function getQueuedValidatorCountByPool(uint8 _poolId) external view returns (uint256); // returns the total number of queued validators in a specific pool

    function getCollateralETH(uint8 _poolId) external view returns (uint256);

    function getNodeRegistry(uint8 _poolId) external view returns (address);

    // check for duplicate pubkey across all pools
    function isExistingPubkey(bytes calldata _pubkey) external view returns (bool);

    // check for duplicate operator across all pools
    function isExistingOperator(address _operAddr) external view returns (bool);

    function isExistingPoolId(uint8 _poolId) external view returns (bool);

    function getOperatorPoolId(address _operAddr) external view returns (uint8);

    function getValidatorPoolId(bytes calldata _pubkey) external view returns (uint8);

    function onlyValidName(string calldata _name) external;

    function onlyValidKeys(
        bytes calldata _pubkey,
        bytes calldata _preDepositSignature,
        bytes calldata _depositSignature
    ) external;

    function calculateRewardShare(uint8 _poolId, uint256 _totalRewards)
        external
        view
        returns (
            uint256 userShare,
            uint256 operatorShare,
            uint256 protocolShare
        );
}

File 17 of 23 : ISocializingPool.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.16;

import './IStaderConfig.sol';

/// @title RewardsData
/// @notice This struct holds rewards merkleRoot and rewards split
struct RewardsData {
    /// @notice The block number when the rewards data was last updated
    uint256 reportingBlockNumber;
    /// @notice The index of merkle tree or rewards cycle
    uint256 index;
    /// @notice The merkle root hash
    bytes32 merkleRoot;
    /// @notice pool id of operators
    uint8 poolId;
    /// @notice operator ETH rewards for index cycle
    uint256 operatorETHRewards;
    /// @notice user ETH rewards for index cycle
    uint256 userETHRewards;
    /// @notice protocol ETH rewards for index cycle
    uint256 protocolETHRewards;
    /// @notice operator SD rewards for index cycle
    uint256 operatorSDRewards;
}

interface ISocializingPool {
    // errors
    error ETHTransferFailed(address recipient, uint256 amount);
    error SDTransferFailed();
    error RewardAlreadyHandled();
    error RewardAlreadyClaimed(address operator, uint256 cycle);
    error InsufficientETHRewards();
    error InsufficientSDRewards();
    error InvalidAmount();
    error InvalidProof(uint256 cycle, address operator);
    error InvalidCycleIndex();
    error FutureCycleIndex();

    // events
    event UpdatedStaderConfig(address indexed staderConfig);
    event ETHReceived(address indexed sender, uint256 amount);
    event UpdatedStaderValidatorRegistry(address indexed staderValidatorRegistry);
    event UpdatedStaderOperatorRegistry(address indexed staderOperatorRegistry);
    event OperatorRewardsClaimed(address indexed recipient, uint256 ethRewards, uint256 sdRewards);
    event OperatorRewardsUpdated(
        uint256 ethRewards,
        uint256 totalETHRewards,
        uint256 sdRewards,
        uint256 totalSDRewards
    );

    event UserETHRewardsTransferred(uint256 ethRewards);
    event ProtocolETHRewardsTransferred(uint256 ethRewards);

    // methods
    function handleRewards(RewardsData calldata _rewardsData) external;

    function claim(
        uint256[] calldata _index,
        uint256[] calldata _amountSD,
        uint256[] calldata _amountETH,
        bytes32[][] calldata _merkleProof
    ) external;

    // setters
    function updateStaderConfig(address _staderConfig) external;

    // getters
    function staderConfig() external view returns (IStaderConfig);

    function claimedRewards(address _user, uint256 _index) external view returns (bool);

    function totalOperatorETHRewardsRemaining() external view returns (uint256);

    function totalOperatorSDRewardsRemaining() external view returns (uint256);

    function initialBlock() external view returns (uint256);

    function verifyProof(
        uint256 _index,
        address _operator,
        uint256 _amountSD,
        uint256 _amountETH,
        bytes32[] calldata _merkleProof
    ) external view returns (bool);

    function getCurrentRewardsIndex() external view returns (uint256 index);

    function getRewardDetails()
        external
        view
        returns (
            uint256 currentIndex,
            uint256 currentStartBlock,
            uint256 currentEndBlock
        );

    function getRewardCycleDetails(uint256 _index) external view returns (uint256 _startBlock, uint256 _endBlock);
}

File 18 of 23 : IStaderConfig.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

interface IStaderConfig {
    // Errors
    error InvalidLimits();
    error InvalidMinDepositValue();
    error InvalidMaxDepositValue();
    error InvalidMinWithdrawValue();
    error InvalidMaxWithdrawValue();

    // Events
    event SetConstant(bytes32 key, uint256 amount);
    event SetVariable(bytes32 key, uint256 amount);
    event SetAccount(bytes32 key, address newAddress);
    event SetContract(bytes32 key, address newAddress);
    event SetToken(bytes32 key, address newAddress);

    //Contracts
    function POOL_UTILS() external view returns (bytes32);

    function POOL_SELECTOR() external view returns (bytes32);

    function SD_COLLATERAL() external view returns (bytes32);

    function OPERATOR_REWARD_COLLECTOR() external view returns (bytes32);

    function VAULT_FACTORY() external view returns (bytes32);

    function STADER_ORACLE() external view returns (bytes32);

    function AUCTION_CONTRACT() external view returns (bytes32);

    function PENALTY_CONTRACT() external view returns (bytes32);

    function PERMISSIONED_POOL() external view returns (bytes32);

    function STAKE_POOL_MANAGER() external view returns (bytes32);

    function ETH_DEPOSIT_CONTRACT() external view returns (bytes32);

    function PERMISSIONLESS_POOL() external view returns (bytes32);

    function USER_WITHDRAW_MANAGER() external view returns (bytes32);

    function STADER_INSURANCE_FUND() external view returns (bytes32);

    function PERMISSIONED_NODE_REGISTRY() external view returns (bytes32);

    function PERMISSIONLESS_NODE_REGISTRY() external view returns (bytes32);

    function PERMISSIONED_SOCIALIZING_POOL() external view returns (bytes32);

    function PERMISSIONLESS_SOCIALIZING_POOL() external view returns (bytes32);

    function NODE_EL_REWARD_VAULT_IMPLEMENTATION() external view returns (bytes32);

    function VALIDATOR_WITHDRAWAL_VAULT_IMPLEMENTATION() external view returns (bytes32);

    //POR Feed Proxy
    function ETH_BALANCE_POR_FEED() external view returns (bytes32);

    function ETHX_SUPPLY_POR_FEED() external view returns (bytes32);

    //Roles
    function MANAGER() external view returns (bytes32);

    function OPERATOR() external view returns (bytes32);

    // Constants
    function getStakedEthPerNode() external view returns (uint256);

    function getPreDepositSize() external view returns (uint256);

    function getFullDepositSize() external view returns (uint256);

    function getDecimals() external view returns (uint256);

    function getTotalFee() external view returns (uint256);

    function getOperatorMaxNameLength() external view returns (uint256);

    // Variables
    function getSocializingPoolCycleDuration() external view returns (uint256);

    function getSocializingPoolOptInCoolingPeriod() external view returns (uint256);

    function getRewardsThreshold() external view returns (uint256);

    function getMinDepositAmount() external view returns (uint256);

    function getMaxDepositAmount() external view returns (uint256);

    function getMinWithdrawAmount() external view returns (uint256);

    function getMaxWithdrawAmount() external view returns (uint256);

    function getMinBlockDelayToFinalizeWithdrawRequest() external view returns (uint256);

    function getWithdrawnKeyBatchSize() external view returns (uint256);

    // Accounts
    function getAdmin() external view returns (address);

    function getStaderTreasury() external view returns (address);

    // Contracts
    function getPoolUtils() external view returns (address);

    function getPoolSelector() external view returns (address);

    function getSDCollateral() external view returns (address);

    function getOperatorRewardsCollector() external view returns (address);

    function getVaultFactory() external view returns (address);

    function getStaderOracle() external view returns (address);

    function getAuctionContract() external view returns (address);

    function getPenaltyContract() external view returns (address);

    function getPermissionedPool() external view returns (address);

    function getStakePoolManager() external view returns (address);

    function getETHDepositContract() external view returns (address);

    function getPermissionlessPool() external view returns (address);

    function getUserWithdrawManager() external view returns (address);

    function getStaderInsuranceFund() external view returns (address);

    function getPermissionedNodeRegistry() external view returns (address);

    function getPermissionlessNodeRegistry() external view returns (address);

    function getPermissionedSocializingPool() external view returns (address);

    function getPermissionlessSocializingPool() external view returns (address);

    function getNodeELRewardVaultImplementation() external view returns (address);

    function getValidatorWithdrawalVaultImplementation() external view returns (address);

    function getETHBalancePORFeedProxy() external view returns (address);

    function getETHXSupplyPORFeedProxy() external view returns (address);

    // Tokens
    function getStaderToken() external view returns (address);

    function getETHxToken() external view returns (address);

    //checks roles and stader contracts
    function onlyStaderContract(address _addr, bytes32 _contractName) external view returns (bool);

    function onlyManagerRole(address account) external view returns (bool);

    function onlyOperatorRole(address account) external view returns (bool);
}

File 19 of 23 : IStaderOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import '../library/ValidatorStatus.sol';

import './ISocializingPool.sol';
import './IStaderConfig.sol';

struct SDPriceData {
    uint256 reportingBlockNumber;
    uint256 sdPriceInETH;
}

/// @title MissedAttestationPenaltyData
/// @notice This struct holds missed attestation penalty data
struct MissedAttestationPenaltyData {
    /// @notice The block number when the missed attestation penalty data is reported
    uint256 reportingBlockNumber;
    /// @notice The index of missed attestation penalty data
    uint256 index;
    /// @notice missed attestation validator pubkeys
    bytes[] sortedPubkeys;
}

struct MissedAttestationReportInfo {
    uint256 index;
    uint256 pageNumber;
}

/// @title ExchangeRate
/// @notice This struct holds data related to the exchange rate between ETH and ETHX.
struct ExchangeRate {
    /// @notice The block number when the exchange rate was last updated.
    uint256 reportingBlockNumber;
    /// @notice The total balance of Ether (ETH) in the system.
    uint256 totalETHBalance;
    /// @notice The total supply of the liquid staking token (ETHX) in the system.
    uint256 totalETHXSupply;
}

/// @title ValidatorStats
/// @notice This struct holds statistics related to validators in the beaconchain.
struct ValidatorStats {
    /// @notice The block number when the validator stats was last updated.
    uint256 reportingBlockNumber;
    /// @notice The total balance of all exiting validators.
    uint128 exitingValidatorsBalance;
    /// @notice The total balance of all exited validators.
    uint128 exitedValidatorsBalance;
    /// @notice The total balance of all slashed validators.
    uint128 slashedValidatorsBalance;
    /// @notice The number of currently exiting validators.
    uint32 exitingValidatorsCount;
    /// @notice The number of validators that have exited.
    uint32 exitedValidatorsCount;
    /// @notice The number of validators that have been slashed.
    uint32 slashedValidatorsCount;
}

struct WithdrawnValidators {
    uint8 poolId;
    uint256 reportingBlockNumber;
    bytes[] sortedPubkeys;
}

struct ValidatorVerificationDetail {
    uint8 poolId;
    uint256 reportingBlockNumber;
    bytes[] sortedReadyToDepositPubkeys;
    bytes[] sortedFrontRunPubkeys;
    bytes[] sortedInvalidSignaturePubkeys;
}

interface IStaderOracle {
    // Error
    error InvalidUpdate();
    error NodeAlreadyTrusted();
    error NodeNotTrusted();
    error ZeroFrequency();
    error FrequencyUnchanged();
    error DuplicateSubmissionFromNode();
    error ReportingFutureBlockData();
    error InvalidMerkleRootIndex();
    error ReportingPreviousCycleData();
    error InvalidMAPDIndex();
    error PageNumberAlreadyReported();
    error NotATrustedNode();
    error InvalidERDataSource();
    error InspectionModeActive();
    error UpdateFrequencyNotSet();
    error InvalidReportingBlock();
    error ERChangeLimitCrossed();
    error ERChangeLimitNotCrossed();
    error ERPermissibleChangeOutofBounds();
    error InsufficientTrustedNodes();
    error CooldownNotComplete();

    // Events
    event ERDataSourceToggled(bool isPORBasedERData);
    event UpdatedERChangeLimit(uint256 erChangeLimit);
    event ERInspectionModeActivated(bool erInspectionMode, uint256 time);
    event ExchangeRateSubmitted(
        address indexed from,
        uint256 block,
        uint256 totalEth,
        uint256 ethxSupply,
        uint256 time
    );
    event ExchangeRateUpdated(uint256 block, uint256 totalEth, uint256 ethxSupply, uint256 time);
    event TrustedNodeAdded(address indexed node);
    event TrustedNodeRemoved(address indexed node);
    event SocializingRewardsMerkleRootSubmitted(
        address indexed node,
        uint256 index,
        bytes32 merkleRoot,
        uint8 poolId,
        uint256 block
    );
    event SocializingRewardsMerkleRootUpdated(uint256 index, bytes32 merkleRoot, uint8 poolId, uint256 block);
    event SDPriceSubmitted(address indexed node, uint256 sdPriceInETH, uint256 reportedBlock, uint256 block);
    event SDPriceUpdated(uint256 sdPriceInETH, uint256 reportedBlock, uint256 block);

    event MissedAttestationPenaltySubmitted(
        address indexed node,
        uint256 index,
        uint256 block,
        uint256 reportingBlockNumber,
        bytes[] pubkeys
    );
    event MissedAttestationPenaltyUpdated(uint256 index, uint256 block, bytes[] pubkeys);
    event UpdateFrequencyUpdated(uint256 updateFrequency);
    event ValidatorStatsSubmitted(
        address indexed from,
        uint256 block,
        uint256 activeValidatorsBalance,
        uint256 exitedValidatorsBalance,
        uint256 slashedValidatorsBalance,
        uint256 activeValidatorsCount,
        uint256 exitedValidatorsCount,
        uint256 slashedValidatorsCount,
        uint256 time
    );
    event ValidatorStatsUpdated(
        uint256 block,
        uint256 activeValidatorsBalance,
        uint256 exitedValidatorsBalance,
        uint256 slashedValidatorsBalance,
        uint256 activeValidatorsCount,
        uint256 exitedValidatorsCount,
        uint256 slashedValidatorsCount,
        uint256 time
    );
    event WithdrawnValidatorsSubmitted(
        address indexed from,
        uint8 poolId,
        uint256 block,
        bytes[] pubkeys,
        uint256 time
    );
    event WithdrawnValidatorsUpdated(uint8 poolId, uint256 block, bytes[] pubkeys, uint256 time);
    event ValidatorVerificationDetailSubmitted(
        address indexed from,
        uint8 poolId,
        uint256 block,
        bytes[] sortedReadyToDepositPubkeys,
        bytes[] sortedFrontRunPubkeys,
        bytes[] sortedInvalidSignaturePubkeys,
        uint256 time
    );
    event ValidatorVerificationDetailUpdated(
        uint8 poolId,
        uint256 block,
        bytes[] sortedReadyToDepositPubkeys,
        bytes[] sortedFrontRunPubkeys,
        bytes[] sortedInvalidSignaturePubkeys,
        uint256 time
    );
    event SafeModeEnabled();
    event SafeModeDisabled();
    event UpdatedStaderConfig(address staderConfig);
    event TrustedNodeChangeCoolingPeriodUpdated(uint256 trustedNodeChangeCoolingPeriod);

    // methods

    function addTrustedNode(address _nodeAddress) external;

    function removeTrustedNode(address _nodeAddress) external;

    /**
     * @notice submit exchange rate data by trusted oracle nodes
    @dev Submits the given balances for a specified block number.
    @param _exchangeRate The exchange rate to submit.
    */
    function submitExchangeRateData(ExchangeRate calldata _exchangeRate) external;

    //update the exchange rate via POR Feed data
    function updateERFromPORFeed() external;

    //update exchange rate via POR Feed when ER change limit is crossed
    function closeERInspectionMode() external;

    function disableERInspectionMode() external;

    /**
    @notice Submits the root of the merkle tree containing the socializing rewards.
    sends user ETH Rewards to SSPM
    sends protocol ETH Rewards to stader treasury
    @param _rewardsData contains rewards merkleRoot and rewards split
    */
    function submitSocializingRewardsMerkleRoot(RewardsData calldata _rewardsData) external;

    function submitSDPrice(SDPriceData calldata _sdPriceData) external;

    /**
     * @notice Submit validator stats for a specific block.
     * @dev This function can only be called by trusted nodes.
     * @param _validatorStats The validator stats to submit.
     *
     * Function Flow:
     * 1. Validates that the submission is for a past block and not a future one.
     * 2. Validates that the submission is for a block higher than the last block number with updated counts.
     * 3. Generates submission keys using the input parameters.
     * 4. Validates that this is not a duplicate submission from the same node.
     * 5. Updates the submission count for the given counts.
     * 6. Emits a ValidatorCountsSubmitted event with the submitted data.
     * 7. If the submission count reaches a majority (trustedNodesCount / 2 + 1), checks whether the counts are not already updated,
     *    then updates the validator counts, and emits a CountsUpdated event.
     */
    function submitValidatorStats(ValidatorStats calldata _validatorStats) external;

    /// @notice Submit the withdrawn validators list to the oracle.
    /// @dev The function checks if the submitted data is for a valid and newer block,
    ///      and if the submission count reaches the required threshold, it updates the withdrawn validators list (NodeRegistry).
    /// @param _withdrawnValidators The withdrawn validators data, including blockNumber and sorted pubkeys.
    function submitWithdrawnValidators(WithdrawnValidators calldata _withdrawnValidators) external;

    /**
     * @notice submit the ready to deposit keys, front run keys and invalid signature keys
     * @dev The function checks if the submitted data is for a valid and newer block,
     *  and if the submission count reaches the required threshold, it updates the markValidatorReadyToDeposit (NodeRegistry).
     * @param _validatorVerificationDetail validator verification data, containing valid pubkeys, front run and invalid signature
     */
    function submitValidatorVerificationDetail(ValidatorVerificationDetail calldata _validatorVerificationDetail)
        external;

    /**
     * @notice store the missed attestation penalty strike on validator
     * @dev _missedAttestationPenaltyData.index should not be zero
     * @param _mapd missed attestation penalty data
     */
    function submitMissedAttestationPenalties(MissedAttestationPenaltyData calldata _mapd) external;

    // setters
    // enable the safeMode depending on network and protocol health
    function enableSafeMode() external;

    // disable safe mode
    function disableSafeMode() external;

    function updateStaderConfig(address _staderConfig) external;

    function setERUpdateFrequency(uint256 _updateFrequency) external;

    function setSDPriceUpdateFrequency(uint256 _updateFrequency) external;

    function setValidatorStatsUpdateFrequency(uint256 _updateFrequency) external;

    function setValidatorVerificationDetailUpdateFrequency(uint256 _updateFrequency) external;

    function setWithdrawnValidatorsUpdateFrequency(uint256 _updateFrequency) external;

    function setMissedAttestationPenaltyUpdateFrequency(uint256 _updateFrequency) external;

    function updateERChangeLimit(uint256 _erChangeLimit) external;

    function togglePORFeedBasedERData() external;

    // getters
    function trustedNodeChangeCoolingPeriod() external view returns (uint256);

    function lastTrustedNodeCountChangeBlock() external view returns (uint256);

    function erInspectionMode() external view returns (bool);

    function isPORFeedBasedERData() external view returns (bool);

    function staderConfig() external view returns (IStaderConfig);

    function erChangeLimit() external view returns (uint256);

    // returns the last reported block number of withdrawn validators for a poolId
    function lastReportingBlockNumberForWithdrawnValidatorsByPoolId(uint8) external view returns (uint256);

    // returns the last reported block number of validator verification detail for a poolId
    function lastReportingBlockNumberForValidatorVerificationDetailByPoolId(uint8) external view returns (uint256);

    // returns the count of trusted nodes
    function trustedNodesCount() external view returns (uint256);

    //returns the latest consensus index for missed attestation penalty data report
    function lastReportedMAPDIndex() external view returns (uint256);

    function erInspectionModeStartBlock() external view returns (uint256);

    function safeMode() external view returns (bool);

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

    function missedAttestationPenalty(bytes32 _pubkey) external view returns (uint16);

    // The last updated merkle tree index
    function getCurrentRewardsIndexByPoolId(uint8 _poolId) external view returns (uint256);

    function getERReportableBlock() external view returns (uint256);

    function getMerkleRootReportableBlockByPoolId(uint8 _poolId) external view returns (uint256);

    function getSDPriceReportableBlock() external view returns (uint256);

    function getValidatorStatsReportableBlock() external view returns (uint256);

    function getWithdrawnValidatorReportableBlock() external view returns (uint256);

    function getValidatorVerificationDetailReportableBlock() external view returns (uint256);

    function getMissedAttestationPenaltyReportableBlock() external view returns (uint256);

    function getExchangeRate() external view returns (ExchangeRate memory);

    function getValidatorStats() external view returns (ValidatorStats memory);

    // returns price of 1 SD in ETH
    function getSDPriceInETH() external view returns (uint256);
}

File 20 of 23 : IStaderStakePoolManager.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.16;

interface IStaderStakePoolManager {
    // Errors
    error InvalidDepositAmount();
    error UnsupportedOperation();
    error InsufficientBalance();
    error TransferFailed();
    error PoolIdDoesNotExit();
    error CooldownNotComplete();
    error UnsupportedOperationInSafeMode();

    // Events
    event UpdatedStaderConfig(address staderConfig);
    event Deposited(address indexed caller, address indexed owner, uint256 assets, uint256 shares);
    event ExecutionLayerRewardsReceived(uint256 amount);
    event AuctionedEthReceived(uint256 amount);
    event ReceivedExcessEthFromPool(uint8 indexed poolId);
    event TransferredETHToUserWithdrawManager(uint256 amount);
    event ETHTransferredToPool(uint256 indexed poolId, address poolAddress, uint256 validatorCount);
    event WithdrawVaultUserShareReceived(uint256 amount);
    event UpdatedExcessETHDepositCoolDown(uint256 excessETHDepositCoolDown);

    function deposit(address _receiver) external payable returns (uint256);

    function previewDeposit(uint256 _assets) external view returns (uint256);

    function previewWithdraw(uint256 _shares) external view returns (uint256);

    function getExchangeRate() external view returns (uint256);

    function totalAssets() external view returns (uint256);

    function convertToShares(uint256 _assets) external view returns (uint256);

    function convertToAssets(uint256 _shares) external view returns (uint256);

    function maxDeposit() external view returns (uint256);

    function minDeposit() external view returns (uint256);

    function receiveExecutionLayerRewards() external payable;

    function receiveWithdrawVaultUserShare() external payable;

    function receiveEthFromAuction() external payable;

    function receiveExcessEthFromPool(uint8 _poolId) external payable;

    function transferETHToUserWithdrawManager(uint256 _amount) external;

    function validatorBatchDeposit(uint8 _poolId) external;

    function depositETHOverTargetWeight() external;

    function isVaultHealthy() external view returns (bool);
}

File 21 of 23 : IVaultProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import './IStaderConfig.sol';

interface IVaultProxy {
    error CallerNotOwner();
    error AlreadyInitialized();
    event UpdatedOwner(address owner);
    event UpdatedStaderConfig(address staderConfig);

    //Getters
    function vaultSettleStatus() external view returns (bool);

    function isValidatorWithdrawalVault() external view returns (bool);

    function isInitialized() external view returns (bool);

    function poolId() external view returns (uint8);

    function id() external view returns (uint256);

    function owner() external view returns (address);

    function staderConfig() external view returns (IStaderConfig);

    //Setters
    function updateOwner() external;

    function updateStaderConfig(address _staderConfig) external;
}

File 22 of 23 : UtilLib.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import '../interfaces/IStaderConfig.sol';
import '../interfaces/INodeRegistry.sol';
import '../interfaces/IPoolUtils.sol';
import '../interfaces/IVaultProxy.sol';

library UtilLib {
    error ZeroAddress();
    error InvalidPubkeyLength();
    error CallerNotManager();
    error CallerNotOperator();
    error CallerNotStaderContract();
    error CallerNotWithdrawVault();
    error TransferFailed();

    uint64 private constant VALIDATOR_PUBKEY_LENGTH = 48;

    /// @notice zero address check modifier
    function checkNonZeroAddress(address _address) internal pure {
        if (_address == address(0)) revert ZeroAddress();
    }

    //checks for Manager role in staderConfig
    function onlyManagerRole(address _addr, IStaderConfig _staderConfig) internal view {
        if (!_staderConfig.onlyManagerRole(_addr)) {
            revert CallerNotManager();
        }
    }

    function onlyOperatorRole(address _addr, IStaderConfig _staderConfig) internal view {
        if (!_staderConfig.onlyOperatorRole(_addr)) {
            revert CallerNotOperator();
        }
    }

    //checks if caller is a stader contract address
    function onlyStaderContract(
        address _addr,
        IStaderConfig _staderConfig,
        bytes32 _contractName
    ) internal view {
        if (!_staderConfig.onlyStaderContract(_addr, _contractName)) {
            revert CallerNotStaderContract();
        }
    }

    function getPubkeyForValidSender(
        uint8 _poolId,
        uint256 _validatorId,
        address _addr,
        IStaderConfig _staderConfig
    ) internal view returns (bytes memory) {
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(_poolId);
        (, bytes memory pubkey, , , address withdrawVaultAddress, , , ) = INodeRegistry(nodeRegistry).validatorRegistry(
            _validatorId
        );
        if (_addr != withdrawVaultAddress) {
            revert CallerNotWithdrawVault();
        }
        return pubkey;
    }

    function getOperatorForValidSender(
        uint8 _poolId,
        uint256 _validatorId,
        address _addr,
        IStaderConfig _staderConfig
    ) internal view returns (address) {
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(_poolId);
        (, , , , address withdrawVaultAddress, uint256 operatorId, , ) = INodeRegistry(nodeRegistry).validatorRegistry(
            _validatorId
        );
        if (_addr != withdrawVaultAddress) {
            revert CallerNotWithdrawVault();
        }
        (, , , , address operator) = INodeRegistry(nodeRegistry).operatorStructById(operatorId);
        return operator;
    }

    function onlyValidatorWithdrawVault(
        uint8 _poolId,
        uint256 _validatorId,
        address _addr,
        IStaderConfig _staderConfig
    ) internal view {
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(_poolId);
        (, , , , address withdrawVaultAddress, , , ) = INodeRegistry(nodeRegistry).validatorRegistry(_validatorId);
        if (_addr != withdrawVaultAddress) {
            revert CallerNotWithdrawVault();
        }
    }

    function getOperatorAddressByValidatorId(
        uint8 _poolId,
        uint256 _validatorId,
        IStaderConfig _staderConfig
    ) internal view returns (address) {
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(_poolId);
        (, , , , , uint256 operatorId, , ) = INodeRegistry(nodeRegistry).validatorRegistry(_validatorId);
        (, , , , address operatorAddress) = INodeRegistry(nodeRegistry).operatorStructById(operatorId);

        return operatorAddress;
    }

    function getOperatorAddressByOperatorId(
        uint8 _poolId,
        uint256 _operatorId,
        IStaderConfig _staderConfig
    ) internal view returns (address) {
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(_poolId);
        (, , , , address operatorAddress) = INodeRegistry(nodeRegistry).operatorStructById(_operatorId);

        return operatorAddress;
    }

    function getOperatorRewardAddress(address _operator, IStaderConfig _staderConfig)
        internal
        view
        returns (address payable)
    {
        uint8 poolId = IPoolUtils(_staderConfig.getPoolUtils()).getOperatorPoolId(_operator);
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(poolId);
        uint256 operatorId = INodeRegistry(nodeRegistry).operatorIDByAddress(_operator);
        return INodeRegistry(nodeRegistry).getOperatorRewardAddress(operatorId);
    }

    /**
     * @notice Computes the public key root.
     * @param _pubkey The validator public key for which to compute the root.
     * @return The root of the public key.
     */
    function getPubkeyRoot(bytes calldata _pubkey) internal pure returns (bytes32) {
        if (_pubkey.length != VALIDATOR_PUBKEY_LENGTH) {
            revert InvalidPubkeyLength();
        }

        // Append 16 bytes of zero padding to the pubkey and compute its hash to get the pubkey root.
        return sha256(abi.encodePacked(_pubkey, bytes16(0)));
    }

    function getValidatorSettleStatus(bytes calldata _pubkey, IStaderConfig _staderConfig)
        internal
        view
        returns (bool)
    {
        uint8 poolId = IPoolUtils(_staderConfig.getPoolUtils()).getValidatorPoolId(_pubkey);
        address nodeRegistry = IPoolUtils(_staderConfig.getPoolUtils()).getNodeRegistry(poolId);
        uint256 validatorId = INodeRegistry(nodeRegistry).validatorIdByPubkey(_pubkey);
        (, , , , address withdrawVaultAddress, , , ) = INodeRegistry(nodeRegistry).validatorRegistry(validatorId);
        return IVaultProxy(withdrawVaultAddress).vaultSettleStatus();
    }

    function computeExchangeRate(
        uint256 totalETHBalance,
        uint256 totalETHXSupply,
        IStaderConfig _staderConfig
    ) internal view returns (uint256) {
        uint256 DECIMALS = _staderConfig.getDecimals();
        uint256 newExchangeRate = (totalETHBalance == 0 || totalETHXSupply == 0)
            ? DECIMALS
            : (totalETHBalance * DECIMALS) / totalETHXSupply;
        return newExchangeRate;
    }

    function sendValue(address _receiver, uint256 _amount) internal {
        (bool success, ) = payable(_receiver).call{value: _amount}('');
        if (!success) {
            revert TransferFailed();
        }
    }
}

File 23 of 23 : ValidatorStatus.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

enum ValidatorStatus {
    INITIALIZED,
    INVALID_SIGNATURE,
    FRONT_RUN,
    PRE_DEPOSIT,
    DEPOSITED,
    WITHDRAWN
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [],
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CallerNotManager","type":"error"},{"inputs":[],"name":"CooldownNotComplete","type":"error"},{"inputs":[],"name":"DuplicateSubmissionFromNode","type":"error"},{"inputs":[],"name":"ERChangeLimitCrossed","type":"error"},{"inputs":[],"name":"ERChangeLimitNotCrossed","type":"error"},{"inputs":[],"name":"ERPermissibleChangeOutofBounds","type":"error"},{"inputs":[],"name":"FrequencyUnchanged","type":"error"},{"inputs":[],"name":"InspectionModeActive","type":"error"},{"inputs":[],"name":"InsufficientTrustedNodes","type":"error"},{"inputs":[],"name":"InvalidERDataSource","type":"error"},{"inputs":[],"name":"InvalidMAPDIndex","type":"error"},{"inputs":[],"name":"InvalidMerkleRootIndex","type":"error"},{"inputs":[],"name":"InvalidPubkeyLength","type":"error"},{"inputs":[],"name":"InvalidReportingBlock","type":"error"},{"inputs":[],"name":"InvalidUpdate","type":"error"},{"inputs":[],"name":"NodeAlreadyTrusted","type":"error"},{"inputs":[],"name":"NodeNotTrusted","type":"error"},{"inputs":[],"name":"NotATrustedNode","type":"error"},{"inputs":[],"name":"PageNumberAlreadyReported","type":"error"},{"inputs":[],"name":"ReportingFutureBlockData","type":"error"},{"inputs":[],"name":"ReportingPreviousCycleData","type":"error"},{"inputs":[],"name":"UpdateFrequencyNotSet","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroFrequency","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPORBasedERData","type":"bool"}],"name":"ERDataSourceToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"erInspectionMode","type":"bool"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ERInspectionModeActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalEth","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ExchangeRateSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalEth","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ExchangeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"}],"name":"MissedAttestationPenaltySubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"}],"name":"MissedAttestationPenaltyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":false,"internalType":"uint256","name":"sdPriceInETH","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reportedBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"SDPriceSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"sdPriceInETH","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reportedBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"SDPriceUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"SafeModeDisabled","type":"event"},{"anonymous":false,"inputs":[],"name":"SafeModeEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"SocializingRewardsMerkleRootSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"}],"name":"SocializingRewardsMerkleRootUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"}],"name":"TrustedNodeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"trustedNodeChangeCoolingPeriod","type":"uint256"}],"name":"TrustedNodeChangeCoolingPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"}],"name":"TrustedNodeRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"updateFrequency","type":"uint256"}],"name":"UpdateFrequencyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"erChangeLimit","type":"uint256"}],"name":"UpdatedERChangeLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"staderConfig","type":"address"}],"name":"UpdatedStaderConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exitedValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exitedValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ValidatorStatsSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exitedValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedValidatorsBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exitedValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slashedValidatorsCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ValidatorStatsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"sortedReadyToDepositPubkeys","type":"bytes[]"},{"indexed":false,"internalType":"bytes[]","name":"sortedFrontRunPubkeys","type":"bytes[]"},{"indexed":false,"internalType":"bytes[]","name":"sortedInvalidSignaturePubkeys","type":"bytes[]"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ValidatorVerificationDetailSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"sortedReadyToDepositPubkeys","type":"bytes[]"},{"indexed":false,"internalType":"bytes[]","name":"sortedFrontRunPubkeys","type":"bytes[]"},{"indexed":false,"internalType":"bytes[]","name":"sortedInvalidSignaturePubkeys","type":"bytes[]"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ValidatorVerificationDetailUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"WithdrawnValidatorsSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"poolId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"bytes[]","name":"pubkeys","type":"bytes[]"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"WithdrawnValidatorsUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ER_CHANGE_MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETHX_ER_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ER_UPDATE_FREQUENCY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TRUSTED_NODES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MISSED_ATTESTATION_PENALTY_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SD_PRICE_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_STATS_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_VERIFICATION_DETAIL_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWN_VALIDATORS_UF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"addTrustedNode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeERInspectionMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableERInspectionMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableSafeMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableSafeMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erChangeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erInspectionMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erInspectionModeStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"totalETHBalance","type":"uint256"},{"internalType":"uint256","name":"totalETHXSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_poolId","type":"uint8"}],"name":"getCurrentRewardsIndexByPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getERReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExchangeRate","outputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"totalETHBalance","type":"uint256"},{"internalType":"uint256","name":"totalETHXSupply","type":"uint256"}],"internalType":"struct ExchangeRate","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_poolId","type":"uint8"}],"name":"getMerkleRootReportableBlockByPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMissedAttestationPenaltyReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSDPriceInETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSDPriceReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getValidatorStats","outputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint128","name":"exitingValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"exitedValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"slashedValidatorsBalance","type":"uint128"},{"internalType":"uint32","name":"exitingValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"exitedValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"slashedValidatorsCount","type":"uint32"}],"internalType":"struct ValidatorStats","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getValidatorStatsReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getValidatorVerificationDetailReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWithdrawnValidatorReportableBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_staderConfig","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"inspectionModeExchangeRate","outputs":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"totalETHBalance","type":"uint256"},{"internalType":"uint256","name":"totalETHXSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPORFeedBasedERData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isTrustedNode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastReportedMAPDIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastReportedSDPriceData","outputs":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"sdPriceInETH","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"lastReportingBlockNumberForValidatorVerificationDetailByPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"lastReportingBlockNumberForWithdrawnValidatorsByPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTrustedNodeCountChangeBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"missedAttestationPenalty","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"removeTrustedNode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"safeMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setERUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setMissedAttestationPenaltyUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setSDPriceUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setValidatorStatsUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setValidatorVerificationDetailUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_updateFrequency","type":"uint256"}],"name":"setWithdrawnValidatorsUpdateFrequency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staderConfig","outputs":[{"internalType":"contract IStaderConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"totalETHBalance","type":"uint256"},{"internalType":"uint256","name":"totalETHXSupply","type":"uint256"}],"internalType":"struct ExchangeRate","name":"_exchangeRate","type":"tuple"}],"name":"submitExchangeRateData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes[]","name":"sortedPubkeys","type":"bytes[]"}],"internalType":"struct MissedAttestationPenaltyData","name":"_mapd","type":"tuple"}],"name":"submitMissedAttestationPenalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"sdPriceInETH","type":"uint256"}],"internalType":"struct SDPriceData","name":"_sdPriceData","type":"tuple"}],"name":"submitSDPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint8","name":"poolId","type":"uint8"},{"internalType":"uint256","name":"operatorETHRewards","type":"uint256"},{"internalType":"uint256","name":"userETHRewards","type":"uint256"},{"internalType":"uint256","name":"protocolETHRewards","type":"uint256"},{"internalType":"uint256","name":"operatorSDRewards","type":"uint256"}],"internalType":"struct RewardsData","name":"_rewardsData","type":"tuple"}],"name":"submitSocializingRewardsMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint128","name":"exitingValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"exitedValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"slashedValidatorsBalance","type":"uint128"},{"internalType":"uint32","name":"exitingValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"exitedValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"slashedValidatorsCount","type":"uint32"}],"internalType":"struct ValidatorStats","name":"_validatorStats","type":"tuple"}],"name":"submitValidatorStats","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"poolId","type":"uint8"},{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"bytes[]","name":"sortedReadyToDepositPubkeys","type":"bytes[]"},{"internalType":"bytes[]","name":"sortedFrontRunPubkeys","type":"bytes[]"},{"internalType":"bytes[]","name":"sortedInvalidSignaturePubkeys","type":"bytes[]"}],"internalType":"struct ValidatorVerificationDetail","name":"_validatorVerificationDetail","type":"tuple"}],"name":"submitValidatorVerificationDetail","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"poolId","type":"uint8"},{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"bytes[]","name":"sortedPubkeys","type":"bytes[]"}],"internalType":"struct WithdrawnValidators","name":"_withdrawnValidators","type":"tuple"}],"name":"submitWithdrawnValidators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"togglePORFeedBasedERData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"trustedNodeChangeCoolingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedNodesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_erChangeLimit","type":"uint256"}],"name":"updateERChangeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateERFromPORFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"updateFrequencyMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staderConfig","type":"address"}],"name":"updateStaderConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_trustedNodeChangeCoolingPeriod","type":"uint256"}],"name":"updateTrustedNodeChangeCoolingPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validatorStats","outputs":[{"internalType":"uint256","name":"reportingBlockNumber","type":"uint256"},{"internalType":"uint128","name":"exitingValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"exitedValidatorsBalance","type":"uint128"},{"internalType":"uint128","name":"slashedValidatorsBalance","type":"uint128"},{"internalType":"uint32","name":"exitingValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"exitedValidatorsCount","type":"uint32"},{"internalType":"uint32","name":"slashedValidatorsCount","type":"uint32"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b614b8780620000f36000396000f3fe608060405234801561001057600080fd5b506004361061043e5760003560e01c80639773ee6011610236578063c06a62011161013b578063e36c3140116100c3578063f00e022311610087578063f00e022314610aad578063f10b256914610ace578063f51c0fe714610ad7578063f6a3c09014610aea578063fc8b821c14610afd57600080fd5b8063e36c314014610a4b578063e514fe5514610a53578063e61befa714610a5b578063e6aa216c14610a70578063ea18568b14610a9a57600080fd5b8063d6275dd71161010a578063d6275dd714610a08578063de271c6d14610a1b578063e0bcb37814610a25578063e10025e614610a2e578063e2f6339214610a3657600080fd5b8063c06a6201146109bc578063d06628ed146109cf578063d0a8f679146109e2578063d547741f146109f557600080fd5b8063a71b3907116101be578063ae815a041161018d578063ae815a0414610960578063b17b4d861461096a578063b5c25ba61461098b578063b940a00314610993578063be48e58d146109a757600080fd5b8063a71b390714610914578063a8c3a3a81461091c578063abe3219c1461093f578063ae541d651461094d57600080fd5b8063a0c5438711610205578063a0c54387146108d4578063a217fddf146108e7578063a220c2d3146108ef578063a373786914610902578063a6870e5b1461090c57600080fd5b80639773ee601461087757806397a3a10a146108af5780639bfdf9a4146108b95780639ee804cb146108c157600080fd5b806349115a2e11610347578063712033eb116102cf578063844007fe11610293578063844007fe146108235780638456cb59146108365780638ca8703c1461083e57806391d1485414610851578063962c1e051461086457600080fd5b8063712033eb146107c15780637150bc5b146107c9578063735efb96146107ea578063749f7d8a146107fd578063818c8b261461081057600080fd5b80635c7ccd3b116103165780635c7ccd3b1461077e5780635c975abb14610791578063615a02531461079c57806361f00c17146107a457806367fbf731146107ae57600080fd5b806349115a2e146107535780634f560abd1461075b5780635063b5bd1461076357806352e0fc801461076b57600080fd5b80632f739b1d116103ca5780633ba0b9a9116103995780633ba0b9a9146105b95780633e23a827146105e95780633f4ba83a1461070d578063485cc95514610715578063490ffa351461072857600080fd5b80632f739b1d14610514578063342280b31461053857806336568abe146105455780633b5eb03a1461055857600080fd5b8063127103611161041157806312710361146104a257806316515428146104b7578063248a9ca3146104c957806329f96856146104ec5780632f2ff15d1461050157600080fd5b806301ffc9a714610443578063052a68401461046b5780630989001c1461048e578063101b6e3414610498575b600080fd5b610456610451366004613f86565b610b05565b60405190151581526020015b60405180910390f35b610480600080516020614ab283398151915281565b604051908152602001610462565b61048061010d5481565b6104a0610b3c565b005b610480600080516020614a9283398151915281565b60fb5461045690610100900460ff1681565b6104806104d7366004613fb0565b60009081526065602052604090206001015490565b610480600080516020614b3283398151915281565b6104a061050f366004613fde565b610b87565b61045661052236600461400e565b61010f6020526000908152604090205460ff1681565b60fb546104569060ff1681565b6104a0610553366004613fde565b610bb1565b6101055461010654610107546105a692916001600160801b0380821692600160801b928390048216929181169163ffffffff908204811691600160a01b8104821691600160c01b9091041687565b604051610462979695949392919061402b565b6101025461010354610104546105ce92919083565b60408051938452602084019290925290820152606001610462565b6106986040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506040805160e081018252610105548152610106546001600160801b038082166020840152600160801b9182900481169383019390935261010754928316606083015263ffffffff90830481166080830152600160a01b8304811660a0830152600160c01b90920490911660c082015290565b6040516104629190600060e0820190508251825260208301516001600160801b0380821660208501528060408601511660408501528060608601511660608501525050608083015163ffffffff80821660808501528060a08601511660a08501528060c08601511660c0850152505092915050565b6104a0610c34565b6104a061072336600461406f565b610c4a565b60fe5461073b906001600160a01b031681565b6040516001600160a01b039091168152602001610462565b610480610e84565b6104a0610ea2565b610480610ef2565b6104a061077936600461400e565b610f0b565b6104a061078c36600461409d565b611008565b60975460ff16610456565b6104806113f6565b6104806101095481565b6104a06107bc3660046140c7565b61140f565b6104a0611701565b6104806107d7366004613fb0565b6101166020526000908152604090205481565b6104a06107f8366004614104565b61179e565b6104a061080b366004613fb0565b611c6d565b6104a061081e36600461413f565b611c9c565b6104a0610831366004613fb0565b611eed565b6104a0611f1c565b6104a061084c366004613fb0565b611f3b565b61045661085f366004613fde565b611fbb565b6104a0610872366004613fb0565b611fe6565b61089c610885366004613fb0565b6101126020526000908152604090205461ffff1681565b60405161ffff9091168152602001610462565b6104806101085481565b6104a0612033565b6104a06108cf36600461400e565b6120a4565b6104806108e2366004614171565b61210e565b610480600081565b6104a06108fd3660046140c7565b61225f565b61048061010b5481565b60fd54610480565b61048061269f565b60fc5460fd5461092a919082565b60408051928352602083019190915201610462565b61010e546104569060ff1681565b6104a061095b36600461418c565b6126b8565b61048061010a5481565b610480610978366004614171565b6101146020526000908152604090205481565b610480612b06565b60ff5461010054610101546105ce92919083565b610480600080516020614ad283398151915281565b6104a06109ca366004613fb0565b612b1f565b6104806109dd366004614171565b612b4e565b6104a06109f0366004613fb0565b612c8a565b6104a0610a03366004613fde565b612cdc565b6104a0610a1636600461400e565b612d01565b61048061010c5481565b61048061271081565b6104a0612e02565b610480600080516020614b1283398151915281565b610480600581565b6104a0612ebc565b610480600080516020614af283398151915281565b610a78612efe565b6040805182518152602080840151908201529181015190820152606001610462565b6104a0610aa8366004613fb0565b612f4a565b610480610abb366004614171565b6101136020526000908152604090205481565b61048061c4e081565b6104a0610ae5366004613fb0565b612f79565b6104a0610af836600461419f565b612fa8565b6104806131bf565b60006001600160e01b03198216637965db0b60e01b1480610b3657506301ffc9a760e01b6001600160e01b03198316145b92915050565b610b446131d8565b60fb5460ff16610b675760405163b1df7eb360e01b815260040160405180910390fd5b610b6f612e02565b610100546101015460ff54610b8592919061321e565b565b600082815260656020526040902060010154610ba281613274565b610bac838361327e565b505050565b6001600160a01b0381163314610c265760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c308282613304565b5050565b6000610c3f81613274565b610c4761336b565b50565b600054610100900460ff1615808015610c6a5750600054600160ff909116105b80610c845750303b158015610c84575060005460ff166001145b610ce75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c1d565b6000805460ff191660011790558015610d0a576000805461ff0019166101001790555b610d13836133b8565b610d1c826133b8565b610d246133df565b610d2c613406565b610d34613435565b6101f461010855610d55600080516020614a92833981519152611c20613464565b610d6f600080516020614b12833981519152611c20613464565b610d89600080516020614b32833981519152611c20613464565b610da3600080516020614af2833981519152613840613464565b610dbd600080516020614ab283398151915261c4e0613464565b610dd7600080516020614ad2833981519152611c20613464565b60fe80546001600160a01b0319166001600160a01b038416179055610dfd60008461327e565b6040516001600160a01b03831681527fdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b44859060200160405180910390a18015610bac576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b6000610e9d600080516020614b328339815191526134f8565b905090565b60fe54610eb99033906001600160a01b0316613544565b61010e805460ff191660011790556040517f3328bda355014adfb66d5d9086ab2c3204d1af7f83a69a3276daeed721f6ce3c90600090a1565b6000610e9d600080516020614af28339815191526134f8565b60fe54610f229033906001600160a01b0316613544565b610f2b816133b8565b6001600160a01b038116600090815261010f602052604090205460ff16610f655760405163f9644b0760e01b815260040160405180910390fd5b6101095461010d54610f7791906141c7565b431015610f975760405163111bb2f160e31b815260040160405180910390fd5b4361010d556001600160a01b038116600090815261010f60205260408120805460ff1916905561010a805491610fcc836141da565b90915550506040516001600160a01b038216907f6d1de2fb0c63996bae7ba6277c720c0560ba42874ea34c1ebe8e1423b9b4742190600090a250565b33600090815261010f602052604090205460ff1661103957604051633e2100a160e01b815260040160405180910390fd5b600561010a54101561105e5760405163dfffd22f60e01b815260040160405180910390fd5b6110666131d8565b4381351061108757604051633bb0413f60e01b815260040160405180910390fd5b600080516020614b3283398151915260009081526101166020527f0683174ee47ba7ded338389c4047f439d06240e01796e9941d2e1ad04002de1b546110ce908335614207565b11156110ed5760405163222ea98560e01b815260040160405180910390fd5b60003382356111026040850160208601614230565b6111126060860160408701614230565b6111226080870160608801614230565b61113260a088016080890161425f565b61114260c0890160a08a0161425f565b61115260e08a0160c08b0161425f565b604080516001600160a01b0390991660208a01528801969096526001600160801b0394851660608801529284166080870152921660a085015263ffffffff91821660c0850152811660e08401521661010082015261012001604051602081830303815290604052805190602001209050600082600001358360200160208101906111dc9190614230565b6111ec6060860160408701614230565b6111fc6080870160608801614230565b61120c60a088016080890161425f565b61121c60c0890160a08a0161425f565b61122c60e08a0160c08b0161425f565b604051602001611242979695949392919061402b565b604051602081830303815290604052805190602001209050600061126683836135cb565b9050337f72745b0271618e5d84d738ea416e3a3be6eb267e0f639198f63c0ef124c29ffc853561129c6040880160208901614230565b6112ac6060890160408a01614230565b6112bc60808a0160608b01614230565b6112cc60a08b0160808c0161425f565b6112dc60c08c0160a08d0161425f565b6112ec60e08d0160c08e0161425f565b4260405161130198979695949392919061427c565b60405180910390a2600261010a5461131991906142c9565b6113249060016141c7565b8160ff16101580156113395750610105548435115b156113f0578361010561134c82826142ea565b507f6988248fd82a7ce842fbdce0c49889ad926bf1548bae4194de0006498d069c94905084356113826040870160208801614230565b6113926060880160408901614230565b6113a26080890160608a01614230565b6113b260a08a0160808b0161425f565b6113c260c08b0160a08c0161425f565b6113d260e08c0160c08d0161425f565b426040516113e798979695949392919061427c565b60405180910390a15b50505050565b6000610e9d600080516020614ad28339815191526134f8565b33600090815261010f602052604090205460ff1661144057604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156114655760405163dfffd22f60e01b815260040160405180910390fd5b61146d6131d8565b4381351061148e57604051633bb0413f60e01b815260040160405180910390fd5b61149661269f565b8135146114b65760405163222ea98560e01b815260040160405180910390fd5b61010b546114c59060016141c7565b8160200135146114e85760405163b59f801760e01b815260040160405180910390fd5b60006114f76040830183614404565b604051602001611508929190614510565b604051602081830303815290604052905060003383602001358360405160200161153493929190614574565b604051602081830303815290604052805190602001209050600083602001358360405160200161156592919061459b565b604051602081830303815290604052805190602001209050600061158983836135cb565b9050337f51308cad1da8fe95d4be43112c17d5651d3e3713a675ec61c2214fa16d9f6beb60208701354388356115c260408b018b614404565b6040516115d39594939291906145b4565b60405180910390a2600261010a546115eb91906142c9565b6115f69060016141c7565b8160ff16106116fa57602085013561010b5560006116176040870187614404565b9050905060005b818110156116ab57600061165f61163860408a018a614404565b84818110611648576116486145e5565b905060200281019061165a91906145fb565b613668565b600081815261011260205260408120805492935061ffff909216919061168483614642565b91906101000a81548161ffff021916908361ffff160217905550508160010191505061161e565b507f5454855cf2eeb89296b9e10ba0881425fa305f06ce9ccb1b0ce47bc2f107a1916020870135436116e060408a018a614404565b6040516116f09493929190614663565b60405180910390a1505b5050505050565b60fb5460ff161561172557604051632178bc4d60e11b815260040160405180910390fd5b60fe5461173c9033906001600160a01b0316613544565b60fb805460ff610100808304821615810261ff001990931692909217928390556040517fc59a5de02f9d69be770ff0d61bbc894968433bb599f9fd9c2016e149c509c5e5936117949390049091161515815260200190565b60405180910390a1565b6117a66136fe565b33600090815261010f602052604090205460ff166117d757604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156117fc5760405163dfffd22f60e01b815260040160405180910390fd5b6118046131d8565b4381602001351061182857604051633bb0413f60e01b815260040160405180910390fd5b600080516020614ad2833981519152600090815261011660209081527f7a641f2a170436cb9ff0edd342e448ed4a6e9ee295946f1b627f5ee896014a735461187291840135614207565b11156118915760405163222ea98560e01b815260040160405180910390fd5b60006118a06040830183614404565b6118ad6060850185614404565b6118ba6080870187614404565b6040516020016118cf96959493929190614683565b60408051601f1981840301815291905290506000336118f16020850185614171565b84602001358460405160200161190a94939291906146cc565b60408051601f198184030181529190528051602091820120915060009061193390850185614171565b84602001358460405160200161194b939291906146fc565b604051602081830303815290604052805190602001209050600061196f83836135cb565b9050337f9827231af99e07dd2167998d4c6855a2f78e0eead80a6a490393b1c3ead048a16119a06020880188614171565b60208801356119b260408a018a614404565b6119bf60608c018c614404565b6119cc60808e018e614404565b426040516119e29998979695949392919061471e565b60405180910390a2600261010a546119fa91906142c9565b611a059060016141c7565b8160ff1610158015611a4057506101146000611a246020880188614171565b60ff1660ff168152602001908152602001600020548560200135115b15611c5f576020850180359061011490600090611a5d9089614171565b60ff16815260208082019290925260409081016000209290925560fe5482516306ccb9d760e41b815292516001600160a01b0390911692636ccb9d709260048083019391928290030181865afa158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190614780565b6001600160a01b03166399d055c8611afa6020880188614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa158015611b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5c9190614780565b6001600160a01b03166313797bff611b776040880188614404565b611b8460608a018a614404565b611b9160808c018c614404565b6040518763ffffffff1660e01b8152600401611bb296959493929190614683565b600060405180830381600087803b158015611bcc57600080fd5b505af1158015611be0573d6000803e3d6000fd5b507f64a4ab6f7a6ca6fe9c5750207ea4a9d3e2d5f5ba81f707146b7b20624f61cf119250611c149150506020870187614171565b6020870135611c266040890189614404565b611c3360608b018b614404565b611c4060808d018d614404565b42604051611c569998979695949392919061471e565b60405180910390a15b50505050610c47600160c955565b60fe54611c849033906001600160a01b0316613544565b610c47600080516020614b1283398151915282613464565b33600090815261010f602052604090205460ff16611ccd57604051633e2100a160e01b815260040160405180910390fd5b600561010a541015611cf25760405163dfffd22f60e01b815260040160405180910390fd5b60fb5460ff1615611d1657604051632178bc4d60e11b815260040160405180910390fd5b611d1e6131d8565b60fb54610100900460ff1615611d465760405162ff240360e21b815260040160405180910390fd5b43813510611d6757604051633bb0413f60e01b815260040160405180910390fd5b600080516020614a9283398151915260009081526101166020527f78e40c6661d84c085b652d9fa30921a229e88abd691be104ff2436753fe240c454611dae908335614207565b1115611dcd5760405163222ea98560e01b815260040160405180910390fd5b6040805133602080830191909152833582840152830135606082015290820135608082015260009060a00160408051808303601f190181528282528051602091820120853582850152908501358383015290840135606083015291506000906080016040516020818303038152906040528051906020012090506000611e5383836135cb565b6040805186358152602080880135908201528682013581830152426060820152905191925033917f73327a5c0fdb3104b4a0f993bc20ce59885ac5bfe5f23e4bfdd19c21fb79cb129181900360800190a2600261010a54611eb491906142c9565b611ebf9060016141c7565b8160ff1610158015611ed45750610102548435115b156113f0576113f060208501356040860135863561375e565b60fe54611f049033906001600160a01b0316613544565b610c47600080516020614b3283398151915282613464565b60fe54611f339033906001600160a01b0316613544565b610b85613873565b60fe54611f529033906001600160a01b0316613544565b801580611f60575061271081115b15611f7e5760405163b14f197760e01b815260040160405180910390fd5b6101088190556040518181527f94a97bfc9c7a83fe5f75c66931ca7d2d16372fdc244afc5db36044f3ca52a520906020015b60405180910390a150565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60fe54611ffd9033906001600160a01b0316613544565b6101098190556040518181527f4ab6bf3c94e4c92b7b93e89e984ef66d28392f440a58d91d244b6c303e85f04690602001611fb0565b60fb5460ff161561205757604051632178bc4d60e11b815260040160405180910390fd5b61205f6131d8565b60fb54610100900460ff166120865760405162ff240360e21b815260040160405180910390fd5b60008060006120936138b0565b925092509250610bac83838361375e565b60006120af81613274565b6120b8826133b8565b60fe80546001600160a01b0319166001600160a01b0384169081179091556040519081527fdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485906020015b60405180910390a15050565b60008060fe60009054906101000a90046001600160a01b03166001600160a01b0316636ccb9d706040518163ffffffff1660e01b8152600401602060405180830381865afa158015612164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121889190614780565b604051637526d42960e01b815260ff851660048201526001600160a01b039190911690637526d42990602401602060405180830381865afa1580156121d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f59190614780565b6001600160a01b031663d0c402766040518163ffffffff1660e01b8152600401606060405180830381865afa158015612232573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612256919061479d565b95945050505050565b6122676136fe565b33600090815261010f602052604090205460ff1661229857604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156122bd5760405163dfffd22f60e01b815260040160405180910390fd5b6122c56131d8565b438160200135106122e957604051633bb0413f60e01b815260040160405180910390fd5b600080516020614af2833981519152600090815261011660209081527fbc6eadc409e9002a7c49dda55566447da97ef8d5367e522b12bf4559b3c929c85461233391840135614207565b11156123525760405163222ea98560e01b815260040160405180910390fd5b60006123616040830183614404565b604051602001612372929190614510565b60408051601f1981840301815291905290506000336123946020850185614171565b8460200135846040516020016123ad94939291906146cc565b60408051601f19818403018152919052805160209182012091506000906123d690850185614171565b8460200135846040516020016123ee939291906146fc565b604051602081830303815290604052805190602001209050600061241283836135cb565b9050337f3b426b614a89830a3d92d8dead18e2ded3cba56101dbff12dddfc1c77b21fbe66124436020880188614171565b602088013561245560408a018a614404565b426040516124679594939291906147cb565b60405180910390a2600261010a5461247f91906142c9565b61248a9060016141c7565b8160ff16101580156124c5575061011360006124a96020880188614171565b60ff1660ff168152602001908152602001600020548560200135115b15611c5f5760208501803590610113906000906124e29089614171565b60ff16815260208082019290925260409081016000209290925560fe5482516306ccb9d760e41b815292516001600160a01b0390911692636ccb9d709260048083019391928290030181865afa158015612540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125649190614780565b6001600160a01b03166399d055c861257f6020880188614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa1580156125bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125e19190614780565b6001600160a01b031663264f27f36125fc6040880188614404565b6040518363ffffffff1660e01b8152600401612619929190614510565b600060405180830381600087803b15801561263357600080fd5b505af1158015612647573d6000803e3d6000fd5b507f5209293842928a1567d714f34fed8d87769d89d29dfb20f48ea678b02337e84d925061267b9150506020870187614171565b602087013561268d6040890189614404565b42604051611c569594939291906147cb565b6000610e9d600080516020614ab28339815191526134f8565b6126c06136fe565b33600090815261010f602052604090205460ff166126f157604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156127165760405163dfffd22f60e01b815260040160405180910390fd5b61271e6131d8565b4381351061273f57604051633bb0413f60e01b815260040160405180910390fd5b6127526108e26080830160608401614171565b8135146127725760405163222ea98560e01b815260040160405180910390fd5b6127856109dd6080830160608401614171565b8160200135146127a85760405163b4bf916f60e01b815260040160405180910390fd5b600033602083013560408401356127c56080860160608701614171565b604080516001600160a01b039095166020860152840192909252606083015260ff1660808281019190915283013560a08281019190915283013560c08281019190915283013560e0828101919091528301356101008201526101200160408051601f1981840301815291815281516020928301209250600091840135908401356128556080860160608701614171565b60408051602081019490945283019190915260ff1660608201526080808501359082015260a0808501359082015260c0808501359082015260e080850135908201526101000160408051601f198184030181529181528151602092830120925033917f97f29f2f9a3ad2e8ebffd3fb4a6dbf5035b92b432c8344609b8368407dd233779190860135908601356128f16080880160608901614171565b60408051938452602084019290925260ff169082015243606082015260800160405180910390a2600061292483836135cb565b9050600261010a5461293691906142c9565b6129419060016141c7565b8160ff1610612af95760fe54604080516306ccb9d760e41b815290516000926001600160a01b031691636ccb9d709160048083019260209291908290030181865afa158015612994573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129b89190614780565b6001600160a01b0316637526d4296129d66080880160608901614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa158015612a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a389190614780565b604051630d83e4ed60e01b81529091506001600160a01b03821690630d83e4ed90612a67908890600401614800565b600060405180830381600087803b158015612a8157600080fd5b505af1158015612a95573d6000803e3d6000fd5b507f4394ee7a4ca89453c6900058c69bfaf14014d9fc4d510ead54ae47ac06d1f05e9250505060208601356040870135612ad56080890160608a01614171565b60408051938452602084019290925260ff1690820152436060820152608001611c56565b505050610c47600160c955565b6000610e9d600080516020614a928339815191526134f8565b60fe54612b369033906001600160a01b0316613544565b610c47600080516020614af283398151915282613464565b60fe54604080516306ccb9d760e41b815290516000926001600160a01b031691636ccb9d709160048083019260209291908290030181865afa158015612b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbc9190614780565b604051637526d42960e01b815260ff841660048201526001600160a01b039190911690637526d42990602401602060405180830381865afa158015612c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c299190614780565b6001600160a01b031663189956a26040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b36919061485f565b60fe54612ca19033906001600160a01b0316613544565b61c4e0811115612cc457604051637d5ba07f60e01b815260040160405180910390fd5b610c47600080516020614a9283398151915282613464565b600082815260656020526040902060010154612cf781613274565b610bac8383613304565b60fe54612d189033906001600160a01b0316613544565b612d21816133b8565b6001600160a01b038116600090815261010f602052604090205460ff1615612d5c57604051631adb013360e11b815260040160405180910390fd5b6101095461010d54612d6e91906141c7565b431015612d8e5760405163111bb2f160e31b815260040160405180910390fd5b4361010d556001600160a01b038116600090815261010f60205260408120805460ff1916600117905561010a805491612dc683614878565b90915550506040516001600160a01b038216907fff4a290f0500d113133708d378eb9a151c32d91cb8f5778cfda6328d89cfc4b890600090a250565b612e0a6131d8565b60fe546040516318903ee760e21b81523360048201526001600160a01b0390911690636240fb9c90602401602060405180830381865afa158015612e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e769190614891565b158015612e9257504361c4e061010c54612e9091906141c7565b115b15612eb05760405163111bb2f160e31b815260040160405180910390fd5b60fb805460ff19169055565b6000612ec781613274565b61010e805460ff191690556040517ff29e751b3c28b619a215d25fee98a7828471a8e554626186d3f8d122f165029290600090a150565b612f2260405180606001604052806000815260200160008152602001600081525090565b5060408051606081018252610102548152610103546020820152610104549181019190915290565b60fe54612f619033906001600160a01b0316613544565b610c47600080516020614ad283398151915282613464565b60fe54612f909033906001600160a01b0316613544565b610c47600080516020614ab283398151915282613464565b33600090815261010f602052604090205460ff16612fd957604051633e2100a160e01b815260040160405180910390fd5b600561010a541015612ffe5760405163dfffd22f60e01b815260040160405180910390fd5b4381351061301f57604051633bb0413f60e01b815260040160405180910390fd5b6130276131bf565b8135146130475760405163222ea98560e01b815260040160405180910390fd5b60fc548135116130695760405162e1442b60e41b815260040160405180910390fd5b604080513360208083019190915283358284018190528351808403850181526060840185528051908301206080808501929092528451808503909201825260a0909301909352825192019190912060006130c383836135cb565b90508060ff166001036130dd576130dd6101156000613f54565b6130ea8460200135613a80565b6040805160208681013582528635908201524381830152905133917f6c291a7ce9906b2982643002c104cb0ba9f2b9fecc8b38e9cc3cf5cfca65b4e8919081900360600190a2600361010a54600261314291906148b3565b61314c91906142c9565b6131579060016141c7565b8160ff16106113f057833560fc55602084013560fd55613178610115613b96565b60fd5560408051602086810135825286359082015243918101919091527fbc1a0795e699bbeaa982f6049ae9689f4d0e3e22d554adb7c46626be62f3b8bc906060016113e7565b6000610e9d600080516020614b128339815191526134f8565b60975460ff1615610b855760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c1d565b61010383905561010482905561010281905560408051828152602081018590529081018390524260608201527ff525f19964f35afcb9a475680bb27abecbc5e62b4d6d4f66a81a5bd7e8a107e390608001610e77565b610c478133613c0c565b6132888282611fbb565b610c305760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132c03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61330e8282611fbb565b15610c305760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b613373613c65565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001611794565b6001600160a01b038116610c475760405163d92e233d60e01b815260040160405180910390fd5b600054610100900460ff16610b855760405162461bcd60e51b8152600401610c1d906148d2565b600054610100900460ff1661342d5760405162461bcd60e51b8152600401610c1d906148d2565b610b85613cae565b600054610100900460ff1661345c5760405162461bcd60e51b8152600401610c1d906148d2565b610b85613ce1565b8060000361348557604051637036cfc960e11b815260040160405180910390fd5b6000828152610116602052604090205481036134b45760405163806e577f60e01b815260040160405180910390fd5b6000828152610116602052604090819020829055517f6231a3e049e2072a042ae727208e7650b487871f4080458371e84d6e7d391138906121029083815260200190565b60008181526101166020526040812054808203613528576040516379a715fb60e11b815260040160405180910390fd5b8061353381436142c9565b61353d91906148b3565b9392505050565b6040516318903ee760e21b81526001600160a01b038381166004830152821690636240fb9c90602401602060405180830381865afa15801561358a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ae9190614891565b610c305760405163c4230ae360e01b815260040160405180910390fd5b6000828152610110602052604081205460ff16156135fc57604051635da1eec160e11b815260040160405180910390fd5b600083815261011060209081526040808320805460ff191660011790558483526101119091528120805460ff16916136338361491d565b82546101009290920a60ff81810219909316918316021790915560009384526101116020526040909320549092169392505050565b60006030821461368b57604051639ca717ed60e01b815260040160405180910390fd5b6040516002906136a4908590859060009060200161493c565b60408051601f19818403018152908290526136be9161495a565b602060405180830381855afa1580156136db573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061353d919061485f565b600260c954036137505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c1d565b600260c955565b600160c955565b610103546101045460fe546000926137809290916001600160a01b0316613d08565b60fe5490915060009061379f90869086906001600160a01b0316613d08565b9050612710610108546127106137b59190614976565b6137bf90846148b3565b6137c991906142c9565b81101580156137ff5750612710610108546127106137e791906141c7565b6137f190846148b3565b6137fb91906142c9565b8111155b6138685760fb805460ff191660019081179091554361010c5561010086905561010185905560ff849055604080519182524260208301527f9dea6ddefbcfcf9c4f6c1c086e462c2ab380c0be199d0289bf23b09f20814415910160405180910390a15050505050565b6116fa85858561321e565b61387b6131d8565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586133a03390565b60008060008060fe60009054906101000a90046001600160a01b03166001600160a01b031663489ed6516040518163ffffffff1660e01b8152600401602060405180830381865afa158015613909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061392d9190614780565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561396a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398e91906149a3565b505050915050600060fe60009054906101000a90046001600160a01b03166001600160a01b0316632ca03f666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156139e9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0d9190614780565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a6e91906149a3565b50949891975043965090945050505050565b61011580546001818101835560008390527f77886ee853a0f02c8259429c7bfca08679ca3ab8bdec2c3bd5cca8557e06493a90910183905590549003613ac35750565b61011554600090613ad690600190614976565b90505b60018110158015613b115750610115613af3600183614976565b81548110613b0357613b036145e5565b906000526020600020015482105b15613b7157610115613b24600183614976565b81548110613b3457613b346145e5565b90600052602060002001546101158281548110613b5357613b536145e5565b60009182526020909120015580613b69816141da565b915050613ad9565b816101158281548110613b8657613b866145e5565b6000918252602090912001555050565b8054600090600283613ba882846142c9565b81548110613bb857613bb86145e5565b9060005260206000200154846002600185613bd39190614976565b613bdd91906142c9565b81548110613bed57613bed6145e5565b9060005260206000200154613c0291906141c7565b61353d91906142c9565b613c168282611fbb565b610c3057613c2381613da6565b613c2e836020613db8565b604051602001613c3f9291906149f3565b60408051601f198184030181529082905262461bcd60e51b8252610c1d91600401614a68565b60975460ff16610b855760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c1d565b600054610100900460ff16613cd55760405162461bcd60e51b8152600401610c1d906148d2565b6097805460ff19169055565b600054610100900460ff166137575760405162461bcd60e51b8152600401610c1d906148d2565b600080826001600160a01b031663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6d919061485f565b90506000851580613d7c575084155b613d9a5784613d8b83886148b3565b613d9591906142c9565b613d9c565b815b9695505050505050565b6060610b366001600160a01b03831660145b60606000613dc78360026148b3565b613dd29060026141c7565b67ffffffffffffffff811115613dea57613dea614a7b565b6040519080825280601f01601f191660200182016040528015613e14576020820181803683370190505b509050600360fc1b81600081518110613e2f57613e2f6145e5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613e5e57613e5e6145e5565b60200101906001600160f81b031916908160001a9053506000613e828460026148b3565b613e8d9060016141c7565b90505b6001811115613f05576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613ec157613ec16145e5565b1a60f81b828281518110613ed757613ed76145e5565b60200101906001600160f81b031916908160001a90535060049490941c93613efe816141da565b9050613e90565b50831561353d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c1d565b5080546000825590600052602060002090810190610c4791905b80821115613f825760008155600101613f6e565b5090565b600060208284031215613f9857600080fd5b81356001600160e01b03198116811461353d57600080fd5b600060208284031215613fc257600080fd5b5035919050565b6001600160a01b0381168114610c4757600080fd5b60008060408385031215613ff157600080fd5b82359150602083013561400381613fc9565b809150509250929050565b60006020828403121561402057600080fd5b813561353d81613fc9565b9687526001600160801b039586166020880152938516604087015291909316606085015263ffffffff9283166080850152821660a08401521660c082015260e00190565b6000806040838503121561408257600080fd5b823561408d81613fc9565b9150602083013561400381613fc9565b600060e082840312156140af57600080fd5b50919050565b6000606082840312156140af57600080fd5b6000602082840312156140d957600080fd5b813567ffffffffffffffff8111156140f057600080fd5b6140fc848285016140b5565b949350505050565b60006020828403121561411657600080fd5b813567ffffffffffffffff81111561412d57600080fd5b820160a0818503121561353d57600080fd5b60006060828403121561415157600080fd5b61353d83836140b5565b803560ff8116811461416c57600080fd5b919050565b60006020828403121561418357600080fd5b61353d8261415b565b600061010082840312156140af57600080fd5b6000604082840312156140af57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610b3657610b366141b1565b6000816141e9576141e96141b1565b506000190190565b634e487b7160e01b600052601260045260246000fd5b600082614216576142166141f1565b500690565b6001600160801b0381168114610c4757600080fd5b60006020828403121561424257600080fd5b813561353d8161421b565b63ffffffff81168114610c4757600080fd5b60006020828403121561427157600080fd5b813561353d8161424d565b9788526001600160801b039687166020890152948616604088015292909416606086015263ffffffff908116608086015292831660a085015290911660c083015260e08201526101000190565b6000826142d8576142d86141f1565b500490565b60008135610b368161424d565b813581556001810160208301356143008161421b565b81546001600160801b0319166001600160801b0382161782555060408301356143288161421b565b81546001600160801b031660809190911b6001600160801b0319161790556002810160608301356143588161421b565b81546001600160801b0319166001600160801b0382161782555060808301356143808161424d565b815463ffffffff60801b191660809190911b63ffffffff60801b161781556143d16143ad60a085016142dd565b82805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b610bac6143e060c085016142dd565b82805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b6000808335601e1984360301811261441b57600080fd5b83018035915067ffffffffffffffff82111561443657600080fd5b6020019150600581901b360382131561444e57600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b878110156145035782840389528135601e198836030181126144b957600080fd5b8701858101903567ffffffffffffffff8111156144d557600080fd5b8036038213156144e457600080fd5b6144ef868284614455565b9a87019a9550505090840190600101614498565b5091979650505050505050565b6020815260006140fc60208301848661447e565b60005b8381101561453f578181015183820152602001614527565b50506000910152565b60008151808452614560816020860160208601614524565b601f01601f19169290920160200192915050565b60018060a01b03841681528260208201526060604082015260006122566060830184614548565b8281526040602082015260006140fc6040830184614548565b8581528460208201528360408201526080606082015260006145da60808301848661447e565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261461257600080fd5b83018035915067ffffffffffffffff82111561462d57600080fd5b60200191503681900382131561444e57600080fd5b600061ffff808316818103614659576146596141b1565b6001019392505050565b848152836020820152606060408201526000613d9c60608301848661447e565b60608152600061469760608301888a61447e565b82810360208401526146aa81878961447e565b905082810360408401526146bf81858761447e565b9998505050505050505050565b60018060a01b038516815260ff84166020820152826040820152608060608201526000613d9c6080830184614548565b60ff841681528260208201526060604082015260006122566060830184614548565b60ff8a16815288602082015260c06040820152600061474160c08301898b61447e565b828103606084015261475481888a61447e565b9050828103608084015261476981868861447e565b9150508260a08301529a9950505050505050505050565b60006020828403121561479257600080fd5b815161353d81613fc9565b6000806000606084860312156147b257600080fd5b8351925060208401519150604084015190509250925092565b60ff861681528460208201526080604082015260006147ee60808301858761447e565b90508260608301529695505050505050565b813581526020808301359082015260408083013590820152610100810160ff61482b6060850161415b565b1660608301526080830135608083015260a083013560a083015260c083013560c083015260e083013560e083015292915050565b60006020828403121561487157600080fd5b5051919050565b60006001820161488a5761488a6141b1565b5060010190565b6000602082840312156148a357600080fd5b8151801515811461353d57600080fd5b60008160001904831182151516156148cd576148cd6141b1565b500290565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060ff821660ff8103614933576149336141b1565b60010192915050565b828482376001600160801b0319919091169101908152601001919050565b6000825161496c818460208701614524565b9190910192915050565b81810381811115610b3657610b366141b1565b805169ffffffffffffffffffff8116811461416c57600080fd5b600080600080600060a086880312156149bb57600080fd5b6149c486614989565b94506020860151935060408601519250606086015191506149e760808701614989565b90509295509295909350565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614a2b816017850160208801614524565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614a5c816028840160208801614524565b01602801949350505050565b60208152600061353d6020830184614548565b634e487b7160e01b600052604160045260246000fdfe783e3ebf40ee443ac9cbca8dc88c9f47450598583c2168f0ae0021de08ad333bedb5588a851185ccd926df348aee898122cd3e827fb7020e3c966fdac62a46af6a7b51c29672c0ed412394a3e65ab758361d7c963b8657ce8c1f43dc0770b1629ae142790790fc18374cd6a6cc28573ecc78841658523afa63055cea42a9e1dd8ec4e223bb52129c3d652c6e55a137389860823d9a02acb9d051e591994c6d6f7607f5053d01557adb731d4aad009009bba2bf77a5b5f779733919451d426336a26469706673582212209216b09dabdc3dbd038acc5784dd7e79912ebf637cc05aa9eb876b9fba2c655464736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061043e5760003560e01c80639773ee6011610236578063c06a62011161013b578063e36c3140116100c3578063f00e022311610087578063f00e022314610aad578063f10b256914610ace578063f51c0fe714610ad7578063f6a3c09014610aea578063fc8b821c14610afd57600080fd5b8063e36c314014610a4b578063e514fe5514610a53578063e61befa714610a5b578063e6aa216c14610a70578063ea18568b14610a9a57600080fd5b8063d6275dd71161010a578063d6275dd714610a08578063de271c6d14610a1b578063e0bcb37814610a25578063e10025e614610a2e578063e2f6339214610a3657600080fd5b8063c06a6201146109bc578063d06628ed146109cf578063d0a8f679146109e2578063d547741f146109f557600080fd5b8063a71b3907116101be578063ae815a041161018d578063ae815a0414610960578063b17b4d861461096a578063b5c25ba61461098b578063b940a00314610993578063be48e58d146109a757600080fd5b8063a71b390714610914578063a8c3a3a81461091c578063abe3219c1461093f578063ae541d651461094d57600080fd5b8063a0c5438711610205578063a0c54387146108d4578063a217fddf146108e7578063a220c2d3146108ef578063a373786914610902578063a6870e5b1461090c57600080fd5b80639773ee601461087757806397a3a10a146108af5780639bfdf9a4146108b95780639ee804cb146108c157600080fd5b806349115a2e11610347578063712033eb116102cf578063844007fe11610293578063844007fe146108235780638456cb59146108365780638ca8703c1461083e57806391d1485414610851578063962c1e051461086457600080fd5b8063712033eb146107c15780637150bc5b146107c9578063735efb96146107ea578063749f7d8a146107fd578063818c8b261461081057600080fd5b80635c7ccd3b116103165780635c7ccd3b1461077e5780635c975abb14610791578063615a02531461079c57806361f00c17146107a457806367fbf731146107ae57600080fd5b806349115a2e146107535780634f560abd1461075b5780635063b5bd1461076357806352e0fc801461076b57600080fd5b80632f739b1d116103ca5780633ba0b9a9116103995780633ba0b9a9146105b95780633e23a827146105e95780633f4ba83a1461070d578063485cc95514610715578063490ffa351461072857600080fd5b80632f739b1d14610514578063342280b31461053857806336568abe146105455780633b5eb03a1461055857600080fd5b8063127103611161041157806312710361146104a257806316515428146104b7578063248a9ca3146104c957806329f96856146104ec5780632f2ff15d1461050157600080fd5b806301ffc9a714610443578063052a68401461046b5780630989001c1461048e578063101b6e3414610498575b600080fd5b610456610451366004613f86565b610b05565b60405190151581526020015b60405180910390f35b610480600080516020614ab283398151915281565b604051908152602001610462565b61048061010d5481565b6104a0610b3c565b005b610480600080516020614a9283398151915281565b60fb5461045690610100900460ff1681565b6104806104d7366004613fb0565b60009081526065602052604090206001015490565b610480600080516020614b3283398151915281565b6104a061050f366004613fde565b610b87565b61045661052236600461400e565b61010f6020526000908152604090205460ff1681565b60fb546104569060ff1681565b6104a0610553366004613fde565b610bb1565b6101055461010654610107546105a692916001600160801b0380821692600160801b928390048216929181169163ffffffff908204811691600160a01b8104821691600160c01b9091041687565b604051610462979695949392919061402b565b6101025461010354610104546105ce92919083565b60408051938452602084019290925290820152606001610462565b6106986040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506040805160e081018252610105548152610106546001600160801b038082166020840152600160801b9182900481169383019390935261010754928316606083015263ffffffff90830481166080830152600160a01b8304811660a0830152600160c01b90920490911660c082015290565b6040516104629190600060e0820190508251825260208301516001600160801b0380821660208501528060408601511660408501528060608601511660608501525050608083015163ffffffff80821660808501528060a08601511660a08501528060c08601511660c0850152505092915050565b6104a0610c34565b6104a061072336600461406f565b610c4a565b60fe5461073b906001600160a01b031681565b6040516001600160a01b039091168152602001610462565b610480610e84565b6104a0610ea2565b610480610ef2565b6104a061077936600461400e565b610f0b565b6104a061078c36600461409d565b611008565b60975460ff16610456565b6104806113f6565b6104806101095481565b6104a06107bc3660046140c7565b61140f565b6104a0611701565b6104806107d7366004613fb0565b6101166020526000908152604090205481565b6104a06107f8366004614104565b61179e565b6104a061080b366004613fb0565b611c6d565b6104a061081e36600461413f565b611c9c565b6104a0610831366004613fb0565b611eed565b6104a0611f1c565b6104a061084c366004613fb0565b611f3b565b61045661085f366004613fde565b611fbb565b6104a0610872366004613fb0565b611fe6565b61089c610885366004613fb0565b6101126020526000908152604090205461ffff1681565b60405161ffff9091168152602001610462565b6104806101085481565b6104a0612033565b6104a06108cf36600461400e565b6120a4565b6104806108e2366004614171565b61210e565b610480600081565b6104a06108fd3660046140c7565b61225f565b61048061010b5481565b60fd54610480565b61048061269f565b60fc5460fd5461092a919082565b60408051928352602083019190915201610462565b61010e546104569060ff1681565b6104a061095b36600461418c565b6126b8565b61048061010a5481565b610480610978366004614171565b6101146020526000908152604090205481565b610480612b06565b60ff5461010054610101546105ce92919083565b610480600080516020614ad283398151915281565b6104a06109ca366004613fb0565b612b1f565b6104806109dd366004614171565b612b4e565b6104a06109f0366004613fb0565b612c8a565b6104a0610a03366004613fde565b612cdc565b6104a0610a1636600461400e565b612d01565b61048061010c5481565b61048061271081565b6104a0612e02565b610480600080516020614b1283398151915281565b610480600581565b6104a0612ebc565b610480600080516020614af283398151915281565b610a78612efe565b6040805182518152602080840151908201529181015190820152606001610462565b6104a0610aa8366004613fb0565b612f4a565b610480610abb366004614171565b6101136020526000908152604090205481565b61048061c4e081565b6104a0610ae5366004613fb0565b612f79565b6104a0610af836600461419f565b612fa8565b6104806131bf565b60006001600160e01b03198216637965db0b60e01b1480610b3657506301ffc9a760e01b6001600160e01b03198316145b92915050565b610b446131d8565b60fb5460ff16610b675760405163b1df7eb360e01b815260040160405180910390fd5b610b6f612e02565b610100546101015460ff54610b8592919061321e565b565b600082815260656020526040902060010154610ba281613274565b610bac838361327e565b505050565b6001600160a01b0381163314610c265760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c308282613304565b5050565b6000610c3f81613274565b610c4761336b565b50565b600054610100900460ff1615808015610c6a5750600054600160ff909116105b80610c845750303b158015610c84575060005460ff166001145b610ce75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c1d565b6000805460ff191660011790558015610d0a576000805461ff0019166101001790555b610d13836133b8565b610d1c826133b8565b610d246133df565b610d2c613406565b610d34613435565b6101f461010855610d55600080516020614a92833981519152611c20613464565b610d6f600080516020614b12833981519152611c20613464565b610d89600080516020614b32833981519152611c20613464565b610da3600080516020614af2833981519152613840613464565b610dbd600080516020614ab283398151915261c4e0613464565b610dd7600080516020614ad2833981519152611c20613464565b60fe80546001600160a01b0319166001600160a01b038416179055610dfd60008461327e565b6040516001600160a01b03831681527fdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b44859060200160405180910390a18015610bac576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a1505050565b6000610e9d600080516020614b328339815191526134f8565b905090565b60fe54610eb99033906001600160a01b0316613544565b61010e805460ff191660011790556040517f3328bda355014adfb66d5d9086ab2c3204d1af7f83a69a3276daeed721f6ce3c90600090a1565b6000610e9d600080516020614af28339815191526134f8565b60fe54610f229033906001600160a01b0316613544565b610f2b816133b8565b6001600160a01b038116600090815261010f602052604090205460ff16610f655760405163f9644b0760e01b815260040160405180910390fd5b6101095461010d54610f7791906141c7565b431015610f975760405163111bb2f160e31b815260040160405180910390fd5b4361010d556001600160a01b038116600090815261010f60205260408120805460ff1916905561010a805491610fcc836141da565b90915550506040516001600160a01b038216907f6d1de2fb0c63996bae7ba6277c720c0560ba42874ea34c1ebe8e1423b9b4742190600090a250565b33600090815261010f602052604090205460ff1661103957604051633e2100a160e01b815260040160405180910390fd5b600561010a54101561105e5760405163dfffd22f60e01b815260040160405180910390fd5b6110666131d8565b4381351061108757604051633bb0413f60e01b815260040160405180910390fd5b600080516020614b3283398151915260009081526101166020527f0683174ee47ba7ded338389c4047f439d06240e01796e9941d2e1ad04002de1b546110ce908335614207565b11156110ed5760405163222ea98560e01b815260040160405180910390fd5b60003382356111026040850160208601614230565b6111126060860160408701614230565b6111226080870160608801614230565b61113260a088016080890161425f565b61114260c0890160a08a0161425f565b61115260e08a0160c08b0161425f565b604080516001600160a01b0390991660208a01528801969096526001600160801b0394851660608801529284166080870152921660a085015263ffffffff91821660c0850152811660e08401521661010082015261012001604051602081830303815290604052805190602001209050600082600001358360200160208101906111dc9190614230565b6111ec6060860160408701614230565b6111fc6080870160608801614230565b61120c60a088016080890161425f565b61121c60c0890160a08a0161425f565b61122c60e08a0160c08b0161425f565b604051602001611242979695949392919061402b565b604051602081830303815290604052805190602001209050600061126683836135cb565b9050337f72745b0271618e5d84d738ea416e3a3be6eb267e0f639198f63c0ef124c29ffc853561129c6040880160208901614230565b6112ac6060890160408a01614230565b6112bc60808a0160608b01614230565b6112cc60a08b0160808c0161425f565b6112dc60c08c0160a08d0161425f565b6112ec60e08d0160c08e0161425f565b4260405161130198979695949392919061427c565b60405180910390a2600261010a5461131991906142c9565b6113249060016141c7565b8160ff16101580156113395750610105548435115b156113f0578361010561134c82826142ea565b507f6988248fd82a7ce842fbdce0c49889ad926bf1548bae4194de0006498d069c94905084356113826040870160208801614230565b6113926060880160408901614230565b6113a26080890160608a01614230565b6113b260a08a0160808b0161425f565b6113c260c08b0160a08c0161425f565b6113d260e08c0160c08d0161425f565b426040516113e798979695949392919061427c565b60405180910390a15b50505050565b6000610e9d600080516020614ad28339815191526134f8565b33600090815261010f602052604090205460ff1661144057604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156114655760405163dfffd22f60e01b815260040160405180910390fd5b61146d6131d8565b4381351061148e57604051633bb0413f60e01b815260040160405180910390fd5b61149661269f565b8135146114b65760405163222ea98560e01b815260040160405180910390fd5b61010b546114c59060016141c7565b8160200135146114e85760405163b59f801760e01b815260040160405180910390fd5b60006114f76040830183614404565b604051602001611508929190614510565b604051602081830303815290604052905060003383602001358360405160200161153493929190614574565b604051602081830303815290604052805190602001209050600083602001358360405160200161156592919061459b565b604051602081830303815290604052805190602001209050600061158983836135cb565b9050337f51308cad1da8fe95d4be43112c17d5651d3e3713a675ec61c2214fa16d9f6beb60208701354388356115c260408b018b614404565b6040516115d39594939291906145b4565b60405180910390a2600261010a546115eb91906142c9565b6115f69060016141c7565b8160ff16106116fa57602085013561010b5560006116176040870187614404565b9050905060005b818110156116ab57600061165f61163860408a018a614404565b84818110611648576116486145e5565b905060200281019061165a91906145fb565b613668565b600081815261011260205260408120805492935061ffff909216919061168483614642565b91906101000a81548161ffff021916908361ffff160217905550508160010191505061161e565b507f5454855cf2eeb89296b9e10ba0881425fa305f06ce9ccb1b0ce47bc2f107a1916020870135436116e060408a018a614404565b6040516116f09493929190614663565b60405180910390a1505b5050505050565b60fb5460ff161561172557604051632178bc4d60e11b815260040160405180910390fd5b60fe5461173c9033906001600160a01b0316613544565b60fb805460ff610100808304821615810261ff001990931692909217928390556040517fc59a5de02f9d69be770ff0d61bbc894968433bb599f9fd9c2016e149c509c5e5936117949390049091161515815260200190565b60405180910390a1565b6117a66136fe565b33600090815261010f602052604090205460ff166117d757604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156117fc5760405163dfffd22f60e01b815260040160405180910390fd5b6118046131d8565b4381602001351061182857604051633bb0413f60e01b815260040160405180910390fd5b600080516020614ad2833981519152600090815261011660209081527f7a641f2a170436cb9ff0edd342e448ed4a6e9ee295946f1b627f5ee896014a735461187291840135614207565b11156118915760405163222ea98560e01b815260040160405180910390fd5b60006118a06040830183614404565b6118ad6060850185614404565b6118ba6080870187614404565b6040516020016118cf96959493929190614683565b60408051601f1981840301815291905290506000336118f16020850185614171565b84602001358460405160200161190a94939291906146cc565b60408051601f198184030181529190528051602091820120915060009061193390850185614171565b84602001358460405160200161194b939291906146fc565b604051602081830303815290604052805190602001209050600061196f83836135cb565b9050337f9827231af99e07dd2167998d4c6855a2f78e0eead80a6a490393b1c3ead048a16119a06020880188614171565b60208801356119b260408a018a614404565b6119bf60608c018c614404565b6119cc60808e018e614404565b426040516119e29998979695949392919061471e565b60405180910390a2600261010a546119fa91906142c9565b611a059060016141c7565b8160ff1610158015611a4057506101146000611a246020880188614171565b60ff1660ff168152602001908152602001600020548560200135115b15611c5f576020850180359061011490600090611a5d9089614171565b60ff16815260208082019290925260409081016000209290925560fe5482516306ccb9d760e41b815292516001600160a01b0390911692636ccb9d709260048083019391928290030181865afa158015611abb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adf9190614780565b6001600160a01b03166399d055c8611afa6020880188614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa158015611b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5c9190614780565b6001600160a01b03166313797bff611b776040880188614404565b611b8460608a018a614404565b611b9160808c018c614404565b6040518763ffffffff1660e01b8152600401611bb296959493929190614683565b600060405180830381600087803b158015611bcc57600080fd5b505af1158015611be0573d6000803e3d6000fd5b507f64a4ab6f7a6ca6fe9c5750207ea4a9d3e2d5f5ba81f707146b7b20624f61cf119250611c149150506020870187614171565b6020870135611c266040890189614404565b611c3360608b018b614404565b611c4060808d018d614404565b42604051611c569998979695949392919061471e565b60405180910390a15b50505050610c47600160c955565b60fe54611c849033906001600160a01b0316613544565b610c47600080516020614b1283398151915282613464565b33600090815261010f602052604090205460ff16611ccd57604051633e2100a160e01b815260040160405180910390fd5b600561010a541015611cf25760405163dfffd22f60e01b815260040160405180910390fd5b60fb5460ff1615611d1657604051632178bc4d60e11b815260040160405180910390fd5b611d1e6131d8565b60fb54610100900460ff1615611d465760405162ff240360e21b815260040160405180910390fd5b43813510611d6757604051633bb0413f60e01b815260040160405180910390fd5b600080516020614a9283398151915260009081526101166020527f78e40c6661d84c085b652d9fa30921a229e88abd691be104ff2436753fe240c454611dae908335614207565b1115611dcd5760405163222ea98560e01b815260040160405180910390fd5b6040805133602080830191909152833582840152830135606082015290820135608082015260009060a00160408051808303601f190181528282528051602091820120853582850152908501358383015290840135606083015291506000906080016040516020818303038152906040528051906020012090506000611e5383836135cb565b6040805186358152602080880135908201528682013581830152426060820152905191925033917f73327a5c0fdb3104b4a0f993bc20ce59885ac5bfe5f23e4bfdd19c21fb79cb129181900360800190a2600261010a54611eb491906142c9565b611ebf9060016141c7565b8160ff1610158015611ed45750610102548435115b156113f0576113f060208501356040860135863561375e565b60fe54611f049033906001600160a01b0316613544565b610c47600080516020614b3283398151915282613464565b60fe54611f339033906001600160a01b0316613544565b610b85613873565b60fe54611f529033906001600160a01b0316613544565b801580611f60575061271081115b15611f7e5760405163b14f197760e01b815260040160405180910390fd5b6101088190556040518181527f94a97bfc9c7a83fe5f75c66931ca7d2d16372fdc244afc5db36044f3ca52a520906020015b60405180910390a150565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60fe54611ffd9033906001600160a01b0316613544565b6101098190556040518181527f4ab6bf3c94e4c92b7b93e89e984ef66d28392f440a58d91d244b6c303e85f04690602001611fb0565b60fb5460ff161561205757604051632178bc4d60e11b815260040160405180910390fd5b61205f6131d8565b60fb54610100900460ff166120865760405162ff240360e21b815260040160405180910390fd5b60008060006120936138b0565b925092509250610bac83838361375e565b60006120af81613274565b6120b8826133b8565b60fe80546001600160a01b0319166001600160a01b0384169081179091556040519081527fdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485906020015b60405180910390a15050565b60008060fe60009054906101000a90046001600160a01b03166001600160a01b0316636ccb9d706040518163ffffffff1660e01b8152600401602060405180830381865afa158015612164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121889190614780565b604051637526d42960e01b815260ff851660048201526001600160a01b039190911690637526d42990602401602060405180830381865afa1580156121d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f59190614780565b6001600160a01b031663d0c402766040518163ffffffff1660e01b8152600401606060405180830381865afa158015612232573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612256919061479d565b95945050505050565b6122676136fe565b33600090815261010f602052604090205460ff1661229857604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156122bd5760405163dfffd22f60e01b815260040160405180910390fd5b6122c56131d8565b438160200135106122e957604051633bb0413f60e01b815260040160405180910390fd5b600080516020614af2833981519152600090815261011660209081527fbc6eadc409e9002a7c49dda55566447da97ef8d5367e522b12bf4559b3c929c85461233391840135614207565b11156123525760405163222ea98560e01b815260040160405180910390fd5b60006123616040830183614404565b604051602001612372929190614510565b60408051601f1981840301815291905290506000336123946020850185614171565b8460200135846040516020016123ad94939291906146cc565b60408051601f19818403018152919052805160209182012091506000906123d690850185614171565b8460200135846040516020016123ee939291906146fc565b604051602081830303815290604052805190602001209050600061241283836135cb565b9050337f3b426b614a89830a3d92d8dead18e2ded3cba56101dbff12dddfc1c77b21fbe66124436020880188614171565b602088013561245560408a018a614404565b426040516124679594939291906147cb565b60405180910390a2600261010a5461247f91906142c9565b61248a9060016141c7565b8160ff16101580156124c5575061011360006124a96020880188614171565b60ff1660ff168152602001908152602001600020548560200135115b15611c5f5760208501803590610113906000906124e29089614171565b60ff16815260208082019290925260409081016000209290925560fe5482516306ccb9d760e41b815292516001600160a01b0390911692636ccb9d709260048083019391928290030181865afa158015612540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125649190614780565b6001600160a01b03166399d055c861257f6020880188614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa1580156125bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125e19190614780565b6001600160a01b031663264f27f36125fc6040880188614404565b6040518363ffffffff1660e01b8152600401612619929190614510565b600060405180830381600087803b15801561263357600080fd5b505af1158015612647573d6000803e3d6000fd5b507f5209293842928a1567d714f34fed8d87769d89d29dfb20f48ea678b02337e84d925061267b9150506020870187614171565b602087013561268d6040890189614404565b42604051611c569594939291906147cb565b6000610e9d600080516020614ab28339815191526134f8565b6126c06136fe565b33600090815261010f602052604090205460ff166126f157604051633e2100a160e01b815260040160405180910390fd5b600561010a5410156127165760405163dfffd22f60e01b815260040160405180910390fd5b61271e6131d8565b4381351061273f57604051633bb0413f60e01b815260040160405180910390fd5b6127526108e26080830160608401614171565b8135146127725760405163222ea98560e01b815260040160405180910390fd5b6127856109dd6080830160608401614171565b8160200135146127a85760405163b4bf916f60e01b815260040160405180910390fd5b600033602083013560408401356127c56080860160608701614171565b604080516001600160a01b039095166020860152840192909252606083015260ff1660808281019190915283013560a08281019190915283013560c08281019190915283013560e0828101919091528301356101008201526101200160408051601f1981840301815291815281516020928301209250600091840135908401356128556080860160608701614171565b60408051602081019490945283019190915260ff1660608201526080808501359082015260a0808501359082015260c0808501359082015260e080850135908201526101000160408051601f198184030181529181528151602092830120925033917f97f29f2f9a3ad2e8ebffd3fb4a6dbf5035b92b432c8344609b8368407dd233779190860135908601356128f16080880160608901614171565b60408051938452602084019290925260ff169082015243606082015260800160405180910390a2600061292483836135cb565b9050600261010a5461293691906142c9565b6129419060016141c7565b8160ff1610612af95760fe54604080516306ccb9d760e41b815290516000926001600160a01b031691636ccb9d709160048083019260209291908290030181865afa158015612994573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129b89190614780565b6001600160a01b0316637526d4296129d66080880160608901614171565b6040516001600160e01b031960e084901b16815260ff9091166004820152602401602060405180830381865afa158015612a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a389190614780565b604051630d83e4ed60e01b81529091506001600160a01b03821690630d83e4ed90612a67908890600401614800565b600060405180830381600087803b158015612a8157600080fd5b505af1158015612a95573d6000803e3d6000fd5b507f4394ee7a4ca89453c6900058c69bfaf14014d9fc4d510ead54ae47ac06d1f05e9250505060208601356040870135612ad56080890160608a01614171565b60408051938452602084019290925260ff1690820152436060820152608001611c56565b505050610c47600160c955565b6000610e9d600080516020614a928339815191526134f8565b60fe54612b369033906001600160a01b0316613544565b610c47600080516020614af283398151915282613464565b60fe54604080516306ccb9d760e41b815290516000926001600160a01b031691636ccb9d709160048083019260209291908290030181865afa158015612b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbc9190614780565b604051637526d42960e01b815260ff841660048201526001600160a01b039190911690637526d42990602401602060405180830381865afa158015612c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c299190614780565b6001600160a01b031663189956a26040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b36919061485f565b60fe54612ca19033906001600160a01b0316613544565b61c4e0811115612cc457604051637d5ba07f60e01b815260040160405180910390fd5b610c47600080516020614a9283398151915282613464565b600082815260656020526040902060010154612cf781613274565b610bac8383613304565b60fe54612d189033906001600160a01b0316613544565b612d21816133b8565b6001600160a01b038116600090815261010f602052604090205460ff1615612d5c57604051631adb013360e11b815260040160405180910390fd5b6101095461010d54612d6e91906141c7565b431015612d8e5760405163111bb2f160e31b815260040160405180910390fd5b4361010d556001600160a01b038116600090815261010f60205260408120805460ff1916600117905561010a805491612dc683614878565b90915550506040516001600160a01b038216907fff4a290f0500d113133708d378eb9a151c32d91cb8f5778cfda6328d89cfc4b890600090a250565b612e0a6131d8565b60fe546040516318903ee760e21b81523360048201526001600160a01b0390911690636240fb9c90602401602060405180830381865afa158015612e52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e769190614891565b158015612e9257504361c4e061010c54612e9091906141c7565b115b15612eb05760405163111bb2f160e31b815260040160405180910390fd5b60fb805460ff19169055565b6000612ec781613274565b61010e805460ff191690556040517ff29e751b3c28b619a215d25fee98a7828471a8e554626186d3f8d122f165029290600090a150565b612f2260405180606001604052806000815260200160008152602001600081525090565b5060408051606081018252610102548152610103546020820152610104549181019190915290565b60fe54612f619033906001600160a01b0316613544565b610c47600080516020614ad283398151915282613464565b60fe54612f909033906001600160a01b0316613544565b610c47600080516020614ab283398151915282613464565b33600090815261010f602052604090205460ff16612fd957604051633e2100a160e01b815260040160405180910390fd5b600561010a541015612ffe5760405163dfffd22f60e01b815260040160405180910390fd5b4381351061301f57604051633bb0413f60e01b815260040160405180910390fd5b6130276131bf565b8135146130475760405163222ea98560e01b815260040160405180910390fd5b60fc548135116130695760405162e1442b60e41b815260040160405180910390fd5b604080513360208083019190915283358284018190528351808403850181526060840185528051908301206080808501929092528451808503909201825260a0909301909352825192019190912060006130c383836135cb565b90508060ff166001036130dd576130dd6101156000613f54565b6130ea8460200135613a80565b6040805160208681013582528635908201524381830152905133917f6c291a7ce9906b2982643002c104cb0ba9f2b9fecc8b38e9cc3cf5cfca65b4e8919081900360600190a2600361010a54600261314291906148b3565b61314c91906142c9565b6131579060016141c7565b8160ff16106113f057833560fc55602084013560fd55613178610115613b96565b60fd5560408051602086810135825286359082015243918101919091527fbc1a0795e699bbeaa982f6049ae9689f4d0e3e22d554adb7c46626be62f3b8bc906060016113e7565b6000610e9d600080516020614b128339815191526134f8565b60975460ff1615610b855760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c1d565b61010383905561010482905561010281905560408051828152602081018590529081018390524260608201527ff525f19964f35afcb9a475680bb27abecbc5e62b4d6d4f66a81a5bd7e8a107e390608001610e77565b610c478133613c0c565b6132888282611fbb565b610c305760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132c03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61330e8282611fbb565b15610c305760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b613373613c65565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001611794565b6001600160a01b038116610c475760405163d92e233d60e01b815260040160405180910390fd5b600054610100900460ff16610b855760405162461bcd60e51b8152600401610c1d906148d2565b600054610100900460ff1661342d5760405162461bcd60e51b8152600401610c1d906148d2565b610b85613cae565b600054610100900460ff1661345c5760405162461bcd60e51b8152600401610c1d906148d2565b610b85613ce1565b8060000361348557604051637036cfc960e11b815260040160405180910390fd5b6000828152610116602052604090205481036134b45760405163806e577f60e01b815260040160405180910390fd5b6000828152610116602052604090819020829055517f6231a3e049e2072a042ae727208e7650b487871f4080458371e84d6e7d391138906121029083815260200190565b60008181526101166020526040812054808203613528576040516379a715fb60e11b815260040160405180910390fd5b8061353381436142c9565b61353d91906148b3565b9392505050565b6040516318903ee760e21b81526001600160a01b038381166004830152821690636240fb9c90602401602060405180830381865afa15801561358a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ae9190614891565b610c305760405163c4230ae360e01b815260040160405180910390fd5b6000828152610110602052604081205460ff16156135fc57604051635da1eec160e11b815260040160405180910390fd5b600083815261011060209081526040808320805460ff191660011790558483526101119091528120805460ff16916136338361491d565b82546101009290920a60ff81810219909316918316021790915560009384526101116020526040909320549092169392505050565b60006030821461368b57604051639ca717ed60e01b815260040160405180910390fd5b6040516002906136a4908590859060009060200161493c565b60408051601f19818403018152908290526136be9161495a565b602060405180830381855afa1580156136db573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061353d919061485f565b600260c954036137505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c1d565b600260c955565b600160c955565b610103546101045460fe546000926137809290916001600160a01b0316613d08565b60fe5490915060009061379f90869086906001600160a01b0316613d08565b9050612710610108546127106137b59190614976565b6137bf90846148b3565b6137c991906142c9565b81101580156137ff5750612710610108546127106137e791906141c7565b6137f190846148b3565b6137fb91906142c9565b8111155b6138685760fb805460ff191660019081179091554361010c5561010086905561010185905560ff849055604080519182524260208301527f9dea6ddefbcfcf9c4f6c1c086e462c2ab380c0be199d0289bf23b09f20814415910160405180910390a15050505050565b6116fa85858561321e565b61387b6131d8565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586133a03390565b60008060008060fe60009054906101000a90046001600160a01b03166001600160a01b031663489ed6516040518163ffffffff1660e01b8152600401602060405180830381865afa158015613909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061392d9190614780565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561396a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398e91906149a3565b505050915050600060fe60009054906101000a90046001600160a01b03166001600160a01b0316632ca03f666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156139e9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0d9190614780565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015613a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a6e91906149a3565b50949891975043965090945050505050565b61011580546001818101835560008390527f77886ee853a0f02c8259429c7bfca08679ca3ab8bdec2c3bd5cca8557e06493a90910183905590549003613ac35750565b61011554600090613ad690600190614976565b90505b60018110158015613b115750610115613af3600183614976565b81548110613b0357613b036145e5565b906000526020600020015482105b15613b7157610115613b24600183614976565b81548110613b3457613b346145e5565b90600052602060002001546101158281548110613b5357613b536145e5565b60009182526020909120015580613b69816141da565b915050613ad9565b816101158281548110613b8657613b866145e5565b6000918252602090912001555050565b8054600090600283613ba882846142c9565b81548110613bb857613bb86145e5565b9060005260206000200154846002600185613bd39190614976565b613bdd91906142c9565b81548110613bed57613bed6145e5565b9060005260206000200154613c0291906141c7565b61353d91906142c9565b613c168282611fbb565b610c3057613c2381613da6565b613c2e836020613db8565b604051602001613c3f9291906149f3565b60408051601f198184030181529082905262461bcd60e51b8252610c1d91600401614a68565b60975460ff16610b855760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c1d565b600054610100900460ff16613cd55760405162461bcd60e51b8152600401610c1d906148d2565b6097805460ff19169055565b600054610100900460ff166137575760405162461bcd60e51b8152600401610c1d906148d2565b600080826001600160a01b031663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6d919061485f565b90506000851580613d7c575084155b613d9a5784613d8b83886148b3565b613d9591906142c9565b613d9c565b815b9695505050505050565b6060610b366001600160a01b03831660145b60606000613dc78360026148b3565b613dd29060026141c7565b67ffffffffffffffff811115613dea57613dea614a7b565b6040519080825280601f01601f191660200182016040528015613e14576020820181803683370190505b509050600360fc1b81600081518110613e2f57613e2f6145e5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613e5e57613e5e6145e5565b60200101906001600160f81b031916908160001a9053506000613e828460026148b3565b613e8d9060016141c7565b90505b6001811115613f05576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613ec157613ec16145e5565b1a60f81b828281518110613ed757613ed76145e5565b60200101906001600160f81b031916908160001a90535060049490941c93613efe816141da565b9050613e90565b50831561353d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c1d565b5080546000825590600052602060002090810190610c4791905b80821115613f825760008155600101613f6e565b5090565b600060208284031215613f9857600080fd5b81356001600160e01b03198116811461353d57600080fd5b600060208284031215613fc257600080fd5b5035919050565b6001600160a01b0381168114610c4757600080fd5b60008060408385031215613ff157600080fd5b82359150602083013561400381613fc9565b809150509250929050565b60006020828403121561402057600080fd5b813561353d81613fc9565b9687526001600160801b039586166020880152938516604087015291909316606085015263ffffffff9283166080850152821660a08401521660c082015260e00190565b6000806040838503121561408257600080fd5b823561408d81613fc9565b9150602083013561400381613fc9565b600060e082840312156140af57600080fd5b50919050565b6000606082840312156140af57600080fd5b6000602082840312156140d957600080fd5b813567ffffffffffffffff8111156140f057600080fd5b6140fc848285016140b5565b949350505050565b60006020828403121561411657600080fd5b813567ffffffffffffffff81111561412d57600080fd5b820160a0818503121561353d57600080fd5b60006060828403121561415157600080fd5b61353d83836140b5565b803560ff8116811461416c57600080fd5b919050565b60006020828403121561418357600080fd5b61353d8261415b565b600061010082840312156140af57600080fd5b6000604082840312156140af57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610b3657610b366141b1565b6000816141e9576141e96141b1565b506000190190565b634e487b7160e01b600052601260045260246000fd5b600082614216576142166141f1565b500690565b6001600160801b0381168114610c4757600080fd5b60006020828403121561424257600080fd5b813561353d8161421b565b63ffffffff81168114610c4757600080fd5b60006020828403121561427157600080fd5b813561353d8161424d565b9788526001600160801b039687166020890152948616604088015292909416606086015263ffffffff908116608086015292831660a085015290911660c083015260e08201526101000190565b6000826142d8576142d86141f1565b500490565b60008135610b368161424d565b813581556001810160208301356143008161421b565b81546001600160801b0319166001600160801b0382161782555060408301356143288161421b565b81546001600160801b031660809190911b6001600160801b0319161790556002810160608301356143588161421b565b81546001600160801b0319166001600160801b0382161782555060808301356143808161424d565b815463ffffffff60801b191660809190911b63ffffffff60801b161781556143d16143ad60a085016142dd565b82805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b610bac6143e060c085016142dd565b82805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b6000808335601e1984360301811261441b57600080fd5b83018035915067ffffffffffffffff82111561443657600080fd5b6020019150600581901b360382131561444e57600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b878110156145035782840389528135601e198836030181126144b957600080fd5b8701858101903567ffffffffffffffff8111156144d557600080fd5b8036038213156144e457600080fd5b6144ef868284614455565b9a87019a9550505090840190600101614498565b5091979650505050505050565b6020815260006140fc60208301848661447e565b60005b8381101561453f578181015183820152602001614527565b50506000910152565b60008151808452614560816020860160208601614524565b601f01601f19169290920160200192915050565b60018060a01b03841681528260208201526060604082015260006122566060830184614548565b8281526040602082015260006140fc6040830184614548565b8581528460208201528360408201526080606082015260006145da60808301848661447e565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261461257600080fd5b83018035915067ffffffffffffffff82111561462d57600080fd5b60200191503681900382131561444e57600080fd5b600061ffff808316818103614659576146596141b1565b6001019392505050565b848152836020820152606060408201526000613d9c60608301848661447e565b60608152600061469760608301888a61447e565b82810360208401526146aa81878961447e565b905082810360408401526146bf81858761447e565b9998505050505050505050565b60018060a01b038516815260ff84166020820152826040820152608060608201526000613d9c6080830184614548565b60ff841681528260208201526060604082015260006122566060830184614548565b60ff8a16815288602082015260c06040820152600061474160c08301898b61447e565b828103606084015261475481888a61447e565b9050828103608084015261476981868861447e565b9150508260a08301529a9950505050505050505050565b60006020828403121561479257600080fd5b815161353d81613fc9565b6000806000606084860312156147b257600080fd5b8351925060208401519150604084015190509250925092565b60ff861681528460208201526080604082015260006147ee60808301858761447e565b90508260608301529695505050505050565b813581526020808301359082015260408083013590820152610100810160ff61482b6060850161415b565b1660608301526080830135608083015260a083013560a083015260c083013560c083015260e083013560e083015292915050565b60006020828403121561487157600080fd5b5051919050565b60006001820161488a5761488a6141b1565b5060010190565b6000602082840312156148a357600080fd5b8151801515811461353d57600080fd5b60008160001904831182151516156148cd576148cd6141b1565b500290565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060ff821660ff8103614933576149336141b1565b60010192915050565b828482376001600160801b0319919091169101908152601001919050565b6000825161496c818460208701614524565b9190910192915050565b81810381811115610b3657610b366141b1565b805169ffffffffffffffffffff8116811461416c57600080fd5b600080600080600060a086880312156149bb57600080fd5b6149c486614989565b94506020860151935060408601519250606086015191506149e760808701614989565b90509295509295909350565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614a2b816017850160208801614524565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614a5c816028840160208801614524565b01602801949350505050565b60208152600061353d6020830184614548565b634e487b7160e01b600052604160045260246000fdfe783e3ebf40ee443ac9cbca8dc88c9f47450598583c2168f0ae0021de08ad333bedb5588a851185ccd926df348aee898122cd3e827fb7020e3c966fdac62a46af6a7b51c29672c0ed412394a3e65ab758361d7c963b8657ce8c1f43dc0770b1629ae142790790fc18374cd6a6cc28573ecc78841658523afa63055cea42a9e1dd8ec4e223bb52129c3d652c6e55a137389860823d9a02acb9d051e591994c6d6f7607f5053d01557adb731d4aad009009bba2bf77a5b5f779733919451d426336a26469706673582212209216b09dabdc3dbd038acc5784dd7e79912ebf637cc05aa9eb876b9fba2c655464736f6c63430008100033

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

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.