ETH Price: $2,408.11 (-2.98%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw RPL205977012024-08-24 9:55:4772 days ago1724493347IN
Rocket Pool: Node Staking
0 ETH0.000040581.36513857
Stake RPL201076282024-06-16 23:27:47141 days ago1718580467IN
Rocket Pool: Node Staking
0 ETH0.000657275.83624916
Stake RPL201076252024-06-16 23:27:11141 days ago1718580431IN
Rocket Pool: Node Staking
0 ETH0.000859025.66520265
Set Stake RPL Fo...201072992024-06-16 22:21:35141 days ago1718576495IN
Rocket Pool: Node Staking
0 ETH0.000367375.81969011
Stake RPL201072732024-06-16 22:16:11141 days ago1718576171IN
Rocket Pool: Node Staking
0 ETH0.000450474
Stake RPL201071132024-06-16 21:43:35141 days ago1718574215IN
Rocket Pool: Node Staking
0 ETH0.000535564.56110334
Stake RPL201060512024-06-16 18:09:59141 days ago1718561399IN
Rocket Pool: Node Staking
0 ETH0.000563155
Stake RPL201059172024-06-16 17:42:59141 days ago1718559779IN
Rocket Pool: Node Staking
0 ETH0.000687726.1060394
Withdraw RPL201058922024-06-16 17:37:59141 days ago1718559479IN
Rocket Pool: Node Staking
0 ETH0.00104216.28117403
Withdraw RPL201047882024-06-16 13:55:23141 days ago1718546123IN
Rocket Pool: Node Staking
0 ETH0.001118565.74145047
Stake RPL201044782024-06-16 12:53:11141 days ago1718542391IN
Rocket Pool: Node Staking
0 ETH0.000450424
Stake RPL201032522024-06-16 8:47:11141 days ago1718527631IN
Rocket Pool: Node Staking
0 ETH0.000816575.56135315
Withdraw RPL201025112024-06-16 6:18:35141 days ago1718518715IN
Rocket Pool: Node Staking
0 ETH0.000888525
Stake RPL For201014402024-06-16 2:43:35141 days ago1718505815IN
Rocket Pool: Node Staking
0 ETH0.000319762.71829507
Stake RPL200992062024-06-15 19:12:59142 days ago1718478779IN
Rocket Pool: Node Staking
0 ETH0.000450424
Withdraw RPL200975422024-06-15 13:38:47142 days ago1718458727IN
Rocket Pool: Node Staking
0 ETH0.001333677.28670373
Stake RPL200971262024-06-15 12:14:47142 days ago1718453687IN
Rocket Pool: Node Staking
0 ETH0.000563035
Stake RPL For200968082024-06-15 11:10:59142 days ago1718449859IN
Rocket Pool: Node Staking
0 ETH0.000430883.66293268
Stake RPL200963252024-06-15 9:33:59142 days ago1718444039IN
Rocket Pool: Node Staking
0 ETH0.000741026.57992717
Withdraw RPL200959002024-06-15 8:08:11142 days ago1718438891IN
Rocket Pool: Node Staking
0 ETH0.000974025
Withdraw RPL200951482024-06-15 5:35:23142 days ago1718429723IN
Rocket Pool: Node Staking
0 ETH0.001150316.28597502
Stake RPL For200949872024-06-15 5:02:47142 days ago1718427767IN
Rocket Pool: Node Staking
0 ETH0.000689225.85996787
Stake RPL200935892024-06-15 0:19:59143 days ago1718410799IN
Rocket Pool: Node Staking
0 ETH0.000558734.96080112
Withdraw RPL200934472024-06-14 23:51:35143 days ago1718409095IN
Rocket Pool: Node Staking
0 ETH0.001084896.53909625
Withdraw RPL200934362024-06-14 23:49:23143 days ago1718408963IN
Rocket Pool: Node Staking
0 ETH0.001146776.72103877
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RocketNodeStaking

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 15000 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 20 : RocketNodeStaking.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 "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "../RocketBase.sol";
import "../../interface/minipool/RocketMinipoolManagerInterface.sol";
import "../../interface/network/RocketNetworkPricesInterface.sol";
import "../../interface/node/RocketNodeStakingInterface.sol";
import "../../interface/dao/protocol/settings/RocketDAOProtocolSettingsRewardsInterface.sol";
import "../../interface/dao/protocol/settings/RocketDAOProtocolSettingsMinipoolInterface.sol";
import "../../interface/dao/protocol/settings/RocketDAOProtocolSettingsNodeInterface.sol";
import "../../interface/RocketVaultInterface.sol";
import "../../interface/util/AddressSetStorageInterface.sol";

/// @notice Handles node deposits and minipool creation
contract RocketNodeStaking is RocketBase, RocketNodeStakingInterface {

    // Libs
    using SafeMath for uint;

    // Events
    event RPLStaked(address indexed from, uint256 amount, uint256 time);
    event RPLWithdrawn(address indexed to, uint256 amount, uint256 time);
    event RPLSlashed(address indexed node, uint256 amount, uint256 ethValue, uint256 time);
    event StakeRPLForAllowed(address indexed node, address indexed caller, bool allowed, uint256 time);

    constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
        version = 4;
    }

    /// @notice Returns the total quantity of RPL staked on the network
    function getTotalRPLStake() override external view returns (uint256) {
        return getUint(keccak256("rpl.staked.total.amount"));
    }

    /// @dev Increases the total network RPL stake
    /// @param _amount How much to increase by
    function increaseTotalRPLStake(uint256 _amount) private {
        addUint(keccak256("rpl.staked.total.amount"), _amount);
    }

    /// @dev Decrease the total network RPL stake
    /// @param _amount How much to decrease by
    function decreaseTotalRPLStake(uint256 _amount) private {
        subUint(keccak256("rpl.staked.total.amount"), _amount);
    }

    /// @notice Returns the amount a given node operator has staked
    /// @param _nodeAddress The address of the node operator to query
    function getNodeRPLStake(address _nodeAddress) override public view returns (uint256) {
        return getUint(keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)));
    }

    /// @dev Increases a node operator's RPL stake
    /// @param _amount How much to increase by
    function increaseNodeRPLStake(address _nodeAddress, uint256 _amount) private {
        addUint(keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)), _amount);
    }

    /// @dev Decrease a node operator's RPL stake
    /// @param _amount How much to decrease by
    function decreaseNodeRPLStake(address _nodeAddress, uint256 _amount) private {
        subUint(keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)), _amount);
    }

    /// @notice Returns a node's matched ETH amount (amount taken from protocol to stake)
    /// @param _nodeAddress The address of the node operator to query
    function getNodeETHMatched(address _nodeAddress) override public view returns (uint256) {
        uint256 ethMatched = getUint(keccak256(abi.encodePacked("eth.matched.node.amount", _nodeAddress)));

        if (ethMatched > 0) {
            return ethMatched;
        } else {
            // Fallback for backwards compatibility before ETH matched was recorded (all minipools matched 16 ETH from protocol)
            RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
            return rocketMinipoolManager.getNodeActiveMinipoolCount(_nodeAddress).mul(16 ether);
        }
    }

    /// @notice Returns a node's provided ETH amount (amount supplied to create minipools)
    /// @param _nodeAddress The address of the node operator to query
    function getNodeETHProvided(address _nodeAddress) override public view returns (uint256) {
        // Get contracts
        RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
        uint256 activeMinipoolCount = rocketMinipoolManager.getNodeActiveMinipoolCount(_nodeAddress);
        // Retrieve stored ETH matched value
        uint256 ethMatched = getUint(keccak256(abi.encodePacked("eth.matched.node.amount", _nodeAddress)));
        if (ethMatched > 0) {
            RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
            uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance();
            // ETH provided is number of staking minipools * 32 - eth matched
            uint256 totalEthStaked = activeMinipoolCount.mul(launchAmount);
            return totalEthStaked.sub(ethMatched);
        } else {
            // Fallback for legacy minipools is number of staking minipools * 16
            return activeMinipoolCount.mul(16 ether);
        }
    }

    /// @notice Returns the ratio between capital taken from users and provided by a node operator.
    ///         The value is a 1e18 precision fixed point integer value of (node capital + user capital) / node capital.
    /// @param _nodeAddress The address of the node operator to query
    function getNodeETHCollateralisationRatio(address _nodeAddress) override public view returns (uint256) {
        uint256 ethMatched = getUint(keccak256(abi.encodePacked("eth.matched.node.amount", _nodeAddress)));
        if (ethMatched == 0) {
            // Node operator only has legacy minipools and all legacy minipools had a 1:1 ratio
            return calcBase.mul(2);
        } else {
            RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
            uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance();
            RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager"));
            uint256 totalEthStaked = rocketMinipoolManager.getNodeActiveMinipoolCount(_nodeAddress).mul(launchAmount);
            return totalEthStaked.mul(calcBase).div(totalEthStaked.sub(ethMatched));
        }
    }

    /// @notice Returns the timestamp at which a node last staked RPL
    function getNodeRPLStakedTime(address _nodeAddress) override public view returns (uint256) {
        return getUint(keccak256(abi.encodePacked("rpl.staked.node.time", _nodeAddress)));
    }

    /// @dev Sets the timestamp at which a node last staked RPL
    /// @param _nodeAddress The address of the node operator to set the value for
    /// @param _time The timestamp to set
    function setNodeRPLStakedTime(address _nodeAddress, uint256 _time) private {
        setUint(keccak256(abi.encodePacked("rpl.staked.node.time", _nodeAddress)), _time);
    }

    /// @notice Calculate and return a node's effective RPL stake amount
    /// @param _nodeAddress The address of the node operator to calculate for
    function getNodeEffectiveRPLStake(address _nodeAddress) override external view returns (uint256) {
        // Load contracts
        RocketNetworkPricesInterface rocketNetworkPrices = RocketNetworkPricesInterface(getContractAddress("rocketNetworkPrices"));
        RocketDAOProtocolSettingsNodeInterface rocketDAOProtocolSettingsNode = RocketDAOProtocolSettingsNodeInterface(getContractAddress("rocketDAOProtocolSettingsNode"));
        // Get node's current RPL stake
        uint256 rplStake = getNodeRPLStake(_nodeAddress);
        // Retrieve variables for calculations
        uint256 matchedETH = getNodeETHMatched(_nodeAddress);
        uint256 providedETH = getNodeETHProvided(_nodeAddress);
        uint256 rplPrice = rocketNetworkPrices.getRPLPrice();
        // RPL stake cannot exceed maximum
        uint256 maximumStakePercent = rocketDAOProtocolSettingsNode.getMaximumPerMinipoolStake();
        uint256 maximumStake = providedETH.mul(maximumStakePercent).div(rplPrice);
        if (rplStake > maximumStake) {
            return maximumStake;
        }
        // If RPL stake is lower than minimum, node has no effective stake
        uint256 minimumStakePercent = rocketDAOProtocolSettingsNode.getMinimumPerMinipoolStake();
        uint256 minimumStake = matchedETH.mul(minimumStakePercent).div(rplPrice);
        if (rplStake < minimumStake) {
            return 0;
        }
        // Otherwise, return the actual stake
        return rplStake;
    }

    /// @notice Calculate and return a node's minimum RPL stake to collateralize their minipools
    /// @param _nodeAddress The address of the node operator to calculate for
    function getNodeMinimumRPLStake(address _nodeAddress) override external view returns (uint256) {
        // Load contracts
        RocketNetworkPricesInterface rocketNetworkPrices = RocketNetworkPricesInterface(getContractAddress("rocketNetworkPrices"));
        RocketDAOProtocolSettingsNodeInterface rocketDAOProtocolSettingsNode = RocketDAOProtocolSettingsNodeInterface(getContractAddress("rocketDAOProtocolSettingsNode"));
        // Retrieve variables
        uint256 minimumStakePercent = rocketDAOProtocolSettingsNode.getMinimumPerMinipoolStake();
        uint256 matchedETH = getNodeETHMatched(_nodeAddress);
        return matchedETH
            .mul(minimumStakePercent)
            .div(rocketNetworkPrices.getRPLPrice());
    }

    /// @notice Calculate and return a node's maximum RPL stake to fully collateralise their minipools
    /// @param _nodeAddress The address of the node operator to calculate for
    function getNodeMaximumRPLStake(address _nodeAddress) override public view returns (uint256) {
        // Load contracts
        RocketNetworkPricesInterface rocketNetworkPrices = RocketNetworkPricesInterface(getContractAddress("rocketNetworkPrices"));
        RocketDAOProtocolSettingsNodeInterface rocketDAOProtocolSettingsNode = RocketDAOProtocolSettingsNodeInterface(getContractAddress("rocketDAOProtocolSettingsNode"));
        // Retrieve variables
        uint256 maximumStakePercent = rocketDAOProtocolSettingsNode.getMaximumPerMinipoolStake();
        uint256 providedETH = getNodeETHProvided(_nodeAddress);
        return providedETH
            .mul(maximumStakePercent)
            .div(rocketNetworkPrices.getRPLPrice());
    }

    /// @notice Calculate and return a node's limit of how much user ETH they can use based on RPL stake
    /// @param _nodeAddress The address of the node operator to calculate for
    function getNodeETHMatchedLimit(address _nodeAddress) override external view returns (uint256) {
        // Load contracts
        RocketNetworkPricesInterface rocketNetworkPrices = RocketNetworkPricesInterface(getContractAddress("rocketNetworkPrices"));
        RocketDAOProtocolSettingsNodeInterface rocketDAOProtocolSettingsNode = RocketDAOProtocolSettingsNodeInterface(getContractAddress("rocketDAOProtocolSettingsNode"));
        // Calculate & return limit
        uint256 minimumStakePercent = rocketDAOProtocolSettingsNode.getMinimumPerMinipoolStake();
        return getNodeRPLStake(_nodeAddress)
            .mul(rocketNetworkPrices.getRPLPrice())
            .div(minimumStakePercent);
    }

    /// @notice Accept an RPL stake
    ///         Only accepts calls from registered nodes
    ///         Requires call to have approved this contract to spend RPL
    /// @param _amount The amount of RPL to stake
    function stakeRPL(uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredNode(msg.sender) {
        _stakeRPL(msg.sender, _amount);
    }

    /// @notice Accept an RPL stake from any address for a specified node
    ///         Requires caller to have approved this contract to spend RPL
    ///         Requires caller to be on the node operator's allow list (see `setStakeForAllowed`)
    /// @param _nodeAddress The address of the node operator to stake on behalf of
    /// @param _amount The amount of RPL to stake
    function stakeRPLFor(address _nodeAddress, uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredNode(_nodeAddress) {
       // Must be node's withdrawal address, allow listed address or rocketMerkleDistributorMainnet
       if (msg.sender != getAddress(keccak256(abi.encodePacked("contract.address", "rocketMerkleDistributorMainnet")))) {
           address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(_nodeAddress);
           if (msg.sender != withdrawalAddress) {
               require(getBool(keccak256(abi.encodePacked("node.stake.for.allowed", _nodeAddress, msg.sender))), "Not allowed to stake for");
           }
       }
       _stakeRPL(_nodeAddress, _amount);
    }

    /// @notice Explicitly allow or remove allowance of an address to be able to stake on behalf of a node
    /// @param _caller The address you wish to allow
    /// @param _allowed Whether the address is allowed or denied
    function setStakeRPLForAllowed(address _caller, bool _allowed) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredNode(msg.sender) {
        setBool(keccak256(abi.encodePacked("node.stake.for.allowed", msg.sender, _caller)), _allowed);
        emit StakeRPLForAllowed(msg.sender, _caller, _allowed, block.timestamp);
    }

    /// @dev Internal logic for staking RPL
    /// @param _nodeAddress The address to increase the RPL stake of
    /// @param _amount The amount of RPL to stake
    function _stakeRPL(address _nodeAddress, uint256 _amount) internal {
        // Load contracts
        address rplTokenAddress = getContractAddress("rocketTokenRPL");
        address rocketVaultAddress = getContractAddress("rocketVault");
        IERC20 rplToken = IERC20(rplTokenAddress);
        RocketVaultInterface rocketVault = RocketVaultInterface(rocketVaultAddress);
        // Transfer RPL tokens
        require(rplToken.transferFrom(msg.sender, address(this), _amount), "Could not transfer RPL to staking contract");
        // Deposit RPL tokens to vault
        require(rplToken.approve(rocketVaultAddress, _amount), "Could not approve vault RPL deposit");
        rocketVault.depositToken("rocketNodeStaking", rplToken, _amount);
        // Update RPL stake amounts & node RPL staked block
        increaseTotalRPLStake(_amount);
        increaseNodeRPLStake(_nodeAddress, _amount);
        setNodeRPLStakedTime(_nodeAddress, block.timestamp);
        // Emit RPL staked event
        emit RPLStaked(_nodeAddress, _amount, block.timestamp);
    }

    /// @notice Withdraw staked RPL back to the node account
    ///         Only accepts calls from registered nodes
    ///         Withdraws to withdrawal address if set, otherwise defaults to node address
    /// @param _amount The amount of RPL to withdraw
    function withdrawRPL(uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredNode(msg.sender) {
        // Load contracts
        RocketDAOProtocolSettingsRewardsInterface rocketDAOProtocolSettingsRewards = RocketDAOProtocolSettingsRewardsInterface(getContractAddress("rocketDAOProtocolSettingsRewards"));
        RocketVaultInterface rocketVault = RocketVaultInterface(getContractAddress("rocketVault"));
        // Check cooldown period (one claim period) has passed since RPL last staked
        require(block.timestamp.sub(getNodeRPLStakedTime(msg.sender)) >= rocketDAOProtocolSettingsRewards.getRewardsClaimIntervalTime(), "The withdrawal cooldown period has not passed");
        // Get & check node's current RPL stake
        uint256 rplStake = getNodeRPLStake(msg.sender);
        require(rplStake >= _amount, "Withdrawal amount exceeds node's staked RPL balance");
        // Check withdrawal would not undercollateralize node
        require(rplStake.sub(_amount) >= getNodeMaximumRPLStake(msg.sender), "Node's staked RPL balance after withdrawal is less than required balance");
        // Update RPL stake amounts
        decreaseTotalRPLStake(_amount);
        decreaseNodeRPLStake(msg.sender, _amount);
        // Transfer RPL tokens to node address
        rocketVault.withdrawToken(rocketStorage.getNodeWithdrawalAddress(msg.sender), IERC20(getContractAddress("rocketTokenRPL")), _amount);
        // Emit RPL withdrawn event
        emit RPLWithdrawn(msg.sender, _amount, block.timestamp);
    }

    /// @notice Slash a node's RPL by an ETH amount
    ///         Only accepts calls from registered minipools
    /// @param _nodeAddress The address to slash RPL from
    /// @param _ethSlashAmount The amount of RPL to slash denominated in ETH value
    function slashRPL(address _nodeAddress, uint256 _ethSlashAmount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredMinipool(msg.sender) {
        // Load contracts
        RocketNetworkPricesInterface rocketNetworkPrices = RocketNetworkPricesInterface(getContractAddress("rocketNetworkPrices"));
        RocketVaultInterface rocketVault = RocketVaultInterface(getContractAddress("rocketVault"));
        // Calculate RPL amount to slash
        uint256 rplSlashAmount = calcBase.mul(_ethSlashAmount).div(rocketNetworkPrices.getRPLPrice());
        // Cap slashed amount to node's RPL stake
        uint256 rplStake = getNodeRPLStake(_nodeAddress);
        if (rplSlashAmount > rplStake) { rplSlashAmount = rplStake; }
        // Transfer slashed amount to auction contract
        if(rplSlashAmount > 0) rocketVault.transferToken("rocketAuctionManager", IERC20(getContractAddress("rocketTokenRPL")), rplSlashAmount);
        // Update RPL stake amounts
        decreaseTotalRPLStake(rplSlashAmount);
        decreaseNodeRPLStake(_nodeAddress, rplSlashAmount);
        // Mark minipool as slashed
        setBool(keccak256(abi.encodePacked("minipool.rpl.slashed", msg.sender)), true);
        // Emit RPL slashed event
        emit RPLSlashed(_nodeAddress, rplSlashAmount, _ethSlashAmount, block.timestamp);
    }

}

File 2 of 20 : 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 20 : 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 4 of 20 : 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 5 of 20 : RocketBase.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";

/// @title Base settings / modifiers for each contract in Rocket Pool
/// @author David Rugendyke

abstract contract RocketBase {

    // Calculate using this as the base
    uint256 constant calcBase = 1 ether;

    // Version of the contract
    uint8 public version;

    // The main storage contract where primary persistant storage is maintained
    RocketStorageInterface rocketStorage = RocketStorageInterface(0);


    /*** Modifiers **********************************************************/

    /**
    * @dev Throws if called by any sender that doesn't match a Rocket Pool network contract
    */
    modifier onlyLatestNetworkContract() {
        require(getBool(keccak256(abi.encodePacked("contract.exists", msg.sender))), "Invalid or outdated network contract");
        _;
    }

    /**
    * @dev Throws if called by any sender that doesn't match one of the supplied contract or is the latest version of that contract
    */
    modifier onlyLatestContract(string memory _contractName, address _contractAddress) {
        require(_contractAddress == getAddress(keccak256(abi.encodePacked("contract.address", _contractName))), "Invalid or outdated contract");
        _;
    }

    /**
    * @dev Throws if called by any sender that isn't a registered node
    */
    modifier onlyRegisteredNode(address _nodeAddress) {
        require(getBool(keccak256(abi.encodePacked("node.exists", _nodeAddress))), "Invalid node");
        _;
    }

    /**
    * @dev Throws if called by any sender that isn't a trusted node DAO member
    */
    modifier onlyTrustedNode(address _nodeAddress) {
        require(getBool(keccak256(abi.encodePacked("dao.trustednodes.", "member", _nodeAddress))), "Invalid trusted node");
        _;
    }

    /**
    * @dev Throws if called by any sender that isn't a registered minipool
    */
    modifier onlyRegisteredMinipool(address _minipoolAddress) {
        require(getBool(keccak256(abi.encodePacked("minipool.exists", _minipoolAddress))), "Invalid minipool");
        _;
    }
    

    /**
    * @dev Throws if called by any account other than a guardian account (temporary account allowed access to settings before DAO is fully enabled)
    */
    modifier onlyGuardian() {
        require(msg.sender == rocketStorage.getGuardian(), "Account is not a temporary guardian");
        _;
    }




    /*** Methods **********************************************************/

    /// @dev Set the main Rocket Storage address
    constructor(RocketStorageInterface _rocketStorageAddress) {
        // Update the contract address
        rocketStorage = RocketStorageInterface(_rocketStorageAddress);
    }


    /// @dev Get the address of a network contract by name
    function getContractAddress(string memory _contractName) internal view returns (address) {
        // Get the current contract address
        address contractAddress = getAddress(keccak256(abi.encodePacked("contract.address", _contractName)));
        // Check it
        require(contractAddress != address(0x0), "Contract not found");
        // Return
        return contractAddress;
    }


    /// @dev Get the address of a network contract by name (returns address(0x0) instead of reverting if contract does not exist)
    function getContractAddressUnsafe(string memory _contractName) internal view returns (address) {
        // Get the current contract address
        address contractAddress = getAddress(keccak256(abi.encodePacked("contract.address", _contractName)));
        // Return
        return contractAddress;
    }


    /// @dev Get the name of a network contract by address
    function getContractName(address _contractAddress) internal view returns (string memory) {
        // Get the contract name
        string memory contractName = getString(keccak256(abi.encodePacked("contract.name", _contractAddress)));
        // Check it
        require(bytes(contractName).length > 0, "Contract not found");
        // Return
        return contractName;
    }

    /// @dev Get revert error message from a .call method
    function getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_returnData.length < 68) return "Transaction reverted silently";
        assembly {
            // Slice the sighash.
            _returnData := add(_returnData, 0x04)
        }
        return abi.decode(_returnData, (string)); // All that remains is the revert string
    }



    /*** Rocket Storage Methods ****************************************/

    // Note: Unused helpers have been removed to keep contract sizes down

    /// @dev Storage get methods
    function getAddress(bytes32 _key) internal view returns (address) { return rocketStorage.getAddress(_key); }
    function getUint(bytes32 _key) internal view returns (uint) { return rocketStorage.getUint(_key); }
    function getString(bytes32 _key) internal view returns (string memory) { return rocketStorage.getString(_key); }
    function getBytes(bytes32 _key) internal view returns (bytes memory) { return rocketStorage.getBytes(_key); }
    function getBool(bytes32 _key) internal view returns (bool) { return rocketStorage.getBool(_key); }
    function getInt(bytes32 _key) internal view returns (int) { return rocketStorage.getInt(_key); }
    function getBytes32(bytes32 _key) internal view returns (bytes32) { return rocketStorage.getBytes32(_key); }

    /// @dev Storage set methods
    function setAddress(bytes32 _key, address _value) internal { rocketStorage.setAddress(_key, _value); }
    function setUint(bytes32 _key, uint _value) internal { rocketStorage.setUint(_key, _value); }
    function setString(bytes32 _key, string memory _value) internal { rocketStorage.setString(_key, _value); }
    function setBytes(bytes32 _key, bytes memory _value) internal { rocketStorage.setBytes(_key, _value); }
    function setBool(bytes32 _key, bool _value) internal { rocketStorage.setBool(_key, _value); }
    function setInt(bytes32 _key, int _value) internal { rocketStorage.setInt(_key, _value); }
    function setBytes32(bytes32 _key, bytes32 _value) internal { rocketStorage.setBytes32(_key, _value); }

    /// @dev Storage delete methods
    function deleteAddress(bytes32 _key) internal { rocketStorage.deleteAddress(_key); }
    function deleteUint(bytes32 _key) internal { rocketStorage.deleteUint(_key); }
    function deleteString(bytes32 _key) internal { rocketStorage.deleteString(_key); }
    function deleteBytes(bytes32 _key) internal { rocketStorage.deleteBytes(_key); }
    function deleteBool(bytes32 _key) internal { rocketStorage.deleteBool(_key); }
    function deleteInt(bytes32 _key) internal { rocketStorage.deleteInt(_key); }
    function deleteBytes32(bytes32 _key) internal { rocketStorage.deleteBytes32(_key); }

    /// @dev Storage arithmetic methods
    function addUint(bytes32 _key, uint256 _amount) internal { rocketStorage.addUint(_key, _amount); }
    function subUint(bytes32 _key, uint256 _amount) internal { rocketStorage.subUint(_key, _amount); }
}

File 6 of 20 : 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 7 of 20 : 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 8 of 20 : 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 9 of 20 : 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 20 : 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 11 of 20 : RocketNetworkPricesInterface.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 RocketNetworkPricesInterface {
    function getPricesBlock() external view returns (uint256);
    function getRPLPrice() external view returns (uint256);
    function getLatestReportableBlock() external view returns (uint256);
    function submitPrices(uint256 _block, uint256 _rplPrice) external;
    function executeUpdatePrices(uint256 _block, uint256 _rplPrice) external;
}

File 12 of 20 : 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 13 of 20 : RocketDAOProtocolSettingsRewardsInterface.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 RocketDAOProtocolSettingsRewardsInterface {
    function setSettingRewardsClaimer(string memory _contractName, uint256 _perc) external;
    function getRewardsClaimerPerc(string memory _contractName) external view returns (uint256);
    function getRewardsClaimerPercTimeUpdated(string memory _contractName) external view returns (uint256);
    function getRewardsClaimersPercTotal() external view returns (uint256);
    function getRewardsClaimIntervalTime() external view returns (uint256);
}

File 14 of 20 : 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 15 of 20 : 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 16 of 20 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 17 of 20 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 18 of 20 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./ERC20.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    using SafeMath for uint256;

    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
}

File 19 of 20 : RocketVaultInterface.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";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

interface RocketVaultInterface {
    function balanceOf(string memory _networkContractName) external view returns (uint256);
    function depositEther() external payable;
    function withdrawEther(uint256 _amount) external;
    function depositToken(string memory _networkContractName, IERC20 _tokenAddress, uint256 _amount) external;
    function withdrawToken(address _withdrawalAddress, IERC20 _tokenAddress, uint256 _amount) external;
    function balanceOfToken(string memory _networkContractName, IERC20 _tokenAddress) external view returns (uint256);
    function transferToken(string memory _networkContractName, IERC20 _tokenAddress, uint256 _amount) external;
    function burnToken(ERC20Burnable _tokenAddress, uint256 _amount) external;
}

File 20 of 20 : AddressSetStorageInterface.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 AddressSetStorageInterface {
    function getCount(bytes32 _key) external view returns (uint);
    function getItem(bytes32 _key, uint _index) external view returns (address);
    function getIndexOf(bytes32 _key, address _value) external view returns (int);
    function addItem(bytes32 _key, address _value) external;
    function removeItem(bytes32 _key, address _value) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract RocketStorageInterface","name":"_rocketStorageAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RPLSlashed","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":"RPLStaked","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":"RPLWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StakeRPLForAllowed","type":"event"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeETHCollateralisationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeETHMatched","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeETHMatchedLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeETHProvided","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeEffectiveRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeMaximumRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeMinimumRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getNodeRPLStakedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"setStakeRPLForAllowed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"uint256","name":"_ethSlashAmount","type":"uint256"}],"name":"slashRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeRPLFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawRPL","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260008054610100600160a81b031916905534801561002157600080fd5b50604051612e2c380380612e2c8339818101604052602081101561004457600080fd5b50516000805460ff196001600160a01b0390931661010002610100600160a81b031990911617919091166004179055612daa806100826000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806397be214311610097578063c0d05dd811610066578063c0d05dd8146102b7578063cb1c8321146102dd578063e5e82b7c14610309578063f0d19b891461032f57610100565b806397be21431461023d5780639961cee4146102635780639a206c8e14610289578063a493e6a21461029157610100565b806348aeedf5116100d357806348aeedf5146101b65780634e58ff6e146101dc57806354fd4d50146102025780636b088d5c1461022057610100565b806303fa87b414610105578063088903a41461013d578063245395a61461016d5780633e200d4b14610199575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610355565b60408051918252519081900360200190f35b61016b6004803603604081101561015357600080fd5b506001600160a01b03813516906020013515156104d4565b005b61016b6004803603604081101561018357600080fd5b506001600160a01b0381351690602001356107aa565b61016b600480360360208110156101af57600080fd5b5035610c4d565b61012b600480360360208110156101cc57600080fd5b50356001600160a01b0316610e1e565b61012b600480360360208110156101f257600080fd5b50356001600160a01b0316610fb4565b61020a6110ad565b6040805160ff9092168252519081900360200190f35b61016b6004803603602081101561023657600080fd5b50356110b6565b61012b6004803603602081101561025357600080fd5b50356001600160a01b03166115f0565b61012b6004803603602081101561027957600080fd5b50356001600160a01b03166117fb565b61012b611866565b61012b600480360360208110156102a757600080fd5b50356001600160a01b0316611896565b61012b600480360360208110156102cd57600080fd5b50356001600160a01b03166119af565b61016b600480360360408110156102f357600080fd5b506001600160a01b038135169060200135611a14565b61012b6004803603602081101561031f57600080fd5b50356001600160a01b0316611deb565b61012b6004803603602081101561034557600080fd5b50356001600160a01b0316612000565b6000806103966040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006103d86040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561041557600080fd5b505afa158015610429573d6000803e3d6000fd5b505050506040513d602081101561043f57600080fd5b50519050600061044e86611896565b90506104c8846001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b15801561048c57600080fd5b505afa1580156104a0573d6000803e3d6000fd5b505050506040513d60208110156104b657600080fd5b50516104c2838561234a565b906123aa565b9450505050505b919050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306105c78260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083835b6020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120612411565b6001600160a01b0316816001600160a01b03161461062c576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f90930190935281519101206106859061249d565b6106d6576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208083019190915233606090811b603684015288901b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604a8301528251808303603e018152605e909201909252805191012061075a90856124f7565b60408051851515815242602082015281516001600160a01b0388169233927fb8502fe170368d1312ca3c9feac7aba9cd92406753d7eca9f11df9757081aec5929081900390910190a35050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152503061085c8260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b0316146108c1576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6d696e69706f6f6c2e657869737473000000000000000000000000000000000060208083019190915233606081901b602f840152835160238185030181526043909301909352815191012061091a9061249d565b61096b576040805162461bcd60e51b815260206004820152601060248201527f496e76616c6964206d696e69706f6f6c00000000000000000000000000000000604482015290519081900360640190fd5b60006109ab6040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006109ed6040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b90506000610a6b836001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2d57600080fd5b505afa158015610a41573d6000803e3d6000fd5b505050506040513d6020811015610a5757600080fd5b50516104c2670de0b6b3a76400008a61234a565b90506000610a78896117fb565b905080821115610a86578091505b8115610b8b57826001600160a01b031663ee91035e610ad96040518060400160405280600e81526020017f726f636b6574546f6b656e52504c00000000000000000000000000000000000081525061226f565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660248301526044820186905260606004830152601460648301527f726f636b657441756374696f6e4d616e6167657200000000000000000000000060848301525160a480830192600092919082900301818387803b158015610b7257600080fd5b505af1158015610b86573d6000803e3d6000fd5b505050505b610b9482612580565b610b9e89836125ad565b604080517f6d696e69706f6f6c2e72706c2e736c61736865640000000000000000000000006020808301919091523360601b60348301528251602881840301815260489092019092528051910120610bf79060016124f7565b60408051838152602081018a9052428183015290516001600160a01b038b16917f38a2777b6a84fdb3fc375fe8ade69fdad1afdcdd93c79e7ae2319b806a626c4d919081900360600190a2505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030610cff8260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b031614610d64576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f9093019093528151910120610dbd9061249d565b610e0e576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b610e183385612615565b50505050565b600080610e5f6040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b90506000610ea16040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ede57600080fd5b505afa158015610ef2573d6000803e3d6000fd5b505050506040513d6020811015610f0857600080fd5b5051604080517f724d4a090000000000000000000000000000000000000000000000000000000081529051919250610fab9183916104c2916001600160a01b0388169163724d4a09916004808301926020929190829003018186803b158015610f7057600080fd5b505afa158015610f84573d6000803e3d6000fd5b505050506040513d6020811015610f9a57600080fd5b5051610fa5896117fb565b9061234a565b95945050505050565b600080610ff56040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006110376040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316631e72ba866040518163ffffffff1660e01b815260040160206040518083038186803b15801561107457600080fd5b505afa158015611088573d6000803e3d6000fd5b505050506040513d602081101561109e57600080fd5b50519050600061044e86611deb565b60005460ff1681565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306111688260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b0316146111cd576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f90930190935281519101206112269061249d565b611277576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b60006112b76040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e67735265776172647381525061226f565b905060006112f96040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b9050816001600160a01b03166394e5d5126040518163ffffffff1660e01b815260040160206040518083038186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d602081101561135e57600080fd5b505161137361136c336119af565b4290612950565b10156113b05760405162461bcd60e51b815260040180806020018281038252602d815260200180612c3e602d913960400191505060405180910390fd5b60006113bb336117fb565b9050868110156113fc5760405162461bcd60e51b8152600401808060200182810382526033815260200180612d426033913960400191505060405180910390fd5b61140533610fb4565b61140f8289612950565b101561144c5760405162461bcd60e51b8152600401808060200182810382526048815260200180612cb86048913960600191505060405180910390fd5b61145587612580565b61145f33886125ad565b600054604080517f5b49ff6200000000000000000000000000000000000000000000000000000000815233600482015290516001600160a01b03808616936301e336679361010090910490911691635b49ff6291602480820192602092909190829003018186803b1580156114d357600080fd5b505afa1580156114e7573d6000803e3d6000fd5b505050506040513d60208110156114fd57600080fd5b505160408051808201909152600e81527f726f636b6574546f6b656e52504c000000000000000000000000000000000000602082015261153c9061226f565b8a6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b5050604080518a815242602082015281513394507f9947063f70b076145616018b82ed1dd5585e15b7ae0a0b17a8b06bec4c4c31e293509081900390910190a250505050505050565b6000806116568360405160200180807f6574682e6d6174636865642e6e6f64652e616d6f756e74000000000000000000815250601701826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b90508061167857611670670de0b6b3a7640000600261234a565b9150506104cf565b600061169b604051806060016040528060218152602001612d006021913961226f565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b1580156116d857600080fd5b505afa1580156116ec573d6000803e3d6000fd5b505050506040513d602081101561170257600080fd5b505160408051808201909152601581527f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000060208201529091506000906117479061226f565b905060006117ce83836001600160a01b0316631844ec018a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179c57600080fd5b505afa1580156117b0573d6000803e3d6000fd5b505050506040513d60208110156117c657600080fd5b50519061234a565b90506117ef6117dd8287612950565b6104c283670de0b6b3a764000061234a565b955050505050506104cf565b60006118608260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b92915050565b60006118917fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a3066129ad565b905090565b6000806118fc8360405160200180807f6574682e6d6174636865642e6e6f64652e616d6f756e74000000000000000000815250601701826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b9050801561190b5790506104cf565b600061194b6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525061226f565b90506119a667de0b6b3a76400000826001600160a01b0316631844ec01876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179c57600080fd5b925050506104cf565b60006118608260405160200180807f72706c2e7374616b65642e6e6f64652e74696d65000000000000000000000000815250601401826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030611ac68260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b031614611b2b576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b83611b8f8160405160200180807f6e6f64652e657869737473000000000000000000000000000000000000000000815250600b01826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012061249d565b611be0576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b611c5760405160200180807f636f6e74726163742e6164647265737300000000000000000000000000000000815250601001807f726f636b65744d65726b6c654469737472696275746f724d61696e6e65740000815250601e01905060405160208183030381529060405280519060200120612411565b6001600160a01b0316336001600160a01b031614611dda5760008060019054906101000a90046001600160a01b03166001600160a01b0316635b49ff62876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611cd257600080fd5b505afa158015611ce6573d6000803e3d6000fd5b505050506040513d6020811015611cfc57600080fd5b50519050336001600160a01b03821614611dd857611d87863360405160200180807f6e6f64652e7374616b652e666f722e616c6c6f77656400000000000000000000815250601601836001600160a01b031660601b8152601401826001600160a01b031660601b8152601401925050506040516020818303038152906040528051906020012061249d565b611dd8576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420616c6c6f77656420746f207374616b6520666f720000000000000000604482015290519081900360640190fd5b505b611de48585612615565b5050505050565b600080611e2c6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525061226f565b90506000816001600160a01b0316631844ec01856040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611e7d57600080fd5b505afa158015611e91573d6000803e3d6000fd5b505050506040513d6020811015611ea757600080fd5b5051604080517f6574682e6d6174636865642e6e6f64652e616d6f756e740000000000000000006020828101919091527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b1660378301528251602b818403018152604b9092019092528051910120909150600090611f29906129ad565b90508015611fe4576000611f54604051806060016040528060218152602001612d006021913961226f565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9157600080fd5b505afa158015611fa5573d6000803e3d6000fd5b505050506040513d6020811015611fbb57600080fd5b505190506000611fcb858361234a565b9050611fd78185612950565b96505050505050506104cf565b611ff68267de0b6b3a7640000061234a565b93505050506104cf565b6000806120416040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006120836040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000612090856117fb565b9050600061209d86611896565b905060006120aa87611deb565b90506000856001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e757600080fd5b505afa1580156120fb573d6000803e3d6000fd5b505050506040513d602081101561211157600080fd5b5051604080517f1e72ba8600000000000000000000000000000000000000000000000000000000815290519192506000916001600160a01b03881691631e72ba86916004808301926020929190829003018186803b15801561217257600080fd5b505afa158015612186573d6000803e3d6000fd5b505050506040513d602081101561219c57600080fd5b5051905060006121b0836104c2868561234a565b9050808611156121c95797506104cf9650505050505050565b6000876001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561220457600080fd5b505afa158015612218573d6000803e3d6000fd5b505050506040513d602081101561222e57600080fd5b505190506000612242856104c2898561234a565b90508088101561225f5760009a50505050505050505050506104cf565b50959a9950505050505050505050565b6000806122ed8360405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b90506001600160a01b038116611860576040805162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e640000000000000000000000000000604482015290519081900360640190fd5b60008261235957506000611860565b8282028284828161236657fe5b04146123a35760405162461bcd60e51b8152600401808060200182810382526021815260200180612d216021913960400191505060405180910390fd5b9392505050565b6000808211612400576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161240957fe5b049392505050565b60008060019054906101000a90046001600160a01b03166001600160a01b03166321f8a721836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b505afa15801561247f573d6000803e3d6000fd5b505050506040513d602081101561249557600080fd5b505192915050565b60008060019054906101000a90046001600160a01b03166001600160a01b0316637ae1cfca836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b60008054604080517fabfdcced00000000000000000000000000000000000000000000000000000000815260048101869052841515602482015290516101009092046001600160a01b03169263abfdcced9260448084019382900301818387803b15801561256457600080fd5b505af1158015612578573d6000803e3d6000fd5b505050505050565b6125aa7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682612a07565b50565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612a07565b5050565b60006126556040518060400160405280600e81526020017f726f636b6574546f6b656e52504c00000000000000000000000000000000000081525061226f565b905060006126976040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051919250839183916001600160a01b038416916323b872dd916064808201926020929091908290030181600087803b15801561270d57600080fd5b505af1158015612721573d6000803e3d6000fd5b505050506040513d602081101561273757600080fd5b50516127745760405162461bcd60e51b815260040180806020018281038252602a815260200180612c6b602a913960400191505060405180910390fd5b816001600160a01b031663095ea7b384876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156127cb57600080fd5b505af11580156127df573d6000803e3d6000fd5b505050506040513d60208110156127f557600080fd5b50516128325760405162461bcd60e51b8152600401808060200182810382526023815260200180612c956023913960400191505060405180910390fd5b604080517ff44429580000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660248301526044820188905260606004830152601160648301527f726f636b65744e6f64655374616b696e67000000000000000000000000000000608483015291519183169163f44429589160a48082019260009290919082900301818387803b1580156128d157600080fd5b505af11580156128e5573d6000803e3d6000fd5b505050506128f285612a73565b6128fc8686612a9d565b6129068642612b01565b6040805186815242602082015281516001600160a01b038916927f4e3bcb61bb8e63cb9ed2c46d47eeb6ae847c629e909fbb32b9d17874affb4a89928290030190a2505050505050565b6000828211156129a7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060019054906101000a90046001600160a01b03166001600160a01b031663bd02d0f5836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b60008054604080517febb9d8c9000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263ebb9d8c99260448084019382900301818387803b15801561256457600080fd5b6125aa7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682612b65565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612b65565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e74696d65000000000000000000000000815250601401826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612bd1565b60008054604080517fadb353dc000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263adb353dc9260448084019382900301818387803b15801561256457600080fd5b60008054604080517fe2a4853a000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263e2a4853a9260448084019382900301818387803b15801561256457600080fdfe546865207769746864726177616c20636f6f6c646f776e20706572696f6420686173206e6f7420706173736564436f756c64206e6f74207472616e736665722052504c20746f207374616b696e6720636f6e7472616374436f756c64206e6f7420617070726f7665207661756c742052504c206465706f7369744e6f64652773207374616b65642052504c2062616c616e6365206166746572207769746864726177616c206973206c657373207468616e2072657175697265642062616c616e6365726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775769746864726177616c20616d6f756e742065786365656473206e6f64652773207374616b65642052504c2062616c616e6365a2646970667358221220ea7566008ed382e190ca4b3b4576be9d43219c2373d3a270ff84e8ac952cfc6d64736f6c634300070600330000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c806397be214311610097578063c0d05dd811610066578063c0d05dd8146102b7578063cb1c8321146102dd578063e5e82b7c14610309578063f0d19b891461032f57610100565b806397be21431461023d5780639961cee4146102635780639a206c8e14610289578063a493e6a21461029157610100565b806348aeedf5116100d357806348aeedf5146101b65780634e58ff6e146101dc57806354fd4d50146102025780636b088d5c1461022057610100565b806303fa87b414610105578063088903a41461013d578063245395a61461016d5780633e200d4b14610199575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610355565b60408051918252519081900360200190f35b61016b6004803603604081101561015357600080fd5b506001600160a01b03813516906020013515156104d4565b005b61016b6004803603604081101561018357600080fd5b506001600160a01b0381351690602001356107aa565b61016b600480360360208110156101af57600080fd5b5035610c4d565b61012b600480360360208110156101cc57600080fd5b50356001600160a01b0316610e1e565b61012b600480360360208110156101f257600080fd5b50356001600160a01b0316610fb4565b61020a6110ad565b6040805160ff9092168252519081900360200190f35b61016b6004803603602081101561023657600080fd5b50356110b6565b61012b6004803603602081101561025357600080fd5b50356001600160a01b03166115f0565b61012b6004803603602081101561027957600080fd5b50356001600160a01b03166117fb565b61012b611866565b61012b600480360360208110156102a757600080fd5b50356001600160a01b0316611896565b61012b600480360360208110156102cd57600080fd5b50356001600160a01b03166119af565b61016b600480360360408110156102f357600080fd5b506001600160a01b038135169060200135611a14565b61012b6004803603602081101561031f57600080fd5b50356001600160a01b0316611deb565b61012b6004803603602081101561034557600080fd5b50356001600160a01b0316612000565b6000806103966040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006103d86040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561041557600080fd5b505afa158015610429573d6000803e3d6000fd5b505050506040513d602081101561043f57600080fd5b50519050600061044e86611896565b90506104c8846001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b15801561048c57600080fd5b505afa1580156104a0573d6000803e3d6000fd5b505050506040513d60208110156104b657600080fd5b50516104c2838561234a565b906123aa565b9450505050505b919050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306105c78260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083835b6020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120612411565b6001600160a01b0316816001600160a01b03161461062c576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f90930190935281519101206106859061249d565b6106d6576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208083019190915233606090811b603684015288901b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604a8301528251808303603e018152605e909201909252805191012061075a90856124f7565b60408051851515815242602082015281516001600160a01b0388169233927fb8502fe170368d1312ca3c9feac7aba9cd92406753d7eca9f11df9757081aec5929081900390910190a35050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e670000000000000000000000000000008152503061085c8260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b0316146108c1576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6d696e69706f6f6c2e657869737473000000000000000000000000000000000060208083019190915233606081901b602f840152835160238185030181526043909301909352815191012061091a9061249d565b61096b576040805162461bcd60e51b815260206004820152601060248201527f496e76616c6964206d696e69706f6f6c00000000000000000000000000000000604482015290519081900360640190fd5b60006109ab6040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006109ed6040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b90506000610a6b836001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2d57600080fd5b505afa158015610a41573d6000803e3d6000fd5b505050506040513d6020811015610a5757600080fd5b50516104c2670de0b6b3a76400008a61234a565b90506000610a78896117fb565b905080821115610a86578091505b8115610b8b57826001600160a01b031663ee91035e610ad96040518060400160405280600e81526020017f726f636b6574546f6b656e52504c00000000000000000000000000000000000081525061226f565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660248301526044820186905260606004830152601460648301527f726f636b657441756374696f6e4d616e6167657200000000000000000000000060848301525160a480830192600092919082900301818387803b158015610b7257600080fd5b505af1158015610b86573d6000803e3d6000fd5b505050505b610b9482612580565b610b9e89836125ad565b604080517f6d696e69706f6f6c2e72706c2e736c61736865640000000000000000000000006020808301919091523360601b60348301528251602881840301815260489092019092528051910120610bf79060016124f7565b60408051838152602081018a9052428183015290516001600160a01b038b16917f38a2777b6a84fdb3fc375fe8ade69fdad1afdcdd93c79e7ae2319b806a626c4d919081900360600190a2505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030610cff8260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b031614610d64576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f9093019093528151910120610dbd9061249d565b610e0e576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b610e183385612615565b50505050565b600080610e5f6040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b90506000610ea16040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ede57600080fd5b505afa158015610ef2573d6000803e3d6000fd5b505050506040513d6020811015610f0857600080fd5b5051604080517f724d4a090000000000000000000000000000000000000000000000000000000081529051919250610fab9183916104c2916001600160a01b0388169163724d4a09916004808301926020929190829003018186803b158015610f7057600080fd5b505afa158015610f84573d6000803e3d6000fd5b505050506040513d6020811015610f9a57600080fd5b5051610fa5896117fb565b9061234a565b95945050505050565b600080610ff56040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006110376040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000816001600160a01b0316631e72ba866040518163ffffffff1660e01b815260040160206040518083038186803b15801561107457600080fd5b505afa158015611088573d6000803e3d6000fd5b505050506040513d602081101561109e57600080fd5b50519050600061044e86611deb565b60005460ff1681565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306111688260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b0316146111cd576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b604080517f6e6f64652e65786973747300000000000000000000000000000000000000000060208083019190915233606081901b602b8401528351601f818503018152603f90930190935281519101206112269061249d565b611277576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b60006112b76040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e67735265776172647381525061226f565b905060006112f96040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b9050816001600160a01b03166394e5d5126040518163ffffffff1660e01b815260040160206040518083038186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d602081101561135e57600080fd5b505161137361136c336119af565b4290612950565b10156113b05760405162461bcd60e51b815260040180806020018281038252602d815260200180612c3e602d913960400191505060405180910390fd5b60006113bb336117fb565b9050868110156113fc5760405162461bcd60e51b8152600401808060200182810382526033815260200180612d426033913960400191505060405180910390fd5b61140533610fb4565b61140f8289612950565b101561144c5760405162461bcd60e51b8152600401808060200182810382526048815260200180612cb86048913960600191505060405180910390fd5b61145587612580565b61145f33886125ad565b600054604080517f5b49ff6200000000000000000000000000000000000000000000000000000000815233600482015290516001600160a01b03808616936301e336679361010090910490911691635b49ff6291602480820192602092909190829003018186803b1580156114d357600080fd5b505afa1580156114e7573d6000803e3d6000fd5b505050506040513d60208110156114fd57600080fd5b505160408051808201909152600e81527f726f636b6574546f6b656e52504c000000000000000000000000000000000000602082015261153c9061226f565b8a6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b5050604080518a815242602082015281513394507f9947063f70b076145616018b82ed1dd5585e15b7ae0a0b17a8b06bec4c4c31e293509081900390910190a250505050505050565b6000806116568360405160200180807f6574682e6d6174636865642e6e6f64652e616d6f756e74000000000000000000815250601701826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b90508061167857611670670de0b6b3a7640000600261234a565b9150506104cf565b600061169b604051806060016040528060218152602001612d006021913961226f565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b1580156116d857600080fd5b505afa1580156116ec573d6000803e3d6000fd5b505050506040513d602081101561170257600080fd5b505160408051808201909152601581527f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000060208201529091506000906117479061226f565b905060006117ce83836001600160a01b0316631844ec018a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179c57600080fd5b505afa1580156117b0573d6000803e3d6000fd5b505050506040513d60208110156117c657600080fd5b50519061234a565b90506117ef6117dd8287612950565b6104c283670de0b6b3a764000061234a565b955050505050506104cf565b60006118608260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b92915050565b60006118917fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a3066129ad565b905090565b6000806118fc8360405160200180807f6574682e6d6174636865642e6e6f64652e616d6f756e74000000000000000000815250601701826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b9050801561190b5790506104cf565b600061194b6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525061226f565b90506119a667de0b6b3a76400000826001600160a01b0316631844ec01876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561179c57600080fd5b925050506104cf565b60006118608260405160200180807f72706c2e7374616b65642e6e6f64652e74696d65000000000000000000000000815250601401826001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206129ad565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030611ac68260405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b6001600160a01b0316816001600160a01b031614611b2b576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b83611b8f8160405160200180807f6e6f64652e657869737473000000000000000000000000000000000000000000815250600b01826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012061249d565b611be0576040805162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f64650000000000000000000000000000000000000000604482015290519081900360640190fd5b611c5760405160200180807f636f6e74726163742e6164647265737300000000000000000000000000000000815250601001807f726f636b65744d65726b6c654469737472696275746f724d61696e6e65740000815250601e01905060405160208183030381529060405280519060200120612411565b6001600160a01b0316336001600160a01b031614611dda5760008060019054906101000a90046001600160a01b03166001600160a01b0316635b49ff62876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611cd257600080fd5b505afa158015611ce6573d6000803e3d6000fd5b505050506040513d6020811015611cfc57600080fd5b50519050336001600160a01b03821614611dd857611d87863360405160200180807f6e6f64652e7374616b652e666f722e616c6c6f77656400000000000000000000815250601601836001600160a01b031660601b8152601401826001600160a01b031660601b8152601401925050506040516020818303038152906040528051906020012061249d565b611dd8576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420616c6c6f77656420746f207374616b6520666f720000000000000000604482015290519081900360640190fd5b505b611de48585612615565b5050505050565b600080611e2c6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e61676572000000000000000000000081525061226f565b90506000816001600160a01b0316631844ec01856040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611e7d57600080fd5b505afa158015611e91573d6000803e3d6000fd5b505050506040513d6020811015611ea757600080fd5b5051604080517f6574682e6d6174636865642e6e6f64652e616d6f756e740000000000000000006020828101919091527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b1660378301528251602b818403018152604b9092019092528051910120909150600090611f29906129ad565b90508015611fe4576000611f54604051806060016040528060218152602001612d006021913961226f565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9157600080fd5b505afa158015611fa5573d6000803e3d6000fd5b505050506040513d6020811015611fbb57600080fd5b505190506000611fcb858361234a565b9050611fd78185612950565b96505050505050506104cf565b611ff68267de0b6b3a7640000061234a565b93505050506104cf565b6000806120416040518060400160405280601381526020017f726f636b65744e6574776f726b5072696365730000000000000000000000000081525061226f565b905060006120836040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f646500000081525061226f565b90506000612090856117fb565b9050600061209d86611896565b905060006120aa87611deb565b90506000856001600160a01b031663724d4a096040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e757600080fd5b505afa1580156120fb573d6000803e3d6000fd5b505050506040513d602081101561211157600080fd5b5051604080517f1e72ba8600000000000000000000000000000000000000000000000000000000815290519192506000916001600160a01b03881691631e72ba86916004808301926020929190829003018186803b15801561217257600080fd5b505afa158015612186573d6000803e3d6000fd5b505050506040513d602081101561219c57600080fd5b5051905060006121b0836104c2868561234a565b9050808611156121c95797506104cf9650505050505050565b6000876001600160a01b0316636fdbe57b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561220457600080fd5b505afa158015612218573d6000803e3d6000fd5b505050506040513d602081101561222e57600080fd5b505190506000612242856104c2898561234a565b90508088101561225f5760009a50505050505050505050506104cf565b50959a9950505050505050505050565b6000806122ed8360405160200180807f636f6e74726163742e616464726573730000000000000000000000000000000081525060100182805190602001908083836020831061058757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161054a565b90506001600160a01b038116611860576040805162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e640000000000000000000000000000604482015290519081900360640190fd5b60008261235957506000611860565b8282028284828161236657fe5b04146123a35760405162461bcd60e51b8152600401808060200182810382526021815260200180612d216021913960400191505060405180910390fd5b9392505050565b6000808211612400576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161240957fe5b049392505050565b60008060019054906101000a90046001600160a01b03166001600160a01b03166321f8a721836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b505afa15801561247f573d6000803e3d6000fd5b505050506040513d602081101561249557600080fd5b505192915050565b60008060019054906101000a90046001600160a01b03166001600160a01b0316637ae1cfca836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b60008054604080517fabfdcced00000000000000000000000000000000000000000000000000000000815260048101869052841515602482015290516101009092046001600160a01b03169263abfdcced9260448084019382900301818387803b15801561256457600080fd5b505af1158015612578573d6000803e3d6000fd5b505050505050565b6125aa7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682612a07565b50565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612a07565b5050565b60006126556040518060400160405280600e81526020017f726f636b6574546f6b656e52504c00000000000000000000000000000000000081525061226f565b905060006126976040518060400160405280600b81526020017f726f636b65745661756c7400000000000000000000000000000000000000000081525061226f565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051919250839183916001600160a01b038416916323b872dd916064808201926020929091908290030181600087803b15801561270d57600080fd5b505af1158015612721573d6000803e3d6000fd5b505050506040513d602081101561273757600080fd5b50516127745760405162461bcd60e51b815260040180806020018281038252602a815260200180612c6b602a913960400191505060405180910390fd5b816001600160a01b031663095ea7b384876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156127cb57600080fd5b505af11580156127df573d6000803e3d6000fd5b505050506040513d60208110156127f557600080fd5b50516128325760405162461bcd60e51b8152600401808060200182810382526023815260200180612c956023913960400191505060405180910390fd5b604080517ff44429580000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660248301526044820188905260606004830152601160648301527f726f636b65744e6f64655374616b696e67000000000000000000000000000000608483015291519183169163f44429589160a48082019260009290919082900301818387803b1580156128d157600080fd5b505af11580156128e5573d6000803e3d6000fd5b505050506128f285612a73565b6128fc8686612a9d565b6129068642612b01565b6040805186815242602082015281516001600160a01b038916927f4e3bcb61bb8e63cb9ed2c46d47eeb6ae847c629e909fbb32b9d17874affb4a89928290030190a2505050505050565b6000828211156129a7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060019054906101000a90046001600160a01b03166001600160a01b031663bd02d0f5836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561246b57600080fd5b60008054604080517febb9d8c9000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263ebb9d8c99260448084019382900301818387803b15801561256457600080fd5b6125aa7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682612b65565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e616d6f756e7400000000000000000000815250601601826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612b65565b6126118260405160200180807f72706c2e7374616b65642e6e6f64652e74696d65000000000000000000000000815250601401826001600160a01b031660601b81526014019150506040516020818303038152906040528051906020012082612bd1565b60008054604080517fadb353dc000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263adb353dc9260448084019382900301818387803b15801561256457600080fd5b60008054604080517fe2a4853a000000000000000000000000000000000000000000000000000000008152600481018690526024810185905290516101009092046001600160a01b03169263e2a4853a9260448084019382900301818387803b15801561256457600080fdfe546865207769746864726177616c20636f6f6c646f776e20706572696f6420686173206e6f7420706173736564436f756c64206e6f74207472616e736665722052504c20746f207374616b696e6720636f6e7472616374436f756c64206e6f7420617070726f7665207661756c742052504c206465706f7369744e6f64652773207374616b65642052504c2062616c616e6365206166746572207769746864726177616c206973206c657373207468616e2072657175697265642062616c616e6365726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775769746864726177616c20616d6f756e742065786365656473206e6f64652773207374616b65642052504c2062616c616e6365a2646970667358221220ea7566008ed382e190ca4b3b4576be9d43219c2373d3a270ff84e8ac952cfc6d64736f6c63430007060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46

-----Decoded View---------------
Arg [0] : _rocketStorageAddress (address): 0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46


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.