ETH Price: $3,389.33 (+1.25%)

Contract

0xA347C391bc8f740CAbA37672157c8aAcD08Ac567
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Distribute Balan...208376992024-09-26 22:12:4788 days ago1727388767IN
Rocket Pool: Minipool Delegate
0 ETH0.0003895216.40321921
Distribute Balan...181703082023-09-19 13:38:59461 days ago1695130739IN
Rocket Pool: Minipool Delegate
0 ETH0.0002431310.23321444
Distribute Balan...180958782023-09-09 2:31:59472 days ago1694226719IN
Rocket Pool: Minipool Delegate
0 ETH0.0003038512.79539783
Distribute Balan...180957382023-09-09 2:03:35472 days ago1694225015IN
Rocket Pool: Minipool Delegate
0 ETH0.0002374710

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RocketMinipoolDelegate

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 15000 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 23 : RocketMinipoolDelegate.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.6;

import "@openzeppelin/contracts/math/SafeMath.sol";

import "./RocketMinipoolStorageLayout.sol";
import "../../interface/casper/DepositInterface.sol";
import "../../interface/deposit/RocketDepositPoolInterface.sol";
import "../../interface/minipool/RocketMinipoolInterface.sol";
import "../../interface/minipool/RocketMinipoolManagerInterface.sol";
import "../../interface/minipool/RocketMinipoolQueueInterface.sol";
import "../../interface/minipool/RocketMinipoolPenaltyInterface.sol";
import "../../interface/node/RocketNodeStakingInterface.sol";
import "../../interface/dao/protocol/settings/RocketDAOProtocolSettingsMinipoolInterface.sol";
import "../../interface/dao/node/settings/RocketDAONodeTrustedSettingsMinipoolInterface.sol";
import "../../interface/dao/protocol/settings/RocketDAOProtocolSettingsNodeInterface.sol";
import "../../interface/dao/node/RocketDAONodeTrustedInterface.sol";
import "../../interface/network/RocketNetworkFeesInterface.sol";
import "../../interface/token/RocketTokenRETHInterface.sol";
import "../../types/MinipoolDeposit.sol";
import "../../types/MinipoolStatus.sol";
import "../../interface/node/RocketNodeDepositInterface.sol";
import "../../interface/minipool/RocketMinipoolBondReducerInterface.sol";

/// @notice Provides the logic for each individual minipool in the Rocket Pool network
/// @dev Minipools exclusively DELEGATECALL into this contract it is never called directly
contract RocketMinipoolDelegate is RocketMinipoolStorageLayout, RocketMinipoolInterface {

    // Constants
    uint8 public constant override version = 3;                   // Used to identify which delegate contract each minipool is using
    uint256 constant calcBase = 1 ether;                          // Fixed point arithmetic uses this for value for precision
    uint256 constant legacyPrelaunchAmount = 16 ether;            // The amount of ETH initially deposited when minipool is created (for legacy minipools)

    // Libs
    using SafeMath for uint;

    // Events
    event StatusUpdated(uint8 indexed status, uint256 time);
    event ScrubVoted(address indexed member, uint256 time);
    event BondReduced(uint256 previousBondAmount, uint256 newBondAmount, uint256 time);
    event MinipoolScrubbed(uint256 time);
    event MinipoolPrestaked(bytes validatorPubkey, bytes validatorSignature, bytes32 depositDataRoot, uint256 amount, bytes withdrawalCredentials, uint256 time);
    event MinipoolPromoted(uint256 time);
    event MinipoolVacancyPrepared(uint256 bondAmount, uint256 currentBalance, uint256 time);
    event EtherDeposited(address indexed from, uint256 amount, uint256 time);
    event EtherWithdrawn(address indexed to, uint256 amount, uint256 time);
    event EtherWithdrawalProcessed(address indexed executed, uint256 nodeAmount, uint256 userAmount, uint256 totalBalance, uint256 time);

    // Status getters
    function getStatus() override external view returns (MinipoolStatus) { return status; }
    function getFinalised() override external view returns (bool) { return finalised; }
    function getStatusBlock() override external view returns (uint256) { return statusBlock; }
    function getStatusTime() override external view returns (uint256) { return statusTime; }
    function getScrubVoted(address _member) override external view returns (bool) { return memberScrubVotes[_member]; }

    // Deposit type getter
    function getDepositType() override external view returns (MinipoolDeposit) { return depositType; }

    // Node detail getters
    function getNodeAddress() override external view returns (address) { return nodeAddress; }
    function getNodeFee() override external view returns (uint256) { return nodeFee; }
    function getNodeDepositBalance() override external view returns (uint256) { return nodeDepositBalance; }
    function getNodeRefundBalance() override external view returns (uint256) { return nodeRefundBalance; }
    function getNodeDepositAssigned() override external view returns (bool) { return userDepositAssignedTime != 0; }
    function getPreLaunchValue() override external view returns (uint256) { return preLaunchValue; }
    function getNodeTopUpValue() override external view returns (uint256) { return nodeDepositBalance.sub(preLaunchValue); }
    function getVacant() override external view returns (bool) { return vacant; }
    function getPreMigrationBalance() override external view returns (uint256) { return preMigrationBalance; }
    function getUserDistributed() override external view returns (bool) { return userDistributed; }

    // User deposit detail getters
    function getUserDepositBalance() override public view returns (uint256) {
        if (depositType == MinipoolDeposit.Variable) {
            return userDepositBalance;
        } else {
            return userDepositBalanceLegacy;
        }
    }
    function getUserDepositAssigned() override external view returns (bool) { return userDepositAssignedTime != 0; }
    function getUserDepositAssignedTime() override external view returns (uint256) { return userDepositAssignedTime; }
    function getTotalScrubVotes() override external view returns (uint256) { return totalScrubVotes; }

    /// @dev Prevent direct calls to this contract
    modifier onlyInitialised() {
        require(storageState == StorageState.Initialised, "Storage state not initialised");
        _;
    }

    /// @dev Prevent multiple calls to initialise
    modifier onlyUninitialised() {
        require(storageState == StorageState.Uninitialised, "Storage state already initialised");
        _;
    }

    /// @dev Only allow access from the owning node address
    modifier onlyMinipoolOwner(address _nodeAddress) {
        require(_nodeAddress == nodeAddress, "Invalid minipool owner");
        _;
    }

    /// @dev Only allow access from the owning node address or their withdrawal address
    modifier onlyMinipoolOwnerOrWithdrawalAddress(address _nodeAddress) {
        require(_nodeAddress == nodeAddress || _nodeAddress == rocketStorage.getNodeWithdrawalAddress(nodeAddress), "Invalid minipool owner");
        _;
    }

    /// @dev Only allow access from the latest version of the specified Rocket Pool contract
    modifier onlyLatestContract(string memory _contractName, address _contractAddress) {
        require(_contractAddress == getContractAddress(_contractName), "Invalid or outdated contract");
        _;
    }

    /// @dev Get the address of a Rocket Pool network contract
    /// @param _contractName The internal name of the contract to retrieve the address for
    function getContractAddress(string memory _contractName) private view returns (address) {
        address contractAddress = rocketStorage.getAddress(keccak256(abi.encodePacked("contract.address", _contractName)));
        require(contractAddress != address(0x0), "Contract not found");
        return contractAddress;
    }

    /// @dev Called once on creation to initialise starting state
    /// @param _nodeAddress The address of the node operator who will own this minipool
    function initialise(address _nodeAddress) override external onlyUninitialised {
        // Check parameters
        require(_nodeAddress != address(0x0), "Invalid node address");
        // Load contracts
        RocketNetworkFeesInterface rocketNetworkFees = RocketNetworkFeesInterface(getContractAddress("rocketNetworkFees"));
        // Set initial status
        status = MinipoolStatus.Initialised;
        statusBlock = block.number;
        statusTime = block.timestamp;
        // Set details
        depositType = MinipoolDeposit.Variable;
        nodeAddress = _nodeAddress;
        nodeFee = rocketNetworkFees.getNodeFee();
        // Set the rETH address
        rocketTokenRETH = getContractAddress("rocketTokenRETH");
        // Set local copy of penalty contract
        rocketMinipoolPenalty = getContractAddress("rocketMinipoolPenalty");
        // Intialise storage state
        storageState = StorageState.Initialised;
    }

    /// @notice Performs the initial pre-stake on the beacon chain to set the withdrawal credentials
    /// @param _bondValue The amount of the stake which will be provided by the node operator
    /// @param _validatorPubkey The public key of the validator
    /// @param _validatorSignature A signature over the deposit message object
    /// @param _depositDataRoot The hash tree root of the deposit data object
    function preDeposit(uint256 _bondValue, bytes calldata _validatorPubkey, bytes calldata _validatorSignature, bytes32 _depositDataRoot) override external payable onlyLatestContract("rocketNodeDeposit", msg.sender) onlyInitialised {
        // Check current status & node deposit status
        require(status == MinipoolStatus.Initialised, "The pre-deposit can only be made while initialised");
        require(preLaunchValue == 0, "Pre-deposit already performed");
        // Update node deposit details
        nodeDepositBalance = _bondValue;
        preLaunchValue = msg.value;
        // Emit ether deposited event
        emit EtherDeposited(msg.sender, preLaunchValue, block.timestamp);
        // Perform the pre-stake to lock in withdrawal credentials on beacon chain
        preStake(_validatorPubkey, _validatorSignature, _depositDataRoot);
    }

    /// @notice Performs the second deposit which provides the validator with the remaining balance to become active
    function deposit() override external payable onlyLatestContract("rocketDepositPool", msg.sender) onlyInitialised {
        // Check current status & node deposit status
        require(status == MinipoolStatus.Initialised, "The node deposit can only be assigned while initialised");
        require(userDepositAssignedTime == 0, "The user deposit has already been assigned");
        // Set the minipool status to prelaunch (ready for node to call `stake()`)
        setStatus(MinipoolStatus.Prelaunch);
        // Update deposit details
        userDepositBalance = msg.value.add(preLaunchValue).sub(nodeDepositBalance);
        userDepositAssignedTime = block.timestamp;
        // Emit ether deposited event
        emit EtherDeposited(msg.sender, msg.value, block.timestamp);
    }

    /// @notice Assign user deposited ETH to the minipool and mark it as prelaunch
    /// @dev No longer used in "Variable" type minipools (only retained for legacy minipools still in queue)
    function userDeposit() override external payable onlyLatestContract("rocketDepositPool", msg.sender) onlyInitialised {
        // Check current status & user deposit status
        require(status >= MinipoolStatus.Initialised && status <= MinipoolStatus.Staking, "The user deposit can only be assigned while initialised, in prelaunch, or staking");
        require(userDepositAssignedTime == 0, "The user deposit has already been assigned");
        // Progress initialised minipool to prelaunch
        if (status == MinipoolStatus.Initialised) { setStatus(MinipoolStatus.Prelaunch); }
        // Update user deposit details
        userDepositBalance = msg.value;
        userDepositAssignedTime = block.timestamp;
        // Refinance full minipool
        if (depositType == MinipoolDeposit.Full) {
            // Update node balances
            nodeDepositBalance = nodeDepositBalance.sub(msg.value);
            nodeRefundBalance = nodeRefundBalance.add(msg.value);
        }
        // Emit ether deposited event
        emit EtherDeposited(msg.sender, msg.value, block.timestamp);
    }

    /// @notice Refund node ETH refinanced from user deposited ETH
    function refund() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitialised {
        // Check refund balance
        require(nodeRefundBalance > 0, "No amount of the node deposit is available for refund");
        // If this minipool was distributed by a user, force finalisation on the node operator
        if (!finalised && userDistributed) {
            // Note: _refund is called inside _finalise
            _finalise();
        } else {
            // Refund node
            _refund();
        }
    }

    /// @notice Called to slash node operator's RPL balance if withdrawal balance was less than user deposit
    function slash() external override onlyInitialised {
        // Check there is a slash balance
        require(nodeSlashBalance > 0, "No balance to slash");
        // Perform slash
        _slash();
    }

    /// @notice Returns true when `stake()` can be called by node operator taking into consideration the scrub period
    function canStake() override external view onlyInitialised returns (bool) {
        // Check status
        if (status != MinipoolStatus.Prelaunch) {
            return false;
        }
        // Get contracts
        RocketDAONodeTrustedSettingsMinipoolInterface rocketDAONodeTrustedSettingsMinipool = RocketDAONodeTrustedSettingsMinipoolInterface(getContractAddress("rocketDAONodeTrustedSettingsMinipool"));
        // Get scrub period
        uint256 scrubPeriod = rocketDAONodeTrustedSettingsMinipool.getScrubPeriod();
        // Check if we have been in prelaunch status for long enough
        return block.timestamp > statusTime + scrubPeriod;
    }

    /// @notice Returns true when `promote()` can be called by node operator taking into consideration the scrub period
    function canPromote() override external view onlyInitialised returns (bool) {
        // Check status
        if (status != MinipoolStatus.Prelaunch) {
            return false;
        }
        // Get contracts
        RocketDAONodeTrustedSettingsMinipoolInterface rocketDAONodeTrustedSettingsMinipool = RocketDAONodeTrustedSettingsMinipoolInterface(getContractAddress("rocketDAONodeTrustedSettingsMinipool"));
        // Get scrub period
        uint256 scrubPeriod = rocketDAONodeTrustedSettingsMinipool.getPromotionScrubPeriod();
        // Check if we have been in prelaunch status for long enough
        return block.timestamp > statusTime + scrubPeriod;
    }

    /// @notice Progress the minipool to staking, sending its ETH deposit to the deposit contract. Only accepts calls from the minipool owner (node) while in prelaunch and once scrub period has ended
    /// @param _validatorSignature A signature over the deposit message object
    /// @param _depositDataRoot The hash tree root of the deposit data object
    function stake(bytes calldata _validatorSignature, bytes32 _depositDataRoot) override external onlyMinipoolOwner(msg.sender) onlyInitialised {
        // Get contracts
        RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
        {
            // Get scrub period
            RocketDAONodeTrustedSettingsMinipoolInterface rocketDAONodeTrustedSettingsMinipool = RocketDAONodeTrustedSettingsMinipoolInterface(getContractAddress("rocketDAONodeTrustedSettingsMinipool"));
            uint256 scrubPeriod = rocketDAONodeTrustedSettingsMinipool.getScrubPeriod();
            // Check current status
            require(status == MinipoolStatus.Prelaunch, "The minipool can only begin staking while in prelaunch");
            require(block.timestamp > statusTime + scrubPeriod, "Not enough time has passed to stake");
            require(!vacant, "Cannot stake a vacant minipool");
        }
        // Progress to staking
        setStatus(MinipoolStatus.Staking);
        // Load contracts
        DepositInterface casperDeposit = DepositInterface(getContractAddress("casperDeposit"));
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        // Get launch amount
        uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance();
        uint256 depositAmount;
        // Legacy minipools had a prestake equal to the bond amount
        if (depositType == MinipoolDeposit.Variable) {
            depositAmount = launchAmount.sub(preLaunchValue);
        } else {
            depositAmount = launchAmount.sub(legacyPrelaunchAmount);
        }
        // Check minipool balance
        require(address(this).balance >= depositAmount, "Insufficient balance to begin staking");
        // Retrieve validator pubkey from storage
        bytes memory validatorPubkey = rocketMinipoolManager.getMinipoolPubkey(address(this));
        // Send staking deposit to casper
        casperDeposit.deposit{value : depositAmount}(validatorPubkey, rocketMinipoolManager.getMinipoolWithdrawalCredentials(address(this)), _validatorSignature, _depositDataRoot);
        // Increment node's number of staking minipools
        rocketMinipoolManager.incrementNodeStakingMinipoolCount(nodeAddress);
    }

    /// @dev Sets the bond value and vacancy flag on this minipool
    /// @param _bondAmount The bond amount selected by the node operator
    /// @param _currentBalance The current balance of the validator on the beaconchain (will be checked by oDAO and scrubbed if not correct)
    function prepareVacancy(uint256 _bondAmount, uint256 _currentBalance) override external onlyLatestContract("rocketMinipoolManager", msg.sender) onlyInitialised {
        // Check status
        require(status == MinipoolStatus.Initialised, "Must be in initialised status");
        // Sanity check that refund balance is zero
        require(nodeRefundBalance == 0, "Refund balance not zero");
        // Check balance
        RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
        uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance();
        require(_currentBalance >= launchAmount, "Balance is too low");
        // Store bond amount
        nodeDepositBalance = _bondAmount;
        // Calculate user amount from launch amount
        userDepositBalance = launchAmount.sub(nodeDepositBalance);
        // Flag as vacant
        vacant = true;
        preMigrationBalance = _currentBalance;
        // Refund the node whatever rewards they have accrued prior to becoming a RP validator
        nodeRefundBalance = _currentBalance.sub(launchAmount);
        // Set status to preLaunch
        setStatus(MinipoolStatus.Prelaunch);
        // Emit event
        emit MinipoolVacancyPrepared(_bondAmount, _currentBalance, block.timestamp);
    }

    /// @dev Promotes this minipool to a complete minipool
    function promote() override external onlyMinipoolOwner(msg.sender) onlyInitialised {
        // Check status
        require(status == MinipoolStatus.Prelaunch, "The minipool can only promote while in prelaunch");
        require(vacant, "Cannot promote a non-vacant minipool");
        // Get contracts
        RocketDAONodeTrustedSettingsMinipoolInterface rocketDAONodeTrustedSettingsMinipool = RocketDAONodeTrustedSettingsMinipoolInterface(getContractAddress("rocketDAONodeTrustedSettingsMinipool"));
        // Clear vacant flag
        vacant = false;
        // Check scrub period
        uint256 scrubPeriod = rocketDAONodeTrustedSettingsMinipool.getPromotionScrubPeriod();
        require(block.timestamp > statusTime + scrubPeriod, "Not enough time has passed to promote");
        // Progress to staking
        setStatus(MinipoolStatus.Staking);
        // Increment node's number of staking minipools
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        rocketMinipoolManager.incrementNodeStakingMinipoolCount(nodeAddress);
        // Set deposit assigned time
        userDepositAssignedTime = block.timestamp;
        // Increase node operator's deposit credit
        RocketNodeDepositInterface rocketNodeDepositInterface = RocketNodeDepositInterface(getContractAddress("rocketNodeDeposit"));
        rocketNodeDepositInterface.increaseDepositCreditBalance(nodeAddress, userDepositBalance);
        // Remove from vacant set
        rocketMinipoolManager.removeVacantMinipool();
        // Emit event
        emit MinipoolPromoted(block.timestamp);
    }

    /// @dev Stakes the balance of this minipool into the deposit contract to set withdrawal credentials to this contract
    /// @param _validatorSignature A signature over the deposit message object
    /// @param _depositDataRoot The hash tree root of the deposit data object
    function preStake(bytes calldata _validatorPubkey, bytes calldata _validatorSignature, bytes32 _depositDataRoot) internal {
        // Load contracts
        DepositInterface casperDeposit = DepositInterface(getContractAddress("casperDeposit"));
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        // Set minipool pubkey
        rocketMinipoolManager.setMinipoolPubkey(_validatorPubkey);
        // Get withdrawal credentials
        bytes memory withdrawalCredentials = rocketMinipoolManager.getMinipoolWithdrawalCredentials(address(this));
        // Send staking deposit to casper
        casperDeposit.deposit{value : preLaunchValue}(_validatorPubkey, withdrawalCredentials, _validatorSignature, _depositDataRoot);
        // Emit event
        emit MinipoolPrestaked(_validatorPubkey, _validatorSignature, _depositDataRoot, preLaunchValue, withdrawalCredentials, block.timestamp);
    }

    /// @notice Distributes the contract's balance.
    ///         If balance is greater or equal to 8 ETH, the NO can call to distribute capital and finalise the minipool.
    ///         If balance is greater or equal to 8 ETH, users who have called `beginUserDistribute` and waited the required
    ///         amount of time can call to distribute capital.
    ///         If balance is lower than 8 ETH, can be called by anyone and is considered a partial withdrawal and funds are
    ///         split as rewards.
    /// @param _rewardsOnly If set to true, will revert if balance is not being treated as rewards
    function distributeBalance(bool _rewardsOnly) override external onlyInitialised {
        // Get node withdrawal address
        address nodeWithdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);
        bool ownerCalling = msg.sender == nodeAddress || msg.sender == nodeWithdrawalAddress;
        // If dissolved, distribute everything to the owner
        if (status == MinipoolStatus.Dissolved) {
            require(ownerCalling, "Only owner can distribute dissolved minipool");
            distributeToOwner();
            return;
        }
        // Can only be called while in staking status
        require(status == MinipoolStatus.Staking, "Minipool must be staking");
        // Get withdrawal amount, we must also account for a possible node refund balance on the contract
        uint256 totalBalance = address(this).balance.sub(nodeRefundBalance);
        if (totalBalance >= 8 ether) {
            // Prevent funding front runs of distribute balance
            require(!_rewardsOnly, "Balance exceeds 8 ether");
            // Consider this a full withdrawal
            _distributeBalance(totalBalance);
            if (ownerCalling) {
                // Finalise the minipool if the owner is calling
                _finalise();
            } else {
                // Require user wait period to pass before allowing user to distribute
                require(userDistributeAllowed(), "Only owner can distribute right now");
                // Mark this minipool as having been distributed by a user
                userDistributed = true;
            }
        } else {
            // Just a partial withdraw
            distributeSkimmedRewards();
            // If node operator is calling, save a tx by calling refund immediately
            if (ownerCalling && nodeRefundBalance > 0) {
                _refund();
            }
        }
        // Reset distribute waiting period
        userDistributeTime = 0;
    }

    /// @dev Distribute the entire balance to the minipool owner
    function distributeToOwner() internal {
        // Get balance
        uint256 balance = address(this).balance;
        // Get node withdrawal address
        address nodeWithdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);
        // Transfer balance
        (bool success,) = nodeWithdrawalAddress.call{value : balance}("");
        require(success, "Node ETH balance was not successfully transferred to node operator");
        // Emit ether withdrawn event
        emit EtherWithdrawn(nodeWithdrawalAddress, balance, block.timestamp);
    }

    /// @notice Allows a user (other than the owner of this minipool) to signal they want to call distribute.
    ///         After waiting the required period, anyone may then call `distributeBalance()`.
    function beginUserDistribute() override external onlyInitialised {
        require(status == MinipoolStatus.Staking, "Minipool must be staking");
        uint256 totalBalance = address(this).balance.sub(nodeRefundBalance);
        require (totalBalance >= 8 ether, "Balance too low");
        // Prevent calls resetting distribute time before window has passed
        RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
        uint256 timeElapsed = block.timestamp.sub(userDistributeTime);
        require(rocketDAOProtocolSettingsMinipool.hasUserDistributeWindowPassed(timeElapsed), "User distribution already pending");
        // Store current time
        userDistributeTime = block.timestamp;
    }

    /// @notice Returns true if enough time has passed for a user to distribute
    function userDistributeAllowed() override public view returns (bool) {
        // Get contracts
        RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
        // Calculate if time elapsed since call to `beginUserDistribute` is within the allowed window
        uint256 timeElapsed = block.timestamp.sub(userDistributeTime);
        return(rocketDAOProtocolSettingsMinipool.isWithinUserDistributeWindow(timeElapsed));
    }

    /// @notice Allows the owner of this minipool to finalise it after a user has manually distributed the balance
    function finalise() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitialised {
        require(userDistributed, "Can only manually finalise after user distribution");
        _finalise();
    }

    /// @dev Perform any slashings, refunds, and unlock NO's stake
    function _finalise() private {
        // Get contracts
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        // Can only finalise the pool once
        require(!finalised, "Minipool has already been finalised");
        // Set finalised flag
        finalised = true;
        // If slash is required then perform it
        if (nodeSlashBalance > 0) {
            _slash();
        }
        // Refund node operator if required
        if (nodeRefundBalance > 0) {
            _refund();
        }
        // Send any left over ETH to rETH contract
        if (address(this).balance > 0) {
            // Send user amount to rETH contract
            payable(rocketTokenRETH).transfer(address(this).balance);
        }
        // Trigger a deposit of excess collateral from rETH contract to deposit pool
        RocketTokenRETHInterface(rocketTokenRETH).depositExcessCollateral();
        // Unlock node operator's RPL
        rocketMinipoolManager.incrementNodeFinalisedMinipoolCount(nodeAddress);
        rocketMinipoolManager.decrementNodeStakingMinipoolCount(nodeAddress);
    }

    /// @dev Distributes balance to user and node operator
    /// @param _balance The amount to distribute
    function _distributeBalance(uint256 _balance) private {
        // Deposit amounts
        uint256 nodeAmount = 0;
        uint256 userCapital = getUserDepositBalance();
        // Check if node operator was slashed
        if (_balance < userCapital) {
            // Only slash on first call to distribute
            if (withdrawalBlock == 0) {
                // Record shortfall for slashing
                nodeSlashBalance = userCapital.sub(_balance);
            }
        } else {
            // Calculate node's share of the balance
            nodeAmount = _calculateNodeShare(_balance);
        }
        // User amount is what's left over from node's share
        uint256 userAmount = _balance.sub(nodeAmount);
        // Pay node operator via refund
        nodeRefundBalance = nodeRefundBalance.add(nodeAmount);
        // Pay user amount to rETH contract
        if (userAmount > 0) {
            // Send user amount to rETH contract
            payable(rocketTokenRETH).transfer(userAmount);
        }
        // Save block to prevent multiple withdrawals within a few blocks
        withdrawalBlock = block.number;
        // Log it
        emit EtherWithdrawalProcessed(msg.sender, nodeAmount, userAmount, _balance, block.timestamp);
    }

    /// @notice Given a balance, this function returns what portion of it belongs to the node taking into
    /// consideration the 8 ether reward threshold, the minipool's commission rate and any penalties it may have
    /// attracted. Another way of describing this function is that if this contract's balance was
    /// `_balance + nodeRefundBalance` this function would return how much of that balance would be paid to the node
    /// operator if a distribution occurred
    /// @param _balance The balance to calculate the node share of. Should exclude nodeRefundBalance
    function calculateNodeShare(uint256 _balance) override public view returns (uint256) {
        // Sub 8 ether balance is treated as rewards
        if (_balance < 8 ether) {
            return calculateNodeRewards(nodeDepositBalance, getUserDepositBalance(), _balance);
        } else {
            return _calculateNodeShare(_balance);
        }
    }

    /// @notice Performs the same calculation as `calculateNodeShare` but on the user side
    /// @param _balance The balance to calculate the node share of. Should exclude nodeRefundBalance
    function calculateUserShare(uint256 _balance) override external view returns (uint256) {
        // User's share is just the balance minus node refund minus node's share
        return _balance.sub(calculateNodeShare(_balance));
    }

    /// @dev Given a balance, this function returns what portion of it belongs to the node taking into
    /// consideration the minipool's commission rate and any penalties it may have attracted
    /// @param _balance The balance to calculate the node share of (with nodeRefundBalance already subtracted)
    function _calculateNodeShare(uint256 _balance) internal view returns (uint256) {
        uint256 userCapital = getUserDepositBalance();
        uint256 nodeCapital = nodeDepositBalance;
        uint256 nodeShare = 0;
        // Calculate the total capital (node + user)
        uint256 capital = userCapital.add(nodeCapital);
        if (_balance > capital) {
            // Total rewards to share
            uint256 rewards = _balance.sub(capital);
            nodeShare = nodeCapital.add(calculateNodeRewards(nodeCapital, userCapital, rewards));
        } else if (_balance > userCapital) {
            nodeShare = _balance.sub(userCapital);
        }
        // Check if node has an ETH penalty
        uint256 penaltyRate = RocketMinipoolPenaltyInterface(rocketMinipoolPenalty).getPenaltyRate(address(this));
        if (penaltyRate > 0) {
            uint256 penaltyAmount = nodeShare.mul(penaltyRate).div(calcBase);
            if (penaltyAmount > nodeShare) {
                penaltyAmount = nodeShare;
            }
            nodeShare = nodeShare.sub(penaltyAmount);
        }
        return nodeShare;
    }

    /// @dev Calculates what portion of rewards should be paid to the node operator given a capital ratio
    /// @param _nodeCapital The node supplied portion of the capital
    /// @param _userCapital The user supplied portion of the capital
    /// @param _rewards The amount of rewards to split
    function calculateNodeRewards(uint256 _nodeCapital, uint256 _userCapital, uint256 _rewards) internal view returns (uint256) {
        // Calculate node and user portion based on proportions of capital provided
        uint256 nodePortion = _rewards.mul(_nodeCapital).div(_userCapital.add(_nodeCapital));
        uint256 userPortion = _rewards.sub(nodePortion);
        // Calculate final node amount as combination of node capital, node share and commission on user share
        return nodePortion.add(userPortion.mul(nodeFee).div(calcBase));
    }

    /// @notice Dissolve the minipool, returning user deposited ETH to the deposit pool.
    function dissolve() override external onlyInitialised {
        // Check current status
        require(status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while in prelaunch");
        // Load contracts
        RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
        // Check if minipool is timed out
        require(block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout(), "The minipool can only be dissolved once it has timed out");
        // Perform the dissolution
        _dissolve();
    }

    /// @notice Withdraw node balances from the minipool and close it. Only accepts calls from the owner
    function close() override external onlyMinipoolOwner(msg.sender) onlyInitialised {
        // Check current status
        require(status == MinipoolStatus.Dissolved, "The minipool can only be closed while dissolved");
        // Distribute funds to owner
        distributeToOwner();
        // Destroy minipool
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        require(rocketMinipoolManager.getMinipoolExists(address(this)), "Minipool already closed");
        rocketMinipoolManager.destroyMinipool();
        // Clear state
        nodeDepositBalance = 0;
        nodeRefundBalance = 0;
        userDepositBalance = 0;
        userDepositBalanceLegacy = 0;
        userDepositAssignedTime = 0;
    }

    /// @notice Can be called by trusted nodes to scrub this minipool if its withdrawal credentials are not set correctly
    function voteScrub() override external onlyInitialised {
        // Check current status
        require(status == MinipoolStatus.Prelaunch, "The minipool can only be scrubbed while in prelaunch");
        // Get contracts
        RocketDAONodeTrustedInterface rocketDAONode = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));
        RocketDAONodeTrustedSettingsMinipoolInterface rocketDAONodeTrustedSettingsMinipool = RocketDAONodeTrustedSettingsMinipoolInterface(getContractAddress("rocketDAONodeTrustedSettingsMinipool"));
        // Must be a trusted member
        require(rocketDAONode.getMemberIsValid(msg.sender), "Not a trusted member");
        // Can only vote once
        require(!memberScrubVotes[msg.sender], "Member has already voted to scrub");
        memberScrubVotes[msg.sender] = true;
        // Emit event
        emit ScrubVoted(msg.sender, block.timestamp);
        // Check if required quorum has voted
        uint256 quorum = rocketDAONode.getMemberCount().mul(rocketDAONodeTrustedSettingsMinipool.getScrubQuorum()).div(calcBase);
        if (totalScrubVotes.add(1) > quorum) {
            // Slash RPL equal to minimum stake amount (if enabled)
            if (!vacant && rocketDAONodeTrustedSettingsMinipool.getScrubPenaltyEnabled()){
                RocketNodeStakingInterface rocketNodeStaking = RocketNodeStakingInterface(getContractAddress("rocketNodeStaking"));
                RocketDAOProtocolSettingsNodeInterface rocketDAOProtocolSettingsNode = RocketDAOProtocolSettingsNodeInterface(getContractAddress("rocketDAOProtocolSettingsNode"));
                RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
                uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance();
                // Slash amount is minRplStake * userCapital
                // In prelaunch userDepositBalance hasn't been set so we calculate it as 32 ETH - bond amount
                rocketNodeStaking.slashRPL(
                    nodeAddress,
                        launchAmount.sub(nodeDepositBalance)
                        .mul(rocketDAOProtocolSettingsNode.getMinimumPerMinipoolStake())
                        .div(calcBase)
                );
            }
            // Dissolve this minipool, recycling ETH back to deposit pool
            _dissolve();
            // Emit event
            emit MinipoolScrubbed(block.timestamp);
        } else {
            // Increment total
            totalScrubVotes = totalScrubVotes.add(1);
        }
    }

    /// @notice Reduces the ETH bond amount and credits the owner the difference
    function reduceBondAmount() override external onlyMinipoolOwner(msg.sender) onlyInitialised {
        require(status == MinipoolStatus.Staking, "Minipool must be staking");
        // If balance is greater than 8 ether, it is assumed to be capital not skimmed rewards. So prevent reduction
        uint256 totalBalance = address(this).balance.sub(nodeRefundBalance);
        require(totalBalance < 8 ether, "Cannot reduce bond with balance of 8 ether or more");
        // Distribute any skimmed rewards
        distributeSkimmedRewards();
        // Approve reduction and handle external state changes
        RocketMinipoolBondReducerInterface rocketBondReducer = RocketMinipoolBondReducerInterface(getContractAddress("rocketMinipoolBondReducer"));
        uint256 previousBond = nodeDepositBalance;
        uint256 newBond = rocketBondReducer.reduceBondAmount();
        // Update user/node balances
        userDepositBalance = getUserDepositBalance().add(previousBond.sub(newBond));
        nodeDepositBalance = newBond;
        // Reset node fee to current network rate
        RocketNetworkFeesInterface rocketNetworkFees = RocketNetworkFeesInterface(getContractAddress("rocketNetworkFees"));
        uint256 prevFee = nodeFee;
        uint256 newFee = rocketNetworkFees.getNodeFee();
        nodeFee = newFee;
        // Update staking minipool counts and fee numerator
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        rocketMinipoolManager.updateNodeStakingMinipoolCount(previousBond, newBond, prevFee, newFee);
        // Break state to prevent rollback exploit
        if (depositType != MinipoolDeposit.Variable) {
            userDepositBalanceLegacy = 2 ** 256 - 1;
            depositType = MinipoolDeposit.Variable;
        }
        // Emit event
        emit BondReduced(previousBond, newBond, block.timestamp);
    }

    /// @dev Distributes the current contract balance based on capital ratio and node fee
    function distributeSkimmedRewards() internal {
        uint256 rewards = address(this).balance.sub(nodeRefundBalance);
        uint256 nodeShare = calculateNodeRewards(nodeDepositBalance, getUserDepositBalance(), rewards);
        // Pay node operator via refund mechanism
        nodeRefundBalance = nodeRefundBalance.add(nodeShare);
        // Deposit user share into rETH contract
        payable(rocketTokenRETH).transfer(rewards.sub(nodeShare));
    }

    /// @dev Set the minipool's current status
    /// @param _status The new status
    function setStatus(MinipoolStatus _status) private {
        // Update status
        status = _status;
        statusBlock = block.number;
        statusTime = block.timestamp;
        // Emit status updated event
        emit StatusUpdated(uint8(_status), block.timestamp);
    }

    /// @dev Transfer refunded ETH balance to the node operator
    function _refund() private {
        // Prevent vacant minipools from calling
        require(vacant == false, "Vacant minipool cannot refund");
        // Update refund balance
        uint256 refundAmount = nodeRefundBalance;
        nodeRefundBalance = 0;
        // Get node withdrawal address
        address nodeWithdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);
        // Transfer refund amount
        (bool success,) = nodeWithdrawalAddress.call{value : refundAmount}("");
        require(success, "ETH refund amount was not successfully transferred to node operator");
        // Emit ether withdrawn event
        emit EtherWithdrawn(nodeWithdrawalAddress, refundAmount, block.timestamp);
    }

    /// @dev Slash node operator's RPL balance based on nodeSlashBalance
    function _slash() private {
        // Get contracts
        RocketNodeStakingInterface rocketNodeStaking = RocketNodeStakingInterface(getContractAddress("rocketNodeStaking"));
        // Slash required amount and reset storage value
        uint256 slashAmount = nodeSlashBalance;
        nodeSlashBalance = 0;
        rocketNodeStaking.slashRPL(nodeAddress, slashAmount);
    }

    /// @dev Dissolve this minipool
    function _dissolve() private {
        // Get contracts
        RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(getContractAddress("rocketDepositPool"));
        RocketMinipoolQueueInterface rocketMinipoolQueue = RocketMinipoolQueueInterface(getContractAddress("rocketMinipoolQueue"));
        // Progress to dissolved
        setStatus(MinipoolStatus.Dissolved);
        if (vacant) {
            // Vacant minipools waiting to be promoted need to be removed from the set maintained by the minipool manager
            RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
            rocketMinipoolManager.removeVacantMinipool();
        } else {
            if (depositType == MinipoolDeposit.Full) {
                // Handle legacy Full type minipool
                rocketMinipoolQueue.removeMinipool(MinipoolDeposit.Full);
            } else {
                // Transfer user balance to deposit pool
                uint256 userCapital = getUserDepositBalance();
                rocketDepositPool.recycleDissolvedDeposit{value : userCapital}();
                // Emit ether withdrawn event
                emit EtherWithdrawn(address(rocketDepositPool), userCapital, block.timestamp);
            }
        }
    }
}

File 2 of 23 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 3 of 23 : RocketStorageInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketStorageInterface {

    // Deploy status
    function getDeployedStatus() external view returns (bool);

    // Guardian
    function getGuardian() external view returns(address);
    function setGuardian(address _newAddress) external;
    function confirmGuardian() external;

    // Getters
    function getAddress(bytes32 _key) external view returns (address);
    function getUint(bytes32 _key) external view returns (uint);
    function getString(bytes32 _key) external view returns (string memory);
    function getBytes(bytes32 _key) external view returns (bytes memory);
    function getBool(bytes32 _key) external view returns (bool);
    function getInt(bytes32 _key) external view returns (int);
    function getBytes32(bytes32 _key) external view returns (bytes32);

    // Setters
    function setAddress(bytes32 _key, address _value) external;
    function setUint(bytes32 _key, uint _value) external;
    function setString(bytes32 _key, string calldata _value) external;
    function setBytes(bytes32 _key, bytes calldata _value) external;
    function setBool(bytes32 _key, bool _value) external;
    function setInt(bytes32 _key, int _value) external;
    function setBytes32(bytes32 _key, bytes32 _value) external;

    // Deleters
    function deleteAddress(bytes32 _key) external;
    function deleteUint(bytes32 _key) external;
    function deleteString(bytes32 _key) external;
    function deleteBytes(bytes32 _key) external;
    function deleteBool(bytes32 _key) external;
    function deleteInt(bytes32 _key) external;
    function deleteBytes32(bytes32 _key) external;

    // Arithmetic
    function addUint(bytes32 _key, uint256 _amount) external;
    function subUint(bytes32 _key, uint256 _amount) external;

    // Protected storage
    function getNodeWithdrawalAddress(address _nodeAddress) external view returns (address);
    function getNodePendingWithdrawalAddress(address _nodeAddress) external view returns (address);
    function setWithdrawalAddress(address _nodeAddress, address _newWithdrawalAddress, bool _confirm) external;
    function confirmWithdrawalAddress(address _nodeAddress) external;
}

File 4 of 23 : MinipoolDeposit.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity 0.7.6;

// SPDX-License-Identifier: GPL-3.0-only

// Represents the type of deposits required by a minipool

enum MinipoolDeposit {
    None,       // Marks an invalid deposit type
    Full,       // The minipool requires 32 ETH from the node operator, 16 ETH of which will be refinanced from user deposits
    Half,       // The minipool required 16 ETH from the node operator to be matched with 16 ETH from user deposits
    Empty,      // The minipool requires 0 ETH from the node operator to be matched with 32 ETH from user deposits (trusted nodes only)
    Variable    // Indicates this minipool is of the new generation that supports a variable deposit amount
}

File 5 of 23 : MinipoolStatus.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity 0.7.6;

// SPDX-License-Identifier: GPL-3.0-only

// Represents a minipool's status within the network

enum MinipoolStatus {
    Initialised,    // The minipool has been initialised and is awaiting a deposit of user ETH
    Prelaunch,      // The minipool has enough ETH to begin staking and is awaiting launch by the node operator
    Staking,        // The minipool is currently staking
    Withdrawable,   // NO LONGER USED
    Dissolved       // The minipool has been dissolved and its user deposited ETH has been returned to the deposit pool
}

File 6 of 23 : RocketMinipoolStorageLayout.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity 0.7.6;

// SPDX-License-Identifier: GPL-3.0-only

import "../../interface/RocketStorageInterface.sol";
import "../../types/MinipoolDeposit.sol";
import "../../types/MinipoolStatus.sol";

// The RocketMinipool contract storage layout, shared by RocketMinipoolDelegate

// ******************************************************
// Note: This contract MUST NOT BE UPDATED after launch.
// All deployed minipool contracts must maintain a
// Consistent storage layout with RocketMinipoolDelegate.
// ******************************************************

abstract contract RocketMinipoolStorageLayout {
    // Storage state enum
    enum StorageState {
        Undefined,
        Uninitialised,
        Initialised
    }

	// Main Rocket Pool storage contract
    RocketStorageInterface internal rocketStorage = RocketStorageInterface(0);

    // Status
    MinipoolStatus internal status;
    uint256 internal statusBlock;
    uint256 internal statusTime;
    uint256 internal withdrawalBlock;

    // Deposit type
    MinipoolDeposit internal depositType;

    // Node details
    address internal nodeAddress;
    uint256 internal nodeFee;
    uint256 internal nodeDepositBalance;
    bool internal nodeDepositAssigned;          // NO LONGER IN USE
    uint256 internal nodeRefundBalance;
    uint256 internal nodeSlashBalance;

    // User deposit details
    uint256 internal userDepositBalanceLegacy;
    uint256 internal userDepositAssignedTime;

    // Upgrade options
    bool internal useLatestDelegate = false;
    address internal rocketMinipoolDelegate;
    address internal rocketMinipoolDelegatePrev;

    // Local copy of RETH address
    address internal rocketTokenRETH;

    // Local copy of penalty contract
    address internal rocketMinipoolPenalty;

    // Used to prevent direct access to delegate and prevent calling initialise more than once
    StorageState internal storageState = StorageState.Undefined;

    // Whether node operator has finalised the pool
    bool internal finalised;

    // Trusted member scrub votes
    mapping(address => bool) internal memberScrubVotes;
    uint256 internal totalScrubVotes;

    // Variable minipool
    uint256 internal preLaunchValue;
    uint256 internal userDepositBalance;

    // Vacant minipool
    bool internal vacant;
    uint256 internal preMigrationBalance;

    // User distribution
    bool internal userDistributed;
    uint256 internal userDistributeTime;
}

File 7 of 23 : DepositInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface DepositInterface {
    function deposit(bytes calldata _pubkey, bytes calldata _withdrawalCredentials, bytes calldata _signature, bytes32 _depositDataRoot) external payable;
}

File 8 of 23 : RocketDepositPoolInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketDepositPoolInterface {
    function getBalance() external view returns (uint256);
    function getNodeBalance() external view returns (uint256);
    function getUserBalance() external view returns (int256);
    function getExcessBalance() external view returns (uint256);
    function deposit() external payable;
    function getMaximumDepositAmount() external view returns (uint256);
    function nodeDeposit(uint256 _totalAmount) external payable;
    function nodeCreditWithdrawal(uint256 _amount) external;
    function recycleDissolvedDeposit() external payable;
    function recycleExcessCollateral() external payable;
    function recycleLiquidatedStake() external payable;
    function assignDeposits() external;
    function maybeAssignDeposits() external returns (bool);
    function withdrawExcessBalance(uint256 _amount) external;
}

File 9 of 23 : RocketMinipoolInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

import "../../types/MinipoolDeposit.sol";
import "../../types/MinipoolStatus.sol";
import "../RocketStorageInterface.sol";

interface RocketMinipoolInterface {
    function version() external view returns (uint8);
    function initialise(address _nodeAddress) external;
    function getStatus() external view returns (MinipoolStatus);
    function getFinalised() external view returns (bool);
    function getStatusBlock() external view returns (uint256);
    function getStatusTime() external view returns (uint256);
    function getScrubVoted(address _member) external view returns (bool);
    function getDepositType() external view returns (MinipoolDeposit);
    function getNodeAddress() external view returns (address);
    function getNodeFee() external view returns (uint256);
    function getNodeDepositBalance() external view returns (uint256);
    function getNodeRefundBalance() external view returns (uint256);
    function getNodeDepositAssigned() external view returns (bool);
    function getPreLaunchValue() external view returns (uint256);
    function getNodeTopUpValue() external view returns (uint256);
    function getVacant() external view returns (bool);
    function getPreMigrationBalance() external view returns (uint256);
    function getUserDistributed() external view returns (bool);
    function getUserDepositBalance() external view returns (uint256);
    function getUserDepositAssigned() external view returns (bool);
    function getUserDepositAssignedTime() external view returns (uint256);
    function getTotalScrubVotes() external view returns (uint256);
    function calculateNodeShare(uint256 _balance) external view returns (uint256);
    function calculateUserShare(uint256 _balance) external view returns (uint256);
    function preDeposit(uint256 _bondingValue, bytes calldata _validatorPubkey, bytes calldata _validatorSignature, bytes32 _depositDataRoot) external payable;
    function deposit() external payable;
    function userDeposit() external payable;
    function distributeBalance(bool _rewardsOnly) external;
    function beginUserDistribute() external;
    function userDistributeAllowed() external view returns (bool);
    function refund() external;
    function slash() external;
    function finalise() external;
    function canStake() external view returns (bool);
    function canPromote() external view returns (bool);
    function stake(bytes calldata _validatorSignature, bytes32 _depositDataRoot) external;
    function prepareVacancy(uint256 _bondAmount, uint256 _currentBalance) external;
    function promote() external;
    function dissolve() external;
    function close() external;
    function voteScrub() external;
    function reduceBondAmount() external;
}

File 10 of 23 : MinipoolDetails.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity 0.7.6;

// SPDX-License-Identifier: GPL-3.0-only

import "./MinipoolDeposit.sol";
import "./MinipoolStatus.sol";

// A struct containing all the information on-chain about a specific minipool

struct MinipoolDetails {
    bool exists;
    address minipoolAddress;
    bytes pubkey;
    MinipoolStatus status;
    uint256 statusBlock;
    uint256 statusTime;
    bool finalised;
    MinipoolDeposit depositType;
    uint256 nodeFee;
    uint256 nodeDepositBalance;
    bool nodeDepositAssigned;
    uint256 userDepositBalance;
    bool userDepositAssigned;
    uint256 userDepositAssignedTime;
    bool useLatestDelegate;
    address delegate;
    address previousDelegate;
    address effectiveDelegate;
    uint256 penaltyCount;
    uint256 penaltyRate;
    address nodeAddress;
}

File 11 of 23 : RocketMinipoolManagerInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "../../types/MinipoolDeposit.sol";
import "../../types/MinipoolDetails.sol";
import "./RocketMinipoolInterface.sol";

interface RocketMinipoolManagerInterface {
    function getMinipoolCount() external view returns (uint256);
    function getStakingMinipoolCount() external view returns (uint256);
    function getFinalisedMinipoolCount() external view returns (uint256);
    function getActiveMinipoolCount() external view returns (uint256);
    function getMinipoolRPLSlashed(address _minipoolAddress) external view returns (bool);
    function getMinipoolCountPerStatus(uint256 offset, uint256 limit) external view returns (uint256, uint256, uint256, uint256, uint256);
    function getPrelaunchMinipools(uint256 offset, uint256 limit) external view returns (address[] memory);
    function getMinipoolAt(uint256 _index) external view returns (address);
    function getNodeMinipoolCount(address _nodeAddress) external view returns (uint256);
    function getNodeActiveMinipoolCount(address _nodeAddress) external view returns (uint256);
    function getNodeFinalisedMinipoolCount(address _nodeAddress) external view returns (uint256);
    function getNodeStakingMinipoolCount(address _nodeAddress) external view returns (uint256);
    function getNodeStakingMinipoolCountBySize(address _nodeAddress, uint256 _depositSize) external view returns (uint256);
    function getNodeMinipoolAt(address _nodeAddress, uint256 _index) external view returns (address);
    function getNodeValidatingMinipoolCount(address _nodeAddress) external view returns (uint256);
    function getNodeValidatingMinipoolAt(address _nodeAddress, uint256 _index) external view returns (address);
    function getMinipoolByPubkey(bytes calldata _pubkey) external view returns (address);
    function getMinipoolExists(address _minipoolAddress) external view returns (bool);
    function getMinipoolDestroyed(address _minipoolAddress) external view returns (bool);
    function getMinipoolPubkey(address _minipoolAddress) external view returns (bytes memory);
    function updateNodeStakingMinipoolCount(uint256 _previousBond, uint256 _newBond, uint256 _previousFee, uint256 _newFee) external;
    function getMinipoolWithdrawalCredentials(address _minipoolAddress) external pure returns (bytes memory);
    function createMinipool(address _nodeAddress, uint256 _salt) external returns (RocketMinipoolInterface);
    function createVacantMinipool(address _nodeAddress, uint256 _salt, bytes calldata _validatorPubkey, uint256 _bondAmount, uint256 _currentBalance) external returns (RocketMinipoolInterface);
    function removeVacantMinipool() external;
    function getVacantMinipoolCount() external view returns (uint256);
    function getVacantMinipoolAt(uint256 _index) external view returns (address);
    function destroyMinipool() external;
    function incrementNodeStakingMinipoolCount(address _nodeAddress) external;
    function decrementNodeStakingMinipoolCount(address _nodeAddress) external;
    function incrementNodeFinalisedMinipoolCount(address _nodeAddress) external;
    function setMinipoolPubkey(bytes calldata _pubkey) external;
    function getMinipoolDepositType(address _minipoolAddress) external view returns (MinipoolDeposit);
}

File 12 of 23 : RocketMinipoolQueueInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

import "../../types/MinipoolDeposit.sol";

interface RocketMinipoolQueueInterface {
    function getTotalLength() external view returns (uint256);
    function getContainsLegacy() external view returns (bool);
    function getLengthLegacy(MinipoolDeposit _depositType) external view returns (uint256);
    function getLength() external view returns (uint256);
    function getTotalCapacity() external view returns (uint256);
    function getEffectiveCapacity() external view returns (uint256);
    function getNextCapacityLegacy() external view returns (uint256);
    function getNextDepositLegacy() external view returns (MinipoolDeposit, uint256);
    function enqueueMinipool(address _minipool) external;
    function dequeueMinipoolByDepositLegacy(MinipoolDeposit _depositType) external returns (address minipoolAddress);
    function dequeueMinipools(uint256 _maxToDequeue) external returns (address[] memory minipoolAddress);
    function removeMinipool(MinipoolDeposit _depositType) external;
    function getMinipoolAt(uint256 _index) external view returns(address);
    function getMinipoolPosition(address _minipool) external view returns (int256);
}

File 13 of 23 : RocketMinipoolPenaltyInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketMinipoolPenaltyInterface {
    // Max penalty rate
    function setMaxPenaltyRate(uint256 _rate) external;
    function getMaxPenaltyRate() external view returns (uint256);

    // Penalty rate
    function setPenaltyRate(address _minipoolAddress, uint256 _rate) external;
    function getPenaltyRate(address _minipoolAddress) external view returns(uint256);
}

File 14 of 23 : RocketNodeStakingInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketNodeStakingInterface {
    function getTotalRPLStake() external view returns (uint256);
    function getNodeRPLStake(address _nodeAddress) external view returns (uint256);
    function getNodeETHMatched(address _nodeAddress) external view returns (uint256);
    function getNodeETHProvided(address _nodeAddress) external view returns (uint256);
    function getNodeETHCollateralisationRatio(address _nodeAddress) external view returns (uint256);
    function getNodeRPLStakedTime(address _nodeAddress) external view returns (uint256);
    function getNodeEffectiveRPLStake(address _nodeAddress) external view returns (uint256);
    function getNodeMinimumRPLStake(address _nodeAddress) external view returns (uint256);
    function getNodeMaximumRPLStake(address _nodeAddress) external view returns (uint256);
    function getNodeETHMatchedLimit(address _nodeAddress) external view returns (uint256);
    function stakeRPL(uint256 _amount) external;
    function stakeRPLFor(address _nodeAddress, uint256 _amount) external;
    function setStakeRPLForAllowed(address _caller, bool _allowed) external;
    function withdrawRPL(uint256 _amount) external;
    function slashRPL(address _nodeAddress, uint256 _ethSlashAmount) external;
}

File 15 of 23 : RocketDAOProtocolSettingsMinipoolInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

import "../../../../types/MinipoolDeposit.sol";

interface RocketDAOProtocolSettingsMinipoolInterface {
    function getLaunchBalance() external view returns (uint256);
    function getPreLaunchValue() external pure returns (uint256);
    function getDepositUserAmount(MinipoolDeposit _depositType) external view returns (uint256);
    function getFullDepositUserAmount() external view returns (uint256);
    function getHalfDepositUserAmount() external view returns (uint256);
    function getVariableDepositAmount() external view returns (uint256);
    function getSubmitWithdrawableEnabled() external view returns (bool);
    function getBondReductionEnabled() external view returns (bool);
    function getLaunchTimeout() external view returns (uint256);
    function getMaximumCount() external view returns (uint256);
    function isWithinUserDistributeWindow(uint256 _time) external view returns (bool);
    function hasUserDistributeWindowPassed(uint256 _time) external view returns (bool);
    function getUserDistributeWindowStart() external view returns (uint256);
    function getUserDistributeWindowLength() external view returns (uint256);
}

File 16 of 23 : RocketDAONodeTrustedSettingsMinipoolInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketDAONodeTrustedSettingsMinipoolInterface {
    function getScrubPeriod() external view returns(uint256);
    function getPromotionScrubPeriod() external view returns(uint256);
    function getScrubQuorum() external view returns(uint256);
    function getCancelBondReductionQuorum() external view returns(uint256);
    function getScrubPenaltyEnabled() external view returns(bool);
    function isWithinBondReductionWindow(uint256 _time) external view returns (bool);
    function getBondReductionWindowStart() external view returns (uint256);
    function getBondReductionWindowLength() external view returns (uint256);
}

File 17 of 23 : RocketDAOProtocolSettingsNodeInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketDAOProtocolSettingsNodeInterface {
    function getRegistrationEnabled() external view returns (bool);
    function getSmoothingPoolRegistrationEnabled() external view returns (bool);
    function getDepositEnabled() external view returns (bool);
    function getVacantMinipoolsEnabled() external view returns (bool);
    function getMinimumPerMinipoolStake() external view returns (uint256);
    function getMaximumPerMinipoolStake() external view returns (uint256);
}

File 18 of 23 : RocketDAONodeTrustedInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketDAONodeTrustedInterface {
    function getBootstrapModeDisabled() external view returns (bool);
    function getMemberQuorumVotesRequired() external view returns (uint256);
    function getMemberAt(uint256 _index) external view returns (address);
    function getMemberCount() external view returns (uint256);
    function getMemberMinRequired() external view returns (uint256);
    function getMemberIsValid(address _nodeAddress) external view returns (bool);
    function getMemberLastProposalTime(address _nodeAddress) external view returns (uint256);
    function getMemberID(address _nodeAddress) external view returns (string memory);
    function getMemberUrl(address _nodeAddress) external view returns (string memory);
    function getMemberJoinedTime(address _nodeAddress) external view returns (uint256);
    function getMemberProposalExecutedTime(string memory _proposalType, address _nodeAddress) external view returns (uint256);
    function getMemberRPLBondAmount(address _nodeAddress) external view returns (uint256);
    function getMemberIsChallenged(address _nodeAddress) external view returns (bool);
    function getMemberUnbondedValidatorCount(address _nodeAddress) external view returns (uint256);
    function incrementMemberUnbondedValidatorCount(address _nodeAddress) external;
    function decrementMemberUnbondedValidatorCount(address _nodeAddress) external;
    function bootstrapMember(string memory _id, string memory _url, address _nodeAddress) external;
    function bootstrapSettingUint(string memory _settingContractName, string memory _settingPath, uint256 _value) external;
    function bootstrapSettingBool(string memory _settingContractName, string memory _settingPath, bool _value) external;
    function bootstrapUpgrade(string memory _type, string memory _name, string memory _contractAbi, address _contractAddress) external;
    function bootstrapDisable(bool _confirmDisableBootstrapMode) external;
    function memberJoinRequired(string memory _id, string memory _url) external;
}

File 19 of 23 : RocketNetworkFeesInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketNetworkFeesInterface {
    function getNodeDemand() external view returns (int256);
    function getNodeFee() external view returns (uint256);
    function getNodeFeeByDemand(int256 _nodeDemand) external view returns (uint256);
}

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 21 of 23 : RocketTokenRETHInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

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

interface RocketTokenRETHInterface is IERC20 {
    function getEthValue(uint256 _rethAmount) external view returns (uint256);
    function getRethValue(uint256 _ethAmount) external view returns (uint256);
    function getExchangeRate() external view returns (uint256);
    function getTotalCollateral() external view returns (uint256);
    function getCollateralRate() external view returns (uint256);
    function depositExcess() external payable;
    function depositExcessCollateral() external;
    function mint(uint256 _ethAmount, address _to) external;
    function burn(uint256 _rethAmount) external;
}

File 22 of 23 : RocketNodeDepositInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

import "../../types/MinipoolDeposit.sol";

interface RocketNodeDepositInterface {
    function getNodeDepositCredit(address _nodeOperator) external view returns (uint256);
    function increaseDepositCreditBalance(address _nodeOperator, uint256 _amount) external;
    function deposit(uint256 _depositAmount, uint256 _minimumNodeFee, bytes calldata _validatorPubkey, bytes calldata _validatorSignature, bytes32 _depositDataRoot, uint256 _salt, address _expectedMinipoolAddress) external payable;
    function depositWithCredit(uint256 _depositAmount, uint256 _minimumNodeFee, bytes calldata _validatorPubkey, bytes calldata _validatorSignature, bytes32 _depositDataRoot, uint256 _salt, address _expectedMinipoolAddress) external payable;
    function isValidDepositAmount(uint256 _amount) external pure returns (bool);
    function getDepositAmounts() external pure returns (uint256[] memory);
    function createVacantMinipool(uint256 _bondAmount, uint256 _minimumNodeFee, bytes calldata _validatorPubkey, uint256 _salt, address _expectedMinipoolAddress, uint256 _currentBalance) external;
    function increaseEthMatched(address _nodeAddress, uint256 _amount) external;
}

File 23 of 23 : RocketMinipoolBondReducerInterface.sol
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >0.5.0 <0.9.0;
pragma abicoder v2;

interface RocketMinipoolBondReducerInterface {
    function beginReduceBondAmount(address _minipoolAddress, uint256 _newBondAmount) external;
    function getReduceBondTime(address _minipoolAddress) external view returns (uint256);
    function getReduceBondValue(address _minipoolAddress) external view returns (uint256);
    function getReduceBondCancelled(address _minipoolAddress) external view returns (bool);
    function canReduceBondAmount(address _minipoolAddress) external view returns (bool);
    function voteCancelReduction(address _minipoolAddress) external;
    function reduceBondAmount() external returns (uint256);
    function getLastBondReductionTime(address _minipoolAddress) external view returns (uint256);
    function getLastBondReductionPrevValue(address _minipoolAddress) external view returns (uint256);
    function getLastBondReductionPrevNodeFee(address _minipoolAddress) external view returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousBondAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBondAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"BondReduced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"EtherDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executed","type":"address"},{"indexed":false,"internalType":"uint256","name":"nodeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"EtherWithdrawalProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"EtherWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"validatorPubkey","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"validatorSignature","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"depositDataRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"withdrawalCredentials","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MinipoolPrestaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MinipoolPromoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MinipoolScrubbed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bondAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MinipoolVacancyPrepared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"member","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ScrubVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"status","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StatusUpdated","type":"event"},{"inputs":[],"name":"beginUserDistribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balance","type":"uint256"}],"name":"calculateNodeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balance","type":"uint256"}],"name":"calculateUserShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPromote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"close","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dissolve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_rewardsOnly","type":"bool"}],"name":"distributeBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalise","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDepositType","outputs":[{"internalType":"enum MinipoolDeposit","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFinalised","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeDepositAssigned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeDepositBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeRefundBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeTopUpValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPreLaunchValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPreMigrationBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_member","type":"address"}],"name":"getScrubVoted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatus","outputs":[{"internalType":"enum MinipoolStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatusBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatusTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalScrubVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserDepositAssigned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserDepositAssignedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserDepositBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserDistributed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVacant","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"initialise","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bondValue","type":"uint256"},{"internalType":"bytes","name":"_validatorPubkey","type":"bytes"},{"internalType":"bytes","name":"_validatorSignature","type":"bytes"},{"internalType":"bytes32","name":"_depositDataRoot","type":"bytes32"}],"name":"preDeposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bondAmount","type":"uint256"},{"internalType":"uint256","name":"_currentBalance","type":"uint256"}],"name":"prepareVacancy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"promote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reduceBondAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_validatorSignature","type":"bytes"},{"internalType":"bytes32","name":"_depositDataRoot","type":"bytes32"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userDeposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"userDistributeAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteScrub","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600080546001600160a01b0319169055600c805460ff19169055600f805460ff60a01b1916905534801561003757600080fd5b50615ae080620000486000396000f3fe6080604052600436106102d15760003560e01c80637bfaef7d11610179578063d2ceebd1116100d6578063e67cd5b01161008a578063f09fa33211610064578063f09fa332146107a1578063f7ae36d1146107b6578063fbc02c4214610833576102d1565b8063e67cd5b014610762578063e715013414610777578063e7e04aba1461078c576102d1565b8063d6047def116100bb578063d6047def14610738578063d91eda62146105b2578063e117d1921461074d576102d1565b8063d2ceebd1146106f0578063d45dc62814610705576102d1565b8063a43992631161012d578063c9c36b2711610112578063c9c36b27146106be578063d0e30db0146106d3578063d191ea9c146106db576102d1565b8063a439926314610694578063bbe38fe1146106a9576102d1565b80639ed278091161015e5780639ed2780914610655578063a129a5ee1461066a578063a2940a901461067f576102d1565b80637bfaef7d1461060d5780639d6a890f14610622576102d1565b80634814611311610232578063590e1ae3116101e657806369c089ea116101c057806369c089ea146105b257806370dabc9e146105c757806374ca6bf2146105f8576102d1565b8063590e1ae3146105735780635abd37e41461058857806368f449b21461059d576102d1565b80634e69d560116102175780634e69d560146104e657806354efc6e51461051c57806354fd4d5014610548576102d1565b806348146113146104c957806349b42321146104d1576102d1565b80632da25de3116102895780633ca742e91161026e5780633ca742e9146103d65780633e0a56b01461049f57806343d726d6146104b4576102d1565b80632da25de3146103ac5780633bef8a3a146103c1576102d1565b806319f18b1f116102ba57806319f18b1f1461031d5780631a69d18f1461035957806323e4e3e414610383576102d1565b80630871ffef146102d657806313dc01dc14610308575b600080fd5b3480156102e257600080fd5b50610306600480360360408110156102f957600080fd5b5080359060200135610848565b005b34801561031457600080fd5b50610306610b9c565b34801561032957600080fd5b506103476004803603602081101561034057600080fd5b5035611042565b60408051918252519081900360200190f35b34801561036557600080fd5b506103476004803603602081101561037c57600080fd5b503561105f565b34801561038f57600080fd5b50610398611095565b604080519115158252519081900360200190f35b3480156103b857600080fd5b5061030661114c565b3480156103cd57600080fd5b50610306611219565b610306600480360360808110156103ec57600080fd5b8135919081019060408101602082013564010000000081111561040e57600080fd5b82018360208201111561042057600080fd5b8035906020019184600183028401116401000000008311171561044257600080fd5b91939092909160208101903564010000000081111561046057600080fd5b82018360208201111561047257600080fd5b8035906020019184600183028401116401000000008311171561049457600080fd5b9193509150356113bb565b3480156104ab57600080fd5b506103476115d2565b3480156104c057600080fd5b506103066115d8565b610306611884565b3480156104dd57600080fd5b50610347611af6565b3480156104f257600080fd5b506104fb611afc565b6040518082600481111561050b57fe5b815260200191505060405180910390f35b34801561052857600080fd5b506103066004803603602081101561053f57600080fd5b50351515611b0c565b34801561055457600080fd5b5061055d611e53565b6040805160ff9092168252519081900360200190f35b34801561057f57600080fd5b50610306611e58565b34801561059457600080fd5b506104fb612063565b3480156105a957600080fd5b5061034761206c565b3480156105be57600080fd5b50610398612072565b3480156105d357600080fd5b506105dc61207a565b604080516001600160a01b039092168252519081900360200190f35b34801561060457600080fd5b5061034761208e565b34801561061957600080fd5b50610398612094565b34801561062e57600080fd5b506103066004803603602081101561064557600080fd5b50356001600160a01b031661209d565b34801561066157600080fd5b506103986123c9565b34801561067657600080fd5b506103986124f7565b34801561068b57600080fd5b50610347612519565b3480156106a057600080fd5b5061030661251f565b3480156106b557600080fd5b506103986126ea565b3480156106ca57600080fd5b506103986126f3565b6103066127e8565b3480156106e757600080fd5b50610306612a01565b3480156106fc57600080fd5b50610347612ea5565b34801561071157600080fd5b506103986004803603602081101561072857600080fd5b50356001600160a01b0316612ec3565b34801561074457600080fd5b50610347612ee1565b34801561075957600080fd5b50610306612ee7565b34801561076e57600080fd5b506103476135c3565b34801561078357600080fd5b506103476135c9565b34801561079857600080fd5b506103476135cf565b3480156107ad57600080fd5b506103066135fb565b3480156107c257600080fd5b50610306600480360360408110156107d957600080fd5b8101906020810181356401000000008111156107f457600080fd5b82018360208201111561080657600080fd5b8035906020019184600183028401116401000000008311171561082857600080fd5b91935091503561383b565b34801561083f57600080fd5b506103476140c8565b6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525033610888826140ce565b6001600160a01b0316816001600160a01b0316146108ed576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561090757fe5b14610959576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff16600481111561097257fe5b146109c4576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e20696e697469616c6973656420737461747573000000604482015290519081900360640190fd5b60085415610a19576040805162461bcd60e51b815260206004820152601760248201527f526566756e642062616c616e6365206e6f74207a65726f000000000000000000604482015290519081900360640190fd5b6000610a3c604051806060016040528060218152602001615901602191396140ce565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7957600080fd5b505afa158015610a8d573d6000803e3d6000fd5b505050506040513d6020811015610aa357600080fd5b5051905080851015610afc576040805162461bcd60e51b815260206004820152601260248201527f42616c616e636520697320746f6f206c6f770000000000000000000000000000604482015290519081900360640190fd5b6006869055610b0b8187614264565b601355601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556015859055610b488582614264565b600855610b5560016142c6565b6040805187815260208101879052428183015290517ff7cb92de8d4b074aafcfa9bdb83842b1ef40f49087a9eb04996d68a012de105c9181900360600190a1505050505050565b600454339061010090046001600160a01b03168114610c02576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115610c1c57fe5b14610c6e576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff166004811115610c8857fe5b14610cc45760405162461bcd60e51b81526004018080602001828103825260308152602001806156756030913960400191505060405180910390fd5b60145460ff16610d055760405162461bcd60e51b815260040180806020018281038252602481526020018061571d6024913960400191505060405180910390fd5b6000610d286040518060600160405280602481526020016155a7602491396140ce565b601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055604080517f754b6a7300000000000000000000000000000000000000000000000000000000815290519192506000916001600160a01b0384169163754b6a73916004808301926020929190829003018186803b158015610daf57600080fd5b505afa158015610dc3573d6000803e3d6000fd5b505050506040513d6020811015610dd957600080fd5b505160025490915081014211610e205760405162461bcd60e51b81526004018080602001828103825260258152602001806156d76025913960400191505060405180910390fd5b610e2a60026142c6565b6000610e6a6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b0316639907288c600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610ed057600080fd5b505af1158015610ee4573d6000803e3d6000fd5b505042600b55505060408051808201909152601181527f726f636b65744e6f64654465706f7369740000000000000000000000000000006020820152600090610f2c906140ce565b9050806001600160a01b031663643ff9fe600460019054906101000a90046001600160a01b03166013546040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610f9c57600080fd5b505af1158015610fb0573d6000803e3d6000fd5b50505050816001600160a01b03166344e51a036040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fef57600080fd5b505af1158015611003573d6000803e3d6000fd5b50506040805142815290517fa5c869f853c40dbf5557240b202402a69e253565e0eb171fa239d8e95b1b1c2e9350908190036020019150a15050505050565b60006110576110508361105f565b8390614264565b90505b919050565b6000676f05b59d3b20000082101561108c5761108560065461107f6135cf565b84614356565b905061105a565b611085826143b5565b6000806110b9604051806060016040528060218152602001615901602191396140ce565b905060006110d26017544261426490919063ffffffff16565b9050816001600160a01b03166354c01f72826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561111857600080fd5b505afa15801561112c573d6000803e3d6000fd5b505050506040513d602081101561114257600080fd5b5051925050505b90565b6002600f54600160a01b900460ff16600281111561116657fe5b146111b8576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60006009541161120f576040805162461bcd60e51b815260206004820152601360248201527f4e6f2062616c616e636520746f20736c61736800000000000000000000000000604482015290519081900360640190fd5b6112176144f3565b565b6002600f54600160a01b900460ff16600281111561123357fe5b14611285576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561129f57fe5b146112db5760405162461bcd60e51b81526004018080602001828103825260358152602001806159f16035913960400191505060405180910390fd5b60006112fe604051806060016040528060218152602001615901602191396140ce565b9050806001600160a01b031663d42916c26040518163ffffffff1660e01b815260040160206040518083038186803b15801561133957600080fd5b505afa15801561134d573d6000803e3d6000fd5b505050506040513d602081101561136357600080fd5b5051600254611373904290614264565b10156113b05760405162461bcd60e51b81526004018080602001828103825260388152602001806159436038913960400191505060405180910390fd5b6113b86145cd565b50565b6040518060400160405280601181526020017f726f636b65744e6f64654465706f736974000000000000000000000000000000815250336113fb826140ce565b6001600160a01b0316816001600160a01b031614611460576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561147a57fe5b146114cc576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff1660048111156114e557fe5b146115215760405162461bcd60e51b81526004018080602001828103825260328152602001806156436032913960400191505060405180910390fd5b60125415611576576040805162461bcd60e51b815260206004820152601d60248201527f5072652d6465706f73697420616c726561647920706572666f726d6564000000604482015290519081900360640190fd5b600688905534601281905560408051918252426020830152805133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f92908290030190a26115c88787878787614843565b5050505050505050565b60025490565b600454339061010090046001600160a01b0316811461163e576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561165857fe5b146116aa576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6004600054600160a01b900460ff1660048111156116c457fe5b146117005760405162461bcd60e51b815260040180806020018281038252602f815260200180615a26602f913960400191505060405180910390fd5b611708614d6b565b60006117486040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b031663606bb62e306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179757600080fd5b505afa1580156117ab573d6000803e3d6000fd5b505050506040513d60208110156117c157600080fd5b5051611814576040805162461bcd60e51b815260206004820152601760248201527f4d696e69706f6f6c20616c726561647920636c6f736564000000000000000000604482015290519081900360640190fd5b806001600160a01b0316637bb40aaf6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561184f57600080fd5b505af1158015611863573d6000803e3d6000fd5b50506000600681905560088190556013819055600a819055600b5550505050565b6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c000000000000000000000000000000815250336118c4826140ce565b6001600160a01b0316816001600160a01b031614611929576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561194357fe5b14611995576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff1660048111156119ae57fe5b101580156119d457506002600054600160a01b900460ff1660048111156119d157fe5b11155b611a0f5760405162461bcd60e51b81526004018080602001828103825260518152602001806158b06051913960600191505060405180910390fd5b600b5415611a4e5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a81602a913960400191505060405180910390fd5b60008054600160a01b900460ff166004811115611a6757fe5b1415611a7757611a7760016142c6565b3460135542600b5560016004805460ff1690811115611a9257fe5b1415611ab957600654611aa59034614264565b600655600854611ab59034614ee5565b6008555b60408051348152426020820152815133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f928290030190a25050565b60155490565b600054600160a01b900460ff1690565b6002600f54600160a01b900460ff166002811115611b2657fe5b14611b78576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6000805460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b158015611be857600080fd5b505afa158015611bfc573d6000803e3d6000fd5b505050506040513d6020811015611c1257600080fd5b505160045490915060009061010090046001600160a01b0316331480611c405750336001600160a01b038316145b90506004600054600160a01b900460ff166004811115611c5c57fe5b1415611cad5780611c9e5760405162461bcd60e51b815260040180806020018281038252602c815260200180615a55602c913960400191505060405180910390fd5b611ca6614d6b565b50506113b8565b6002600054600160a01b900460ff166004811115611cc757fe5b14611d19576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b6000611d306008544761426490919063ffffffff16565b9050676f05b59d3b2000008110611e24578315611d94576040805162461bcd60e51b815260206004820152601760248201527f42616c616e636520657863656564732038206574686572000000000000000000604482015290519081900360640190fd5b611d9d81614f46565b8115611db057611dab615035565b611e1f565b611db8611095565b611df35760405162461bcd60e51b815260040180806020018281038252602381526020018061584a6023913960400191505060405180910390fd5b601680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b611e48565b611e2c6152d7565b818015611e3b57506000600854115b15611e4857611e48615354565b505060006017555050565b600381565b600454339061010090046001600160a01b0316811480611f1d575060005460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d6020811015611f0c57600080fd5b50516001600160a01b038281169116145b611f6e576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115611f8857fe5b14611fda576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60006008541161201b5760405162461bcd60e51b81526004018080602001828103825260358152602001806157416035913960400191505060405180910390fd5b600f547501000000000000000000000000000000000000000000900460ff16158015612049575060165460ff165b1561205b57612056615035565b6113b8565b6113b8615354565b60045460ff1690565b60115490565b600b54151590565b60045461010090046001600160a01b031690565b60065490565b60165460ff1690565b6001600f54600160a01b900460ff1660028111156120b757fe5b146120f35760405162461bcd60e51b81526004018080602001828103825260218152602001806155cb6021913960400191505060405180910390fd5b6001600160a01b03811661214e576040805162461bcd60e51b815260206004820152601460248201527f496e76616c6964206e6f64652061646472657373000000000000000000000000604482015290519081900360640190fd5b600061218e6040518060400160405280601181526020017f726f636b65744e6574776f726b466565730000000000000000000000000000008152506140ce565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690554360015542600255600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681177fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b0386811691909102919091178255604080517fe715013400000000000000000000000000000000000000000000000000000000815290519394509084169263e715013492828101926020929190829003018186803b15801561227357600080fd5b505afa158015612287573d6000803e3d6000fd5b505050506040513d602081101561229d57600080fd5b505160055560408051808201909152600f81527f726f636b6574546f6b656e52455448000000000000000000000000000000000060208201526122df906140ce565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905560408051808201909152601581527f726f636b65744d696e69706f6f6c50656e616c747900000000000000000000006020820152612354906140ce565b600f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740200000000000000000000000000000000000000001790555050565b60006002600f54600160a01b900460ff1660028111156123e557fe5b14612437576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561245157fe5b1461245e57506000611149565b60006124816040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663f0245dc86040518163ffffffff1660e01b815260040160206040518083038186803b1580156124be57600080fd5b505afa1580156124d2573d6000803e3d6000fd5b505050506040513d60208110156124e857600080fd5b50516002540142119250505090565b600f547501000000000000000000000000000000000000000000900460ff1690565b600b5490565b600454339061010090046001600160a01b03168114806125e4575060005460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b1580156125a957600080fd5b505afa1580156125bd573d6000803e3d6000fd5b505050506040513d60208110156125d357600080fd5b50516001600160a01b038281169116145b612635576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561264f57fe5b146126a1576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60165460ff166126e25760405162461bcd60e51b81526004018080602001828103825260328152602001806156a56032913960400191505060405180910390fd5b6113b8615035565b60145460ff1690565b60006002600f54600160a01b900460ff16600281111561270f57fe5b14612761576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561277b57fe5b1461278857506000611149565b60006127ab6040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663754b6a736040518163ffffffff1660e01b815260040160206040518083038186803b1580156124be57600080fd5b6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c00000000000000000000000000000081525033612828826140ce565b6001600160a01b0316816001600160a01b03161461288d576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff1660028111156128a757fe5b146128f9576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff16600481111561291257fe5b1461294e5760405162461bcd60e51b81526004018080602001828103825260378152602001806157766037913960400191505060405180910390fd5b600b541561298d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a81602a913960400191505060405180910390fd5b61299760016142c6565b6129b86006546129b260125434614ee590919063ffffffff16565b90614264565b60135542600b819055604080513481526020810192909252805133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f92908290030190a25050565b600454339061010090046001600160a01b03168114612a67576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115612a8157fe5b14612ad3576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6002600054600160a01b900460ff166004811115612aed57fe5b14612b3f576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b6000612b566008544761426490919063ffffffff16565b9050676f05b59d3b2000008110612b9e5760405162461bcd60e51b81526004018080602001828103825260328152602001806159bf6032913960400191505060405180910390fd5b612ba66152d7565b6000612be66040518060400160405280601981526020017f726f636b65744d696e69706f6f6c426f6e6452656475636572000000000000008152506140ce565b9050600060065490506000826001600160a01b031663d191ea9c6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612c2c57600080fd5b505af1158015612c40573d6000803e3d6000fd5b505050506040513d6020811015612c5657600080fd5b50519050612c75612c678383614264565b612c6f6135cf565b90614ee5565b601355600681905560408051808201909152601181527f726f636b65744e6574776f726b466565730000000000000000000000000000006020820152600090612cbd906140ce565b9050600060055490506000826001600160a01b031663e71501346040518163ffffffff1660e01b815260040160206040518083038186803b158015612d0157600080fd5b505afa158015612d15573d6000803e3d6000fd5b505050506040513d6020811015612d2b57600080fd5b5051600581905560408051808201909152601581527f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000006020820152909150600090612d75906140ce565b9050806001600160a01b0316630fcc8178878786866040518563ffffffff1660e01b815260040180858152602001848152602001838152602001828152602001945050505050600060405180830381600087803b158015612dd557600080fd5b505af1158015612de9573d6000803e3d6000fd5b5060049250612df6915050565b6004805460ff1690811115612e0757fe5b14612e5b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a55600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790555b6040805187815260208101879052428183015290517f90e131460b9acb17565f1719b9ebc49998aec6b07a4743a09b1b700545769eb69181900360600190a1505050505050505050565b6000612ebe60125460065461426490919063ffffffff16565b905090565b6001600160a01b031660009081526010602052604090205460ff1690565b60125490565b6002600f54600160a01b900460ff166002811115612f0157fe5b14612f53576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff166004811115612f6d57fe5b14612fa95760405162461bcd60e51b815260040180806020018281038252603481526020018061560f6034913960400191505060405180910390fd5b6000612fe96040518060400160405280601481526020017f726f636b657444414f4e6f6465547275737465640000000000000000000000008152506140ce565b9050600061300e6040518060600160405280602481526020016155a7602491396140ce565b9050816001600160a01b0316635dc33bdd336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561305d57600080fd5b505afa158015613071573d6000803e3d6000fd5b505050506040513d602081101561308757600080fd5b50516130da576040805162461bcd60e51b815260206004820152601460248201527f4e6f7420612074727573746564206d656d626572000000000000000000000000604482015290519081900360640190fd5b3360009081526010602052604090205460ff16156131295760405162461bcd60e51b815260040180806020018281038252602181526020018061599e6021913960400191505060405180910390fd5b3360008181526010602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815142815291517fc038496c9b2fce7ae180c60886062197d0411e3c5d249053f188423280778a839281900390910190a2600061329d670de0b6b3a7640000613297846001600160a01b0316636e86e7fe6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131e057600080fd5b505afa1580156131f4573d6000803e3d6000fd5b505050506040513d602081101561320a57600080fd5b5051604080517f997072f700000000000000000000000000000000000000000000000000000000815290516001600160a01b0389169163997072f7916004808301926020929190829003018186803b15801561326557600080fd5b505afa158015613279573d6000803e3d6000fd5b505050506040513d602081101561328f57600080fd5b5051906154e6565b9061553f565b9050806132b66001601154614ee590919063ffffffff16565b11156135ac5760145460ff161580156133305750816001600160a01b031663c4f502526040518163ffffffff1660e01b815260040160206040518083038186803b15801561330357600080fd5b505afa158015613317573d6000803e3d6000fd5b505050506040513d602081101561332d57600080fd5b50515b1561356c5760006133756040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152506140ce565b905060006133b76040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f64650000008152506140ce565b905060006133dc604051806060016040528060218152602001615901602191396140ce565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b15801561341957600080fd5b505afa15801561342d573d6000803e3d6000fd5b505050506040513d602081101561344357600080fd5b505160048054604080517f6fdbe57b00000000000000000000000000000000000000000000000000000000815290519394506001600160a01b038089169463245395a69461010090940482169361350993670de0b6b3a76400009361329793908c1692636fdbe57b92808201926020929091829003018186803b1580156134c957600080fd5b505afa1580156134dd573d6000803e3d6000fd5b505050506040513d60208110156134f357600080fd5b5051600654613503908990614264565b906154e6565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561354f57600080fd5b505af1158015613563573d6000803e3d6000fd5b50505050505050505b6135746145cd565b6040805142815290517fac58888447082d81defc760f4bd30b6196d9309777e161bce72c280a12a6ea689181900360200190a16135be565b6011546135ba906001614ee5565b6011555b505050565b60015490565b60055490565b6000600480805460ff16908111156135e357fe5b14156135f25750601354611149565b50600a54611149565b6002600f54600160a01b900460ff16600281111561361557fe5b14613667576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6002600054600160a01b900460ff16600481111561368157fe5b146136d3576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b60006136ea6008544761426490919063ffffffff16565b9050676f05b59d3b200000811015613749576040805162461bcd60e51b815260206004820152600f60248201527f42616c616e636520746f6f206c6f770000000000000000000000000000000000604482015290519081900360640190fd5b600061376c604051806060016040528060218152602001615901602191396140ce565b905060006137856017544261426490919063ffffffff16565b9050816001600160a01b0316637cb45bf7826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156137cb57600080fd5b505afa1580156137df573d6000803e3d6000fd5b505050506040513d60208110156137f557600080fd5b50516138325760405162461bcd60e51b81526004018080602001828103825260218152602001806156fc6021913960400191505060405180910390fd5b50504260175550565b600454339061010090046001600160a01b031681146138a1576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff1660028111156138bb57fe5b1461390d576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6000613930604051806060016040528060218152602001615901602191396140ce565b905060006139556040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663f0245dc86040518163ffffffff1660e01b815260040160206040518083038186803b15801561399257600080fd5b505afa1580156139a6573d6000803e3d6000fd5b505050506040513d60208110156139bc57600080fd5b505190506001600054600160a01b900460ff1660048111156139da57fe5b14613a165760405162461bcd60e51b81526004018080602001828103825260368152602001806157ad6036913960400191505060405180910390fd5b80600254014211613a585760405162461bcd60e51b81526004018080602001828103825260238152602001806155ec6023913960400191505060405180910390fd5b60145460ff1615613ab0576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f74207374616b65206120766163616e74206d696e69706f6f6c0000604482015290519081900360640190fd5b5050613abc60026142c6565b6000613afc6040518060400160405280600d81526020017f6361737065724465706f736974000000000000000000000000000000000000008152506140ce565b90506000613b3e6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b90506000836001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015613b7b57600080fd5b505afa158015613b8f573d6000803e3d6000fd5b505050506040513d6020811015613ba557600080fd5b505190506000600480805460ff1690811115613bbd57fe5b1415613bd857601254613bd1908390614264565b9050613bed565b613bea8267de0b6b3a76400000614264565b90505b80471015613c2c5760405162461bcd60e51b81526004018080602001828103825260258152602001806158256025913960400191505060405180910390fd5b6000836001600160a01b0316633eb535e9306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b158015613c7b57600080fd5b505afa158015613c8f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015613cd657600080fd5b8101908080516040519392919084640100000000821115613cf657600080fd5b908301906020820185811115613d0b57600080fd5b8251640100000000811182820188101715613d2557600080fd5b82525081516020918201929091019080838360005b83811015613d52578181015183820152602001613d3a565b50505050905090810190601f168015613d7f5780820380516001836020036101000a031916815260200191505b506040525050509050846001600160a01b031663228951188383876001600160a01b0316632cb76c37306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b158015613de657600080fd5b505afa158015613dfa573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015613e4157600080fd5b8101908080516040519392919084640100000000821115613e6157600080fd5b908301906020820185811115613e7657600080fd5b8251640100000000811182820188101715613e9057600080fd5b82525081516020918201929091019080838360005b83811015613ebd578181015183820152602001613ea5565b50505050905090810190601f168015613eea5780820380516001836020036101000a031916815260200191505b506040525050508e8e8e6040518763ffffffff1660e01b815260040180806020018060200180602001858152602001848103845289818151815260200191508051906020019080838360005b83811015613f4e578181015183820152602001613f36565b50505050905090810190601f168015613f7b5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b83811015613fae578181015183820152602001613f96565b50505050905090810190601f168015613fdb5780820380516001836020036101000a031916815260200191505b508481038252868152602001878780828437600081840152601f19601f820116905080830192505050985050505050505050506000604051808303818588803b15801561402757600080fd5b505af115801561403b573d6000803e3d6000fd5b5050505050836001600160a01b0316639907288c600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156140a457600080fd5b505af11580156140b8573d6000803e3d6000fd5b5050505050505050505050505050565b60085490565b60008060008054906101000a90046001600160a01b03166001600160a01b03166321f8a7218460405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083835b6020831061416c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161412f565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156141db57600080fd5b505afa1580156141ef573d6000803e3d6000fd5b505050506040513d602081101561420557600080fd5b505190506001600160a01b038116611057576040805162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e640000000000000000000000000000604482015290519081900360640190fd5b6000828211156142bb576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600080548291907fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b83600481111561430057fe5b0217905550436001554260025580600481111561431957fe5b60ff167f26725881c2a4290b02cd153d6599fd484f0d4e6062c361e740fbbe39e7ad6142426040518082815260200191505060405180910390a250565b6000806143706143668587614ee5565b61329785886154e6565b9050600061437e8483614264565b90506143ab6143a4670de0b6b3a7640000613297600554856154e690919063ffffffff16565b8390614ee5565b9695505050505050565b6000806143c06135cf565b6006549091506000806143d38484614ee5565b9050808611156144085760006143e98783614264565b90506144006143f9858784614356565b8590614ee5565b92505061441d565b8386111561441d5761441a8685614264565b91505b600f54604080517fa1e8487d00000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163a1e8487d916024808301926020929190829003018186803b15801561448157600080fd5b505afa158015614495573d6000803e3d6000fd5b505050506040513d60208110156144ab57600080fd5b5051905080156144e85760006144cd670de0b6b3a764000061329786856154e6565b9050838111156144da5750825b6144e48482614264565b9350505b509095945050505050565b60006145336040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152506140ce565b6009805460009182905560048054604080517f245395a60000000000000000000000000000000000000000000000000000000081526001600160a01b03610100909304831693810193909352602483018490525194955091939185169263245395a69260448084019382900301818387803b1580156145b157600080fd5b505af11580156145c5573d6000803e3d6000fd5b505050505050565b600061460d6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c0000000000000000000000000000008152506140ce565b9050600061464f6040518060400160405280601381526020017f726f636b65744d696e69706f6f6c5175657565000000000000000000000000008152506140ce565b905061465b60046142c6565b60145460ff16156147015760006146a66040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b03166344e51a036040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156146e357600080fd5b505af11580156146f7573d6000803e3d6000fd5b505050505061483f565b60016004805460ff169081111561471457fe5b1415614798576040517fde1bdc8f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063de1bdc8f9060019060040180828152602001915050600060405180830381600087803b15801561477b57600080fd5b505af115801561478f573d6000803e3d6000fd5b5050505061483f565b60006147a26135cf565b9050826001600160a01b03166372f5158d826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156147df57600080fd5b505af11580156147f3573d6000803e3d6000fd5b50506040805185815242602082015281516001600160a01b03891695507fd5ca65e1ec4f4864fea7b9c5cb1ec3087a0dbf9c74641db3f6458edf445c40519450908190039091019150a2505b5050565b60006148836040518060400160405280600d81526020017f6361737065724465706f736974000000000000000000000000000000000000008152506140ce565b905060006148c56040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b6040517f2c7f64d4000000000000000000000000000000000000000000000000000000008152602060048201908152602482018990529192506001600160a01b03831691632c7f64d4918a918a918190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561495457600080fd5b505af1158015614968573d6000803e3d6000fd5b505050506000816001600160a01b0316632cb76c37306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b1580156149bb57600080fd5b505afa1580156149cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015614a1657600080fd5b8101908080516040519392919084640100000000821115614a3657600080fd5b908301906020820185811115614a4b57600080fd5b8251640100000000811182820188101715614a6557600080fd5b82525081516020918201929091019080838360005b83811015614a92578181015183820152602001614a7a565b50505050905090810190601f168015614abf5780820380516001836020036101000a031916815260200191505b506040525050509050826001600160a01b031663228951186012548a8a858b8b8b6040518863ffffffff1660e01b81526004018080602001806020018060200185815260200184810384528a8a828181526020019250808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920186810385528a5181528a51602091820193918c019250908190849084905b83811015614b81578181015183820152602001614b69565b50505050905090810190601f168015614bae5780820380516001836020036101000a031916815260200191505b508481038252868152602001878780828437600081840152601f19601f82011690508083019250505099505050505050505050506000604051808303818588803b158015614bfb57600080fd5b505af1158015614c0f573d6000803e3d6000fd5b50505050507f889f738426ec48d04c92bdcce1bc71c7aab6ba5296a4e92cc28a58c680b0a4ae888888888860125487426040518080602001806020018781526020018681526020018060200185815260200184810384528c8c82818152602001925080828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910185810384528a815260200190508a8a808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018681038452885181528851602091820193918a019250908190849084905b83811015614d1e578181015183820152602001614d06565b50505050905090810190601f168015614d4b5780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a15050505050505050565b6000805460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b03610100909304831693810193909352514794939190911691635b49ff62916024808301926020929190829003018186803b158015614ddf57600080fd5b505afa158015614df3573d6000803e3d6000fd5b505050506040513d6020811015614e0957600080fd5b50516040519091506000906001600160a01b0383169084908381818185875af1925050503d8060008114614e59576040519150601f19603f3d011682016040523d82523d6000602084013e614e5e565b606091505b5050905080614e9e5760405162461bcd60e51b81526004018080602001828103825260428152602001806157e36042913960600191505060405180910390fd5b6040805184815242602082015281516001600160a01b038516927fd5ca65e1ec4f4864fea7b9c5cb1ec3087a0dbf9c74641db3f6458edf445c4051928290030190a2505050565b600082820183811015614f3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600080614f516135cf565b905080831015614f7557600354614f7057614f6c8184614264565b6009555b614f81565b614f7e836143b5565b91505b6000614f8d8484614264565b600854909150614f9d9084614ee5565b6008558015614fe257600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015614fe0573d6000803e3d6000fd5b505b436003556040805184815260208101839052808201869052426060820152905133917f3422b68c7062367a3ae581f8bf64158ddb63f02294a0abe7f32491787076f1b7919081900360800190a250505050565b60006150756040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b600f549091507501000000000000000000000000000000000000000000900460ff16156150d35760405162461bcd60e51b815260040180806020018281038252602381526020018061597b6023913960400191505060405180910390fd5b600f80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000017905560095415615123576151236144f3565b6008541561513357615133615354565b471561517457600e546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015615172573d6000803e3d6000fd5b505b600e60009054906101000a90046001600160a01b03166001600160a01b031663188e0dc66040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156151c457600080fd5b505af11580156151d8573d6000803e3d6000fd5b50505050806001600160a01b031663b04e8868600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561524057600080fd5b505af1158015615254573d6000803e3d6000fd5b50505050806001600160a01b03166375b59c7f600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156152bc57600080fd5b505af11580156152d0573d6000803e3d6000fd5b5050505050565b60006152ee6008544761426490919063ffffffff16565b9050600061530060065461107f6135cf565b6008549091506153109082614ee5565b600855600e546001600160a01b03166108fc61532c8484614264565b6040518115909202916000818181858888f193505050501580156135be573d6000803e3d6000fd5b60145460ff16156153ac576040805162461bcd60e51b815260206004820152601d60248201527f566163616e74206d696e69706f6f6c2063616e6e6f7420726566756e64000000604482015290519081900360640190fd5b60088054600091829055815460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251939493921691635b49ff6291602480820192602092909190829003018186803b15801561542757600080fd5b505afa15801561543b573d6000803e3d6000fd5b505050506040513d602081101561545157600080fd5b50516040519091506000906001600160a01b0383169084908381818185875af1925050503d80600081146154a1576040519150601f19603f3d011682016040523d82523d6000602084013e6154a6565b606091505b5050905080614e9e5760405162461bcd60e51b815260040180806020018281038252604381526020018061586d6043913960600191505060405180910390fd5b6000826154f5575060006142c0565b8282028284828161550257fe5b0414614f3f5760405162461bcd60e51b81526004018080602001828103825260218152602001806159226021913960400191505060405180910390fd5b6000808211615595576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161559e57fe5b04939250505056fe726f636b657444414f4e6f64655472757374656453657474696e67734d696e69706f6f6c53746f7261676520737461746520616c726561647920696e697469616c697365644e6f7420656e6f7567682074696d65206861732070617373656420746f207374616b65546865206d696e69706f6f6c2063616e206f6e6c79206265207363727562626564207768696c6520696e207072656c61756e6368546865207072652d6465706f7369742063616e206f6e6c79206265206d616465207768696c6520696e697469616c69736564546865206d696e69706f6f6c2063616e206f6e6c792070726f6d6f7465207768696c6520696e207072656c61756e636843616e206f6e6c79206d616e75616c6c792066696e616c697365206166746572207573657220646973747269627574696f6e4e6f7420656e6f7567682074696d65206861732070617373656420746f2070726f6d6f74655573657220646973747269627574696f6e20616c72656164792070656e64696e6743616e6e6f742070726f6d6f74652061206e6f6e2d766163616e74206d696e69706f6f6c4e6f20616d6f756e74206f6620746865206e6f6465206465706f73697420697320617661696c61626c6520666f7220726566756e64546865206e6f6465206465706f7369742063616e206f6e6c792062652061737369676e6564207768696c6520696e697469616c69736564546865206d696e69706f6f6c2063616e206f6e6c7920626567696e207374616b696e67207768696c6520696e207072656c61756e63684e6f6465204554482062616c616e636520776173206e6f74207375636365737366756c6c79207472616e7366657272656420746f206e6f6465206f70657261746f72496e73756666696369656e742062616c616e636520746f20626567696e207374616b696e674f6e6c79206f776e65722063616e2064697374726962757465207269676874206e6f7745544820726566756e6420616d6f756e7420776173206e6f74207375636365737366756c6c79207472616e7366657272656420746f206e6f6465206f70657261746f725468652075736572206465706f7369742063616e206f6e6c792062652061737369676e6564207768696c6520696e697469616c697365642c20696e207072656c61756e63682c206f72207374616b696e67726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546865206d696e69706f6f6c2063616e206f6e6c7920626520646973736f6c766564206f6e6365206974206861732074696d6564206f75744d696e69706f6f6c2068617320616c7265616479206265656e2066696e616c697365644d656d6265722068617320616c726561647920766f74656420746f20736372756243616e6e6f742072656475636520626f6e6420776974682062616c616e6365206f662038206574686572206f72206d6f7265546865206d696e69706f6f6c2063616e206f6e6c7920626520646973736f6c766564207768696c6520696e207072656c61756e6368546865206d696e69706f6f6c2063616e206f6e6c7920626520636c6f736564207768696c6520646973736f6c7665644f6e6c79206f776e65722063616e206469737472696275746520646973736f6c766564206d696e69706f6f6c5468652075736572206465706f7369742068617320616c7265616479206265656e2061737369676e6564a26469706673582212200505fe7e60c1563d1e9e58e526d36a66843ba60fcf42f043946b22c902f2972764736f6c63430007060033

Deployed Bytecode

0x6080604052600436106102d15760003560e01c80637bfaef7d11610179578063d2ceebd1116100d6578063e67cd5b01161008a578063f09fa33211610064578063f09fa332146107a1578063f7ae36d1146107b6578063fbc02c4214610833576102d1565b8063e67cd5b014610762578063e715013414610777578063e7e04aba1461078c576102d1565b8063d6047def116100bb578063d6047def14610738578063d91eda62146105b2578063e117d1921461074d576102d1565b8063d2ceebd1146106f0578063d45dc62814610705576102d1565b8063a43992631161012d578063c9c36b2711610112578063c9c36b27146106be578063d0e30db0146106d3578063d191ea9c146106db576102d1565b8063a439926314610694578063bbe38fe1146106a9576102d1565b80639ed278091161015e5780639ed2780914610655578063a129a5ee1461066a578063a2940a901461067f576102d1565b80637bfaef7d1461060d5780639d6a890f14610622576102d1565b80634814611311610232578063590e1ae3116101e657806369c089ea116101c057806369c089ea146105b257806370dabc9e146105c757806374ca6bf2146105f8576102d1565b8063590e1ae3146105735780635abd37e41461058857806368f449b21461059d576102d1565b80634e69d560116102175780634e69d560146104e657806354efc6e51461051c57806354fd4d5014610548576102d1565b806348146113146104c957806349b42321146104d1576102d1565b80632da25de3116102895780633ca742e91161026e5780633ca742e9146103d65780633e0a56b01461049f57806343d726d6146104b4576102d1565b80632da25de3146103ac5780633bef8a3a146103c1576102d1565b806319f18b1f116102ba57806319f18b1f1461031d5780631a69d18f1461035957806323e4e3e414610383576102d1565b80630871ffef146102d657806313dc01dc14610308575b600080fd5b3480156102e257600080fd5b50610306600480360360408110156102f957600080fd5b5080359060200135610848565b005b34801561031457600080fd5b50610306610b9c565b34801561032957600080fd5b506103476004803603602081101561034057600080fd5b5035611042565b60408051918252519081900360200190f35b34801561036557600080fd5b506103476004803603602081101561037c57600080fd5b503561105f565b34801561038f57600080fd5b50610398611095565b604080519115158252519081900360200190f35b3480156103b857600080fd5b5061030661114c565b3480156103cd57600080fd5b50610306611219565b610306600480360360808110156103ec57600080fd5b8135919081019060408101602082013564010000000081111561040e57600080fd5b82018360208201111561042057600080fd5b8035906020019184600183028401116401000000008311171561044257600080fd5b91939092909160208101903564010000000081111561046057600080fd5b82018360208201111561047257600080fd5b8035906020019184600183028401116401000000008311171561049457600080fd5b9193509150356113bb565b3480156104ab57600080fd5b506103476115d2565b3480156104c057600080fd5b506103066115d8565b610306611884565b3480156104dd57600080fd5b50610347611af6565b3480156104f257600080fd5b506104fb611afc565b6040518082600481111561050b57fe5b815260200191505060405180910390f35b34801561052857600080fd5b506103066004803603602081101561053f57600080fd5b50351515611b0c565b34801561055457600080fd5b5061055d611e53565b6040805160ff9092168252519081900360200190f35b34801561057f57600080fd5b50610306611e58565b34801561059457600080fd5b506104fb612063565b3480156105a957600080fd5b5061034761206c565b3480156105be57600080fd5b50610398612072565b3480156105d357600080fd5b506105dc61207a565b604080516001600160a01b039092168252519081900360200190f35b34801561060457600080fd5b5061034761208e565b34801561061957600080fd5b50610398612094565b34801561062e57600080fd5b506103066004803603602081101561064557600080fd5b50356001600160a01b031661209d565b34801561066157600080fd5b506103986123c9565b34801561067657600080fd5b506103986124f7565b34801561068b57600080fd5b50610347612519565b3480156106a057600080fd5b5061030661251f565b3480156106b557600080fd5b506103986126ea565b3480156106ca57600080fd5b506103986126f3565b6103066127e8565b3480156106e757600080fd5b50610306612a01565b3480156106fc57600080fd5b50610347612ea5565b34801561071157600080fd5b506103986004803603602081101561072857600080fd5b50356001600160a01b0316612ec3565b34801561074457600080fd5b50610347612ee1565b34801561075957600080fd5b50610306612ee7565b34801561076e57600080fd5b506103476135c3565b34801561078357600080fd5b506103476135c9565b34801561079857600080fd5b506103476135cf565b3480156107ad57600080fd5b506103066135fb565b3480156107c257600080fd5b50610306600480360360408110156107d957600080fd5b8101906020810181356401000000008111156107f457600080fd5b82018360208201111561080657600080fd5b8035906020019184600183028401116401000000008311171561082857600080fd5b91935091503561383b565b34801561083f57600080fd5b506103476140c8565b6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525033610888826140ce565b6001600160a01b0316816001600160a01b0316146108ed576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561090757fe5b14610959576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff16600481111561097257fe5b146109c4576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e20696e697469616c6973656420737461747573000000604482015290519081900360640190fd5b60085415610a19576040805162461bcd60e51b815260206004820152601760248201527f526566756e642062616c616e6365206e6f74207a65726f000000000000000000604482015290519081900360640190fd5b6000610a3c604051806060016040528060218152602001615901602191396140ce565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7957600080fd5b505afa158015610a8d573d6000803e3d6000fd5b505050506040513d6020811015610aa357600080fd5b5051905080851015610afc576040805162461bcd60e51b815260206004820152601260248201527f42616c616e636520697320746f6f206c6f770000000000000000000000000000604482015290519081900360640190fd5b6006869055610b0b8187614264565b601355601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556015859055610b488582614264565b600855610b5560016142c6565b6040805187815260208101879052428183015290517ff7cb92de8d4b074aafcfa9bdb83842b1ef40f49087a9eb04996d68a012de105c9181900360600190a1505050505050565b600454339061010090046001600160a01b03168114610c02576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115610c1c57fe5b14610c6e576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff166004811115610c8857fe5b14610cc45760405162461bcd60e51b81526004018080602001828103825260308152602001806156756030913960400191505060405180910390fd5b60145460ff16610d055760405162461bcd60e51b815260040180806020018281038252602481526020018061571d6024913960400191505060405180910390fd5b6000610d286040518060600160405280602481526020016155a7602491396140ce565b601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055604080517f754b6a7300000000000000000000000000000000000000000000000000000000815290519192506000916001600160a01b0384169163754b6a73916004808301926020929190829003018186803b158015610daf57600080fd5b505afa158015610dc3573d6000803e3d6000fd5b505050506040513d6020811015610dd957600080fd5b505160025490915081014211610e205760405162461bcd60e51b81526004018080602001828103825260258152602001806156d76025913960400191505060405180910390fd5b610e2a60026142c6565b6000610e6a6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b0316639907288c600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610ed057600080fd5b505af1158015610ee4573d6000803e3d6000fd5b505042600b55505060408051808201909152601181527f726f636b65744e6f64654465706f7369740000000000000000000000000000006020820152600090610f2c906140ce565b9050806001600160a01b031663643ff9fe600460019054906101000a90046001600160a01b03166013546040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610f9c57600080fd5b505af1158015610fb0573d6000803e3d6000fd5b50505050816001600160a01b03166344e51a036040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fef57600080fd5b505af1158015611003573d6000803e3d6000fd5b50506040805142815290517fa5c869f853c40dbf5557240b202402a69e253565e0eb171fa239d8e95b1b1c2e9350908190036020019150a15050505050565b60006110576110508361105f565b8390614264565b90505b919050565b6000676f05b59d3b20000082101561108c5761108560065461107f6135cf565b84614356565b905061105a565b611085826143b5565b6000806110b9604051806060016040528060218152602001615901602191396140ce565b905060006110d26017544261426490919063ffffffff16565b9050816001600160a01b03166354c01f72826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561111857600080fd5b505afa15801561112c573d6000803e3d6000fd5b505050506040513d602081101561114257600080fd5b5051925050505b90565b6002600f54600160a01b900460ff16600281111561116657fe5b146111b8576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60006009541161120f576040805162461bcd60e51b815260206004820152601360248201527f4e6f2062616c616e636520746f20736c61736800000000000000000000000000604482015290519081900360640190fd5b6112176144f3565b565b6002600f54600160a01b900460ff16600281111561123357fe5b14611285576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561129f57fe5b146112db5760405162461bcd60e51b81526004018080602001828103825260358152602001806159f16035913960400191505060405180910390fd5b60006112fe604051806060016040528060218152602001615901602191396140ce565b9050806001600160a01b031663d42916c26040518163ffffffff1660e01b815260040160206040518083038186803b15801561133957600080fd5b505afa15801561134d573d6000803e3d6000fd5b505050506040513d602081101561136357600080fd5b5051600254611373904290614264565b10156113b05760405162461bcd60e51b81526004018080602001828103825260388152602001806159436038913960400191505060405180910390fd5b6113b86145cd565b50565b6040518060400160405280601181526020017f726f636b65744e6f64654465706f736974000000000000000000000000000000815250336113fb826140ce565b6001600160a01b0316816001600160a01b031614611460576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561147a57fe5b146114cc576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff1660048111156114e557fe5b146115215760405162461bcd60e51b81526004018080602001828103825260328152602001806156436032913960400191505060405180910390fd5b60125415611576576040805162461bcd60e51b815260206004820152601d60248201527f5072652d6465706f73697420616c726561647920706572666f726d6564000000604482015290519081900360640190fd5b600688905534601281905560408051918252426020830152805133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f92908290030190a26115c88787878787614843565b5050505050505050565b60025490565b600454339061010090046001600160a01b0316811461163e576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561165857fe5b146116aa576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6004600054600160a01b900460ff1660048111156116c457fe5b146117005760405162461bcd60e51b815260040180806020018281038252602f815260200180615a26602f913960400191505060405180910390fd5b611708614d6b565b60006117486040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b031663606bb62e306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179757600080fd5b505afa1580156117ab573d6000803e3d6000fd5b505050506040513d60208110156117c157600080fd5b5051611814576040805162461bcd60e51b815260206004820152601760248201527f4d696e69706f6f6c20616c726561647920636c6f736564000000000000000000604482015290519081900360640190fd5b806001600160a01b0316637bb40aaf6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561184f57600080fd5b505af1158015611863573d6000803e3d6000fd5b50506000600681905560088190556013819055600a819055600b5550505050565b6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c000000000000000000000000000000815250336118c4826140ce565b6001600160a01b0316816001600160a01b031614611929576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561194357fe5b14611995576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff1660048111156119ae57fe5b101580156119d457506002600054600160a01b900460ff1660048111156119d157fe5b11155b611a0f5760405162461bcd60e51b81526004018080602001828103825260518152602001806158b06051913960600191505060405180910390fd5b600b5415611a4e5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a81602a913960400191505060405180910390fd5b60008054600160a01b900460ff166004811115611a6757fe5b1415611a7757611a7760016142c6565b3460135542600b5560016004805460ff1690811115611a9257fe5b1415611ab957600654611aa59034614264565b600655600854611ab59034614ee5565b6008555b60408051348152426020820152815133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f928290030190a25050565b60155490565b600054600160a01b900460ff1690565b6002600f54600160a01b900460ff166002811115611b2657fe5b14611b78576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6000805460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b158015611be857600080fd5b505afa158015611bfc573d6000803e3d6000fd5b505050506040513d6020811015611c1257600080fd5b505160045490915060009061010090046001600160a01b0316331480611c405750336001600160a01b038316145b90506004600054600160a01b900460ff166004811115611c5c57fe5b1415611cad5780611c9e5760405162461bcd60e51b815260040180806020018281038252602c815260200180615a55602c913960400191505060405180910390fd5b611ca6614d6b565b50506113b8565b6002600054600160a01b900460ff166004811115611cc757fe5b14611d19576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b6000611d306008544761426490919063ffffffff16565b9050676f05b59d3b2000008110611e24578315611d94576040805162461bcd60e51b815260206004820152601760248201527f42616c616e636520657863656564732038206574686572000000000000000000604482015290519081900360640190fd5b611d9d81614f46565b8115611db057611dab615035565b611e1f565b611db8611095565b611df35760405162461bcd60e51b815260040180806020018281038252602381526020018061584a6023913960400191505060405180910390fd5b601680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b611e48565b611e2c6152d7565b818015611e3b57506000600854115b15611e4857611e48615354565b505060006017555050565b600381565b600454339061010090046001600160a01b0316811480611f1d575060005460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d6020811015611f0c57600080fd5b50516001600160a01b038281169116145b611f6e576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115611f8857fe5b14611fda576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60006008541161201b5760405162461bcd60e51b81526004018080602001828103825260358152602001806157416035913960400191505060405180910390fd5b600f547501000000000000000000000000000000000000000000900460ff16158015612049575060165460ff165b1561205b57612056615035565b6113b8565b6113b8615354565b60045460ff1690565b60115490565b600b54151590565b60045461010090046001600160a01b031690565b60065490565b60165460ff1690565b6001600f54600160a01b900460ff1660028111156120b757fe5b146120f35760405162461bcd60e51b81526004018080602001828103825260218152602001806155cb6021913960400191505060405180910390fd5b6001600160a01b03811661214e576040805162461bcd60e51b815260206004820152601460248201527f496e76616c6964206e6f64652061646472657373000000000000000000000000604482015290519081900360640190fd5b600061218e6040518060400160405280601181526020017f726f636b65744e6574776f726b466565730000000000000000000000000000008152506140ce565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690554360015542600255600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681177fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b0386811691909102919091178255604080517fe715013400000000000000000000000000000000000000000000000000000000815290519394509084169263e715013492828101926020929190829003018186803b15801561227357600080fd5b505afa158015612287573d6000803e3d6000fd5b505050506040513d602081101561229d57600080fd5b505160055560408051808201909152600f81527f726f636b6574546f6b656e52455448000000000000000000000000000000000060208201526122df906140ce565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905560408051808201909152601581527f726f636b65744d696e69706f6f6c50656e616c747900000000000000000000006020820152612354906140ce565b600f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740200000000000000000000000000000000000000001790555050565b60006002600f54600160a01b900460ff1660028111156123e557fe5b14612437576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561245157fe5b1461245e57506000611149565b60006124816040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663f0245dc86040518163ffffffff1660e01b815260040160206040518083038186803b1580156124be57600080fd5b505afa1580156124d2573d6000803e3d6000fd5b505050506040513d60208110156124e857600080fd5b50516002540142119250505090565b600f547501000000000000000000000000000000000000000000900460ff1690565b600b5490565b600454339061010090046001600160a01b03168114806125e4575060005460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251921691635b49ff6291602480820192602092909190829003018186803b1580156125a957600080fd5b505afa1580156125bd573d6000803e3d6000fd5b505050506040513d60208110156125d357600080fd5b50516001600160a01b038281169116145b612635576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff16600281111561264f57fe5b146126a1576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60165460ff166126e25760405162461bcd60e51b81526004018080602001828103825260328152602001806156a56032913960400191505060405180910390fd5b6113b8615035565b60145460ff1690565b60006002600f54600160a01b900460ff16600281111561270f57fe5b14612761576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff16600481111561277b57fe5b1461278857506000611149565b60006127ab6040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663754b6a736040518163ffffffff1660e01b815260040160206040518083038186803b1580156124be57600080fd5b6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c00000000000000000000000000000081525033612828826140ce565b6001600160a01b0316816001600160a01b03161461288d576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff1660028111156128a757fe5b146128f9576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b60008054600160a01b900460ff16600481111561291257fe5b1461294e5760405162461bcd60e51b81526004018080602001828103825260378152602001806157766037913960400191505060405180910390fd5b600b541561298d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615a81602a913960400191505060405180910390fd5b61299760016142c6565b6129b86006546129b260125434614ee590919063ffffffff16565b90614264565b60135542600b819055604080513481526020810192909252805133927fef51b4c870b8b0100eae2072e91db01222a303072af3728e58c9d4d2da33127f92908290030190a25050565b600454339061010090046001600160a01b03168114612a67576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff166002811115612a8157fe5b14612ad3576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6002600054600160a01b900460ff166004811115612aed57fe5b14612b3f576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b6000612b566008544761426490919063ffffffff16565b9050676f05b59d3b2000008110612b9e5760405162461bcd60e51b81526004018080602001828103825260328152602001806159bf6032913960400191505060405180910390fd5b612ba66152d7565b6000612be66040518060400160405280601981526020017f726f636b65744d696e69706f6f6c426f6e6452656475636572000000000000008152506140ce565b9050600060065490506000826001600160a01b031663d191ea9c6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612c2c57600080fd5b505af1158015612c40573d6000803e3d6000fd5b505050506040513d6020811015612c5657600080fd5b50519050612c75612c678383614264565b612c6f6135cf565b90614ee5565b601355600681905560408051808201909152601181527f726f636b65744e6574776f726b466565730000000000000000000000000000006020820152600090612cbd906140ce565b9050600060055490506000826001600160a01b031663e71501346040518163ffffffff1660e01b815260040160206040518083038186803b158015612d0157600080fd5b505afa158015612d15573d6000803e3d6000fd5b505050506040513d6020811015612d2b57600080fd5b5051600581905560408051808201909152601581527f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000006020820152909150600090612d75906140ce565b9050806001600160a01b0316630fcc8178878786866040518563ffffffff1660e01b815260040180858152602001848152602001838152602001828152602001945050505050600060405180830381600087803b158015612dd557600080fd5b505af1158015612de9573d6000803e3d6000fd5b5060049250612df6915050565b6004805460ff1690811115612e0757fe5b14612e5b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a55600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790555b6040805187815260208101879052428183015290517f90e131460b9acb17565f1719b9ebc49998aec6b07a4743a09b1b700545769eb69181900360600190a1505050505050505050565b6000612ebe60125460065461426490919063ffffffff16565b905090565b6001600160a01b031660009081526010602052604090205460ff1690565b60125490565b6002600f54600160a01b900460ff166002811115612f0157fe5b14612f53576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6001600054600160a01b900460ff166004811115612f6d57fe5b14612fa95760405162461bcd60e51b815260040180806020018281038252603481526020018061560f6034913960400191505060405180910390fd5b6000612fe96040518060400160405280601481526020017f726f636b657444414f4e6f6465547275737465640000000000000000000000008152506140ce565b9050600061300e6040518060600160405280602481526020016155a7602491396140ce565b9050816001600160a01b0316635dc33bdd336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561305d57600080fd5b505afa158015613071573d6000803e3d6000fd5b505050506040513d602081101561308757600080fd5b50516130da576040805162461bcd60e51b815260206004820152601460248201527f4e6f7420612074727573746564206d656d626572000000000000000000000000604482015290519081900360640190fd5b3360009081526010602052604090205460ff16156131295760405162461bcd60e51b815260040180806020018281038252602181526020018061599e6021913960400191505060405180910390fd5b3360008181526010602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815142815291517fc038496c9b2fce7ae180c60886062197d0411e3c5d249053f188423280778a839281900390910190a2600061329d670de0b6b3a7640000613297846001600160a01b0316636e86e7fe6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131e057600080fd5b505afa1580156131f4573d6000803e3d6000fd5b505050506040513d602081101561320a57600080fd5b5051604080517f997072f700000000000000000000000000000000000000000000000000000000815290516001600160a01b0389169163997072f7916004808301926020929190829003018186803b15801561326557600080fd5b505afa158015613279573d6000803e3d6000fd5b505050506040513d602081101561328f57600080fd5b5051906154e6565b9061553f565b9050806132b66001601154614ee590919063ffffffff16565b11156135ac5760145460ff161580156133305750816001600160a01b031663c4f502526040518163ffffffff1660e01b815260040160206040518083038186803b15801561330357600080fd5b505afa158015613317573d6000803e3d6000fd5b505050506040513d602081101561332d57600080fd5b50515b1561356c5760006133756040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152506140ce565b905060006133b76040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f64650000008152506140ce565b905060006133dc604051806060016040528060218152602001615901602191396140ce565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b15801561341957600080fd5b505afa15801561342d573d6000803e3d6000fd5b505050506040513d602081101561344357600080fd5b505160048054604080517f6fdbe57b00000000000000000000000000000000000000000000000000000000815290519394506001600160a01b038089169463245395a69461010090940482169361350993670de0b6b3a76400009361329793908c1692636fdbe57b92808201926020929091829003018186803b1580156134c957600080fd5b505afa1580156134dd573d6000803e3d6000fd5b505050506040513d60208110156134f357600080fd5b5051600654613503908990614264565b906154e6565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561354f57600080fd5b505af1158015613563573d6000803e3d6000fd5b50505050505050505b6135746145cd565b6040805142815290517fac58888447082d81defc760f4bd30b6196d9309777e161bce72c280a12a6ea689181900360200190a16135be565b6011546135ba906001614ee5565b6011555b505050565b60015490565b60055490565b6000600480805460ff16908111156135e357fe5b14156135f25750601354611149565b50600a54611149565b6002600f54600160a01b900460ff16600281111561361557fe5b14613667576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6002600054600160a01b900460ff16600481111561368157fe5b146136d3576040805162461bcd60e51b815260206004820152601860248201527f4d696e69706f6f6c206d757374206265207374616b696e670000000000000000604482015290519081900360640190fd5b60006136ea6008544761426490919063ffffffff16565b9050676f05b59d3b200000811015613749576040805162461bcd60e51b815260206004820152600f60248201527f42616c616e636520746f6f206c6f770000000000000000000000000000000000604482015290519081900360640190fd5b600061376c604051806060016040528060218152602001615901602191396140ce565b905060006137856017544261426490919063ffffffff16565b9050816001600160a01b0316637cb45bf7826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156137cb57600080fd5b505afa1580156137df573d6000803e3d6000fd5b505050506040513d60208110156137f557600080fd5b50516138325760405162461bcd60e51b81526004018080602001828103825260218152602001806156fc6021913960400191505060405180910390fd5b50504260175550565b600454339061010090046001600160a01b031681146138a1576040805162461bcd60e51b815260206004820152601660248201527f496e76616c6964206d696e69706f6f6c206f776e657200000000000000000000604482015290519081900360640190fd5b6002600f54600160a01b900460ff1660028111156138bb57fe5b1461390d576040805162461bcd60e51b815260206004820152601d60248201527f53746f72616765207374617465206e6f7420696e697469616c69736564000000604482015290519081900360640190fd5b6000613930604051806060016040528060218152602001615901602191396140ce565b905060006139556040518060600160405280602481526020016155a7602491396140ce565b90506000816001600160a01b031663f0245dc86040518163ffffffff1660e01b815260040160206040518083038186803b15801561399257600080fd5b505afa1580156139a6573d6000803e3d6000fd5b505050506040513d60208110156139bc57600080fd5b505190506001600054600160a01b900460ff1660048111156139da57fe5b14613a165760405162461bcd60e51b81526004018080602001828103825260368152602001806157ad6036913960400191505060405180910390fd5b80600254014211613a585760405162461bcd60e51b81526004018080602001828103825260238152602001806155ec6023913960400191505060405180910390fd5b60145460ff1615613ab0576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f74207374616b65206120766163616e74206d696e69706f6f6c0000604482015290519081900360640190fd5b5050613abc60026142c6565b6000613afc6040518060400160405280600d81526020017f6361737065724465706f736974000000000000000000000000000000000000008152506140ce565b90506000613b3e6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b90506000836001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015613b7b57600080fd5b505afa158015613b8f573d6000803e3d6000fd5b505050506040513d6020811015613ba557600080fd5b505190506000600480805460ff1690811115613bbd57fe5b1415613bd857601254613bd1908390614264565b9050613bed565b613bea8267de0b6b3a76400000614264565b90505b80471015613c2c5760405162461bcd60e51b81526004018080602001828103825260258152602001806158256025913960400191505060405180910390fd5b6000836001600160a01b0316633eb535e9306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b158015613c7b57600080fd5b505afa158015613c8f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015613cd657600080fd5b8101908080516040519392919084640100000000821115613cf657600080fd5b908301906020820185811115613d0b57600080fd5b8251640100000000811182820188101715613d2557600080fd5b82525081516020918201929091019080838360005b83811015613d52578181015183820152602001613d3a565b50505050905090810190601f168015613d7f5780820380516001836020036101000a031916815260200191505b506040525050509050846001600160a01b031663228951188383876001600160a01b0316632cb76c37306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b158015613de657600080fd5b505afa158015613dfa573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015613e4157600080fd5b8101908080516040519392919084640100000000821115613e6157600080fd5b908301906020820185811115613e7657600080fd5b8251640100000000811182820188101715613e9057600080fd5b82525081516020918201929091019080838360005b83811015613ebd578181015183820152602001613ea5565b50505050905090810190601f168015613eea5780820380516001836020036101000a031916815260200191505b506040525050508e8e8e6040518763ffffffff1660e01b815260040180806020018060200180602001858152602001848103845289818151815260200191508051906020019080838360005b83811015613f4e578181015183820152602001613f36565b50505050905090810190601f168015613f7b5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b83811015613fae578181015183820152602001613f96565b50505050905090810190601f168015613fdb5780820380516001836020036101000a031916815260200191505b508481038252868152602001878780828437600081840152601f19601f820116905080830192505050985050505050505050506000604051808303818588803b15801561402757600080fd5b505af115801561403b573d6000803e3d6000fd5b5050505050836001600160a01b0316639907288c600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156140a457600080fd5b505af11580156140b8573d6000803e3d6000fd5b5050505050505050505050505050565b60085490565b60008060008054906101000a90046001600160a01b03166001600160a01b03166321f8a7218460405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083835b6020831061416c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161412f565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156141db57600080fd5b505afa1580156141ef573d6000803e3d6000fd5b505050506040513d602081101561420557600080fd5b505190506001600160a01b038116611057576040805162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e640000000000000000000000000000604482015290519081900360640190fd5b6000828211156142bb576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600080548291907fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b83600481111561430057fe5b0217905550436001554260025580600481111561431957fe5b60ff167f26725881c2a4290b02cd153d6599fd484f0d4e6062c361e740fbbe39e7ad6142426040518082815260200191505060405180910390a250565b6000806143706143668587614ee5565b61329785886154e6565b9050600061437e8483614264565b90506143ab6143a4670de0b6b3a7640000613297600554856154e690919063ffffffff16565b8390614ee5565b9695505050505050565b6000806143c06135cf565b6006549091506000806143d38484614ee5565b9050808611156144085760006143e98783614264565b90506144006143f9858784614356565b8590614ee5565b92505061441d565b8386111561441d5761441a8685614264565b91505b600f54604080517fa1e8487d00000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b03169163a1e8487d916024808301926020929190829003018186803b15801561448157600080fd5b505afa158015614495573d6000803e3d6000fd5b505050506040513d60208110156144ab57600080fd5b5051905080156144e85760006144cd670de0b6b3a764000061329786856154e6565b9050838111156144da5750825b6144e48482614264565b9350505b509095945050505050565b60006145336040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152506140ce565b6009805460009182905560048054604080517f245395a60000000000000000000000000000000000000000000000000000000081526001600160a01b03610100909304831693810193909352602483018490525194955091939185169263245395a69260448084019382900301818387803b1580156145b157600080fd5b505af11580156145c5573d6000803e3d6000fd5b505050505050565b600061460d6040518060400160405280601181526020017f726f636b65744465706f736974506f6f6c0000000000000000000000000000008152506140ce565b9050600061464f6040518060400160405280601381526020017f726f636b65744d696e69706f6f6c5175657565000000000000000000000000008152506140ce565b905061465b60046142c6565b60145460ff16156147015760006146a66040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b9050806001600160a01b03166344e51a036040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156146e357600080fd5b505af11580156146f7573d6000803e3d6000fd5b505050505061483f565b60016004805460ff169081111561471457fe5b1415614798576040517fde1bdc8f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063de1bdc8f9060019060040180828152602001915050600060405180830381600087803b15801561477b57600080fd5b505af115801561478f573d6000803e3d6000fd5b5050505061483f565b60006147a26135cf565b9050826001600160a01b03166372f5158d826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156147df57600080fd5b505af11580156147f3573d6000803e3d6000fd5b50506040805185815242602082015281516001600160a01b03891695507fd5ca65e1ec4f4864fea7b9c5cb1ec3087a0dbf9c74641db3f6458edf445c40519450908190039091019150a2505b5050565b60006148836040518060400160405280600d81526020017f6361737065724465706f736974000000000000000000000000000000000000008152506140ce565b905060006148c56040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b6040517f2c7f64d4000000000000000000000000000000000000000000000000000000008152602060048201908152602482018990529192506001600160a01b03831691632c7f64d4918a918a918190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561495457600080fd5b505af1158015614968573d6000803e3d6000fd5b505050506000816001600160a01b0316632cb76c37306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b1580156149bb57600080fd5b505afa1580156149cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015614a1657600080fd5b8101908080516040519392919084640100000000821115614a3657600080fd5b908301906020820185811115614a4b57600080fd5b8251640100000000811182820188101715614a6557600080fd5b82525081516020918201929091019080838360005b83811015614a92578181015183820152602001614a7a565b50505050905090810190601f168015614abf5780820380516001836020036101000a031916815260200191505b506040525050509050826001600160a01b031663228951186012548a8a858b8b8b6040518863ffffffff1660e01b81526004018080602001806020018060200185815260200184810384528a8a828181526020019250808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920186810385528a5181528a51602091820193918c019250908190849084905b83811015614b81578181015183820152602001614b69565b50505050905090810190601f168015614bae5780820380516001836020036101000a031916815260200191505b508481038252868152602001878780828437600081840152601f19601f82011690508083019250505099505050505050505050506000604051808303818588803b158015614bfb57600080fd5b505af1158015614c0f573d6000803e3d6000fd5b50505050507f889f738426ec48d04c92bdcce1bc71c7aab6ba5296a4e92cc28a58c680b0a4ae888888888860125487426040518080602001806020018781526020018681526020018060200185815260200184810384528c8c82818152602001925080828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910185810384528a815260200190508a8a808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018681038452885181528851602091820193918a019250908190849084905b83811015614d1e578181015183820152602001614d06565b50505050905090810190601f168015614d4b5780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a15050505050505050565b6000805460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b03610100909304831693810193909352514794939190911691635b49ff62916024808301926020929190829003018186803b158015614ddf57600080fd5b505afa158015614df3573d6000803e3d6000fd5b505050506040513d6020811015614e0957600080fd5b50516040519091506000906001600160a01b0383169084908381818185875af1925050503d8060008114614e59576040519150601f19603f3d011682016040523d82523d6000602084013e614e5e565b606091505b5050905080614e9e5760405162461bcd60e51b81526004018080602001828103825260428152602001806157e36042913960600191505060405180910390fd5b6040805184815242602082015281516001600160a01b038516927fd5ca65e1ec4f4864fea7b9c5cb1ec3087a0dbf9c74641db3f6458edf445c4051928290030190a2505050565b600082820183811015614f3f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600080614f516135cf565b905080831015614f7557600354614f7057614f6c8184614264565b6009555b614f81565b614f7e836143b5565b91505b6000614f8d8484614264565b600854909150614f9d9084614ee5565b6008558015614fe257600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015614fe0573d6000803e3d6000fd5b505b436003556040805184815260208101839052808201869052426060820152905133917f3422b68c7062367a3ae581f8bf64158ddb63f02294a0abe7f32491787076f1b7919081900360800190a250505050565b60006150756040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e6167657200000000000000000000008152506140ce565b600f549091507501000000000000000000000000000000000000000000900460ff16156150d35760405162461bcd60e51b815260040180806020018281038252602381526020018061597b6023913960400191505060405180910390fd5b600f80547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000017905560095415615123576151236144f3565b6008541561513357615133615354565b471561517457600e546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015615172573d6000803e3d6000fd5b505b600e60009054906101000a90046001600160a01b03166001600160a01b031663188e0dc66040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156151c457600080fd5b505af11580156151d8573d6000803e3d6000fd5b50505050806001600160a01b031663b04e8868600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561524057600080fd5b505af1158015615254573d6000803e3d6000fd5b50505050806001600160a01b03166375b59c7f600460019054906101000a90046001600160a01b03166040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156152bc57600080fd5b505af11580156152d0573d6000803e3d6000fd5b5050505050565b60006152ee6008544761426490919063ffffffff16565b9050600061530060065461107f6135cf565b6008549091506153109082614ee5565b600855600e546001600160a01b03166108fc61532c8484614264565b6040518115909202916000818181858888f193505050501580156135be573d6000803e3d6000fd5b60145460ff16156153ac576040805162461bcd60e51b815260206004820152601d60248201527f566163616e74206d696e69706f6f6c2063616e6e6f7420726566756e64000000604482015290519081900360640190fd5b60088054600091829055815460048054604080517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b0361010090930483169381019390935251939493921691635b49ff6291602480820192602092909190829003018186803b15801561542757600080fd5b505afa15801561543b573d6000803e3d6000fd5b505050506040513d602081101561545157600080fd5b50516040519091506000906001600160a01b0383169084908381818185875af1925050503d80600081146154a1576040519150601f19603f3d011682016040523d82523d6000602084013e6154a6565b606091505b5050905080614e9e5760405162461bcd60e51b815260040180806020018281038252604381526020018061586d6043913960600191505060405180910390fd5b6000826154f5575060006142c0565b8282028284828161550257fe5b0414614f3f5760405162461bcd60e51b81526004018080602001828103825260218152602001806159226021913960400191505060405180910390fd5b6000808211615595576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161559e57fe5b04939250505056fe726f636b657444414f4e6f64655472757374656453657474696e67734d696e69706f6f6c53746f7261676520737461746520616c726561647920696e697469616c697365644e6f7420656e6f7567682074696d65206861732070617373656420746f207374616b65546865206d696e69706f6f6c2063616e206f6e6c79206265207363727562626564207768696c6520696e207072656c61756e6368546865207072652d6465706f7369742063616e206f6e6c79206265206d616465207768696c6520696e697469616c69736564546865206d696e69706f6f6c2063616e206f6e6c792070726f6d6f7465207768696c6520696e207072656c61756e636843616e206f6e6c79206d616e75616c6c792066696e616c697365206166746572207573657220646973747269627574696f6e4e6f7420656e6f7567682074696d65206861732070617373656420746f2070726f6d6f74655573657220646973747269627574696f6e20616c72656164792070656e64696e6743616e6e6f742070726f6d6f74652061206e6f6e2d766163616e74206d696e69706f6f6c4e6f20616d6f756e74206f6620746865206e6f6465206465706f73697420697320617661696c61626c6520666f7220726566756e64546865206e6f6465206465706f7369742063616e206f6e6c792062652061737369676e6564207768696c6520696e697469616c69736564546865206d696e69706f6f6c2063616e206f6e6c7920626567696e207374616b696e67207768696c6520696e207072656c61756e63684e6f6465204554482062616c616e636520776173206e6f74207375636365737366756c6c79207472616e7366657272656420746f206e6f6465206f70657261746f72496e73756666696369656e742062616c616e636520746f20626567696e207374616b696e674f6e6c79206f776e65722063616e2064697374726962757465207269676874206e6f7745544820726566756e6420616d6f756e7420776173206e6f74207375636365737366756c6c79207472616e7366657272656420746f206e6f6465206f70657261746f725468652075736572206465706f7369742063616e206f6e6c792062652061737369676e6564207768696c6520696e697469616c697365642c20696e207072656c61756e63682c206f72207374616b696e67726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546865206d696e69706f6f6c2063616e206f6e6c7920626520646973736f6c766564206f6e6365206974206861732074696d6564206f75744d696e69706f6f6c2068617320616c7265616479206265656e2066696e616c697365644d656d6265722068617320616c726561647920766f74656420746f20736372756243616e6e6f742072656475636520626f6e6420776974682062616c616e6365206f662038206574686572206f72206d6f7265546865206d696e69706f6f6c2063616e206f6e6c7920626520646973736f6c766564207768696c6520696e207072656c61756e6368546865206d696e69706f6f6c2063616e206f6e6c7920626520636c6f736564207768696c6520646973736f6c7665644f6e6c79206f776e65722063616e206469737472696275746520646973736f6c766564206d696e69706f6f6c5468652075736572206465706f7369742068617320616c7265616479206265656e2061737369676e6564a26469706673582212200505fe7e60c1563d1e9e58e526d36a66843ba60fcf42f043946b22c902f2972764736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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