creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "/contracts/contract/RocketBase.sol": {
        "content": "/**\r\n  *       .\r\n  *      / \\\r\n  *     |.'.|\r\n  *     |'.'|\r\n  *   ,'|   |`.\r\n  *  |,-'-|-'-.|\r\n  *   __|_| |         _        _      _____           _\r\n  *  | ___ \\|        | |      | |    | ___ \\         | |\r\n  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |\r\n  *  |    // _ \\ / __| |/ / _ \\ __|  |  __/ _ \\ / _ \\| |\r\n  *  | |\\ \\ (_) | (__|   <  __/ |_   | | | (_) | (_) | |\r\n  *  \\_| \\_\\___/ \\___|_|\\_\\___|\\__|  \\_|  \\___/ \\___/|_|\r\n  * +---------------------------------------------------+\r\n  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |\r\n  * +---------------------------------------------------+\r\n  *\r\n  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,\r\n  *  decentralised, trustless and compatible with staking in Ethereum 2.0.\r\n  *\r\n  *  For more information about Rocket Pool, visit https://rocketpool.net\r\n  *\r\n  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty\r\n  *\r\n  */\r\n\r\npragma solidity 0.7.6;\n\n// SPDX-License-Identifier: GPL-3.0-only\n\nimport \"../interface/RocketStorageInterface.sol\";\n\n/// @title Base settings / modifiers for each contract in Rocket Pool\n/// @author David Rugendyke\n\nabstract contract RocketBase {\n\n    // Calculate using this as the base\n    uint256 constant calcBase = 1 ether;\n\n    // Version of the contract\n    uint8 public version;\n\n    // The main storage contract where primary persistant storage is maintained\n    RocketStorageInterface rocketStorage = RocketStorageInterface(0);\n\n\n    /*** Modifiers **********************************************************/\n\n    /**\n    * @dev Throws if called by any sender that doesn't match a Rocket Pool network contract\n    */\n    modifier onlyLatestNetworkContract() {\n        require(getBool(keccak256(abi.encodePacked(\"contract.exists\", msg.sender))), \"Invalid or outdated network contract\");\n        _;\n    }\n\n    /**\n    * @dev Throws if called by any sender that doesn't match one of the supplied contract or is the latest version of that contract\n    */\n    modifier onlyLatestContract(string memory _contractName, address _contractAddress) {\n        require(_contractAddress == getAddress(keccak256(abi.encodePacked(\"contract.address\", _contractName))), \"Invalid or outdated contract\");\n        _;\n    }\n\n    /**\n    * @dev Throws if called by any sender that isn't a registered node\n    */\n    modifier onlyRegisteredNode(address _nodeAddress) {\n        require(getBool(keccak256(abi.encodePacked(\"node.exists\", _nodeAddress))), \"Invalid node\");\n        _;\n    }\n\n    /**\n    * @dev Throws if called by any sender that isn't a trusted node DAO member\n    */\n    modifier onlyTrustedNode(address _nodeAddress) {\n        require(getBool(keccak256(abi.encodePacked(\"dao.trustednodes.\", \"member\", _nodeAddress))), \"Invalid trusted node\");\n        _;\n    }\n\n    /**\n    * @dev Throws if called by any sender that isn't a registered minipool\n    */\n    modifier onlyRegisteredMinipool(address _minipoolAddress) {\n        require(getBool(keccak256(abi.encodePacked(\"minipool.exists\", _minipoolAddress))), \"Invalid minipool\");\n        _;\n    }\n    \n\n    /**\n    * @dev Throws if called by any account other than a guardian account (temporary account allowed access to settings before DAO is fully enabled)\n    */\n    modifier onlyGuardian() {\n        require(msg.sender == rocketStorage.getGuardian(), \"Account is not a temporary guardian\");\n        _;\n    }\n\n\n\n\n    /*** Methods **********************************************************/\n\n    /// @dev Set the main Rocket Storage address\n    constructor(RocketStorageInterface _rocketStorageAddress) {\n        // Update the contract address\n        rocketStorage = RocketStorageInterface(_rocketStorageAddress);\n    }\n\n\n    /// @dev Get the address of a network contract by name\n    function getContractAddress(string memory _contractName) internal view returns (address) {\n        // Get the current contract address\n        address contractAddress = getAddress(keccak256(abi.encodePacked(\"contract.address\", _contractName)));\n        // Check it\n        require(contractAddress != address(0x0), \"Contract not found\");\n        // Return\n        return contractAddress;\n    }\n\n\n    /// @dev Get the address of a network contract by name (returns address(0x0) instead of reverting if contract does not exist)\n    function getContractAddressUnsafe(string memory _contractName) internal view returns (address) {\n        // Get the current contract address\n        address contractAddress = getAddress(keccak256(abi.encodePacked(\"contract.address\", _contractName)));\n        // Return\n        return contractAddress;\n    }\n\n\n    /// @dev Get the name of a network contract by address\n    function getContractName(address _contractAddress) internal view returns (string memory) {\n        // Get the contract name\n        string memory contractName = getString(keccak256(abi.encodePacked(\"contract.name\", _contractAddress)));\n        // Check it\n        require(bytes(contractName).length > 0, \"Contract not found\");\n        // Return\n        return contractName;\n    }\n\n    /// @dev Get revert error message from a .call method\n    function getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {\n        // If the _res length is less than 68, then the transaction failed silently (without a revert message)\n        if (_returnData.length < 68) return \"Transaction reverted silently\";\n        assembly {\n            // Slice the sighash.\n            _returnData := add(_returnData, 0x04)\n        }\n        return abi.decode(_returnData, (string)); // All that remains is the revert string\n    }\n\n\n\n    /*** Rocket Storage Methods ****************************************/\n\n    // Note: Unused helpers have been removed to keep contract sizes down\n\n    /// @dev Storage get methods\n    function getAddress(bytes32 _key) internal view returns (address) { return rocketStorage.getAddress(_key); }\n    function getUint(bytes32 _key) internal view returns (uint) { return rocketStorage.getUint(_key); }\n    function getString(bytes32 _key) internal view returns (string memory) { return rocketStorage.getString(_key); }\n    function getBytes(bytes32 _key) internal view returns (bytes memory) { return rocketStorage.getBytes(_key); }\n    function getBool(bytes32 _key) internal view returns (bool) { return rocketStorage.getBool(_key); }\n    function getInt(bytes32 _key) internal view returns (int) { return rocketStorage.getInt(_key); }\n    function getBytes32(bytes32 _key) internal view returns (bytes32) { return rocketStorage.getBytes32(_key); }\n\n    /// @dev Storage set methods\n    function setAddress(bytes32 _key, address _value) internal { rocketStorage.setAddress(_key, _value); }\n    function setUint(bytes32 _key, uint _value) internal { rocketStorage.setUint(_key, _value); }\n    function setString(bytes32 _key, string memory _value) internal { rocketStorage.setString(_key, _value); }\n    function setBytes(bytes32 _key, bytes memory _value) internal { rocketStorage.setBytes(_key, _value); }\n    function setBool(bytes32 _key, bool _value) internal { rocketStorage.setBool(_key, _value); }\n    function setInt(bytes32 _key, int _value) internal { rocketStorage.setInt(_key, _value); }\n    function setBytes32(bytes32 _key, bytes32 _value) internal { rocketStorage.setBytes32(_key, _value); }\n\n    /// @dev Storage delete methods\n    function deleteAddress(bytes32 _key) internal { rocketStorage.deleteAddress(_key); }\n    function deleteUint(bytes32 _key) internal { rocketStorage.deleteUint(_key); }\n    function deleteString(bytes32 _key) internal { rocketStorage.deleteString(_key); }\n    function deleteBytes(bytes32 _key) internal { rocketStorage.deleteBytes(_key); }\n    function deleteBool(bytes32 _key) internal { rocketStorage.deleteBool(_key); }\n    function deleteInt(bytes32 _key) internal { rocketStorage.deleteInt(_key); }\n    function deleteBytes32(bytes32 _key) internal { rocketStorage.deleteBytes32(_key); }\n\n    /// @dev Storage arithmetic methods\n    function addUint(bytes32 _key, uint256 _amount) internal { rocketStorage.addUint(_key, _amount); }\n    function subUint(bytes32 _key, uint256 _amount) internal { rocketStorage.subUint(_key, _amount); }\n}\n"
      },
      "/contracts/contract/node/RocketNodeDistributor.sol": {
        "content": "/**\r\n  *       .\r\n  *      / \\\r\n  *     |.'.|\r\n  *     |'.'|\r\n  *   ,'|   |`.\r\n  *  |,-'-|-'-.|\r\n  *   __|_| |         _        _      _____           _\r\n  *  | ___ \\|        | |      | |    | ___ \\         | |\r\n  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |\r\n  *  |    // _ \\ / __| |/ / _ \\ __|  |  __/ _ \\ / _ \\| |\r\n  *  | |\\ \\ (_) | (__|   <  __/ |_   | | | (_) | (_) | |\r\n  *  \\_| \\_\\___/ \\___|_|\\_\\___|\\__|  \\_|  \\___/ \\___/|_|\r\n  * +---------------------------------------------------+\r\n  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |\r\n  * +---------------------------------------------------+\r\n  *\r\n  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,\r\n  *  decentralised, trustless and compatible with staking in Ethereum 2.0.\r\n  *\r\n  *  For more information about Rocket Pool, visit https://rocketpool.net\r\n  *\r\n  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty\r\n  *\r\n  */\r\n\r\npragma solidity 0.7.6;\r\n\r\n// SPDX-License-Identifier: GPL-3.0-only\r\n\r\nimport \"../RocketBase.sol\";\r\nimport \"./RocketNodeDistributorStorageLayout.sol\";\r\n\r\ncontract RocketNodeDistributor is RocketNodeDistributorStorageLayout {\r\n    bytes32 immutable distributorStorageKey;\r\n\r\n    constructor(address _nodeAddress, address _rocketStorage) {\r\n        rocketStorage = RocketStorageInterface(_rocketStorage);\r\n        nodeAddress = _nodeAddress;\r\n\r\n        // Precompute storage key for rocketNodeDistributorDelegate\r\n        distributorStorageKey = keccak256(abi.encodePacked(\"contract.address\", \"rocketNodeDistributorDelegate\"));\r\n    }\r\n\r\n    // Allow contract to receive ETH without making a delegated call\r\n    receive() external payable {}\r\n\r\n    // Delegates all transactions to the target supplied during creation\r\n    fallback() external payable {\r\n        address _target = rocketStorage.getAddress(distributorStorageKey);\r\n        assembly {\r\n            calldatacopy(0x0, 0x0, calldatasize())\r\n            let result := delegatecall(gas(), _target, 0x0, calldatasize(), 0x0, 0)\r\n            returndatacopy(0x0, 0x0, returndatasize())\r\n            switch result case 0 {revert(0, returndatasize())} default {return (0, returndatasize())}\r\n        }\r\n    }\r\n}\r\n"
      },
      "/contracts/contract/node/RocketNodeDistributorStorageLayout.sol": {
        "content": "/**\r\n  *       .\r\n  *      / \\\r\n  *     |.'.|\r\n  *     |'.'|\r\n  *   ,'|   |`.\r\n  *  |,-'-|-'-.|\r\n  *   __|_| |         _        _      _____           _\r\n  *  | ___ \\|        | |      | |    | ___ \\         | |\r\n  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |\r\n  *  |    // _ \\ / __| |/ / _ \\ __|  |  __/ _ \\ / _ \\| |\r\n  *  | |\\ \\ (_) | (__|   <  __/ |_   | | | (_) | (_) | |\r\n  *  \\_| \\_\\___/ \\___|_|\\_\\___|\\__|  \\_|  \\___/ \\___/|_|\r\n  * +---------------------------------------------------+\r\n  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |\r\n  * +---------------------------------------------------+\r\n  *\r\n  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,\r\n  *  decentralised, trustless and compatible with staking in Ethereum 2.0.\r\n  *\r\n  *  For more information about Rocket Pool, visit https://rocketpool.net\r\n  *\r\n  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty\r\n  *\r\n  */\r\n\r\npragma solidity 0.7.6;\r\n\r\nimport \"../../interface/RocketStorageInterface.sol\";\r\n\r\n// SPDX-License-Identifier: GPL-3.0-only\r\n\r\nabstract contract RocketNodeDistributorStorageLayout {\r\n    RocketStorageInterface rocketStorage;\r\n    address nodeAddress;\r\n}"
      },
      "/contracts/interface/RocketStorageInterface.sol": {
        "content": "/**\r\n  *       .\r\n  *      / \\\r\n  *     |.'.|\r\n  *     |'.'|\r\n  *   ,'|   |`.\r\n  *  |,-'-|-'-.|\r\n  *   __|_| |         _        _      _____           _\r\n  *  | ___ \\|        | |      | |    | ___ \\         | |\r\n  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |\r\n  *  |    // _ \\ / __| |/ / _ \\ __|  |  __/ _ \\ / _ \\| |\r\n  *  | |\\ \\ (_) | (__|   <  __/ |_   | | | (_) | (_) | |\r\n  *  \\_| \\_\\___/ \\___|_|\\_\\___|\\__|  \\_|  \\___/ \\___/|_|\r\n  * +---------------------------------------------------+\r\n  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |\r\n  * +---------------------------------------------------+\r\n  *\r\n  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,\r\n  *  decentralised, trustless and compatible with staking in Ethereum 2.0.\r\n  *\r\n  *  For more information about Rocket Pool, visit https://rocketpool.net\r\n  *\r\n  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty\r\n  *\r\n  */\r\n\r\npragma solidity >0.5.0 <0.9.0;\n\n// SPDX-License-Identifier: GPL-3.0-only\n\ninterface RocketStorageInterface {\n\n    // Deploy status\n    function getDeployedStatus() external view returns (bool);\n\n    // Guardian\n    function getGuardian() external view returns(address);\n    function setGuardian(address _newAddress) external;\n    function confirmGuardian() external;\n\n    // Getters\n    function getAddress(bytes32 _key) external view returns (address);\n    function getUint(bytes32 _key) external view returns (uint);\n    function getString(bytes32 _key) external view returns (string memory);\n    function getBytes(bytes32 _key) external view returns (bytes memory);\n    function getBool(bytes32 _key) external view returns (bool);\n    function getInt(bytes32 _key) external view returns (int);\n    function getBytes32(bytes32 _key) external view returns (bytes32);\n\n    // Setters\n    function setAddress(bytes32 _key, address _value) external;\n    function setUint(bytes32 _key, uint _value) external;\n    function setString(bytes32 _key, string calldata _value) external;\n    function setBytes(bytes32 _key, bytes calldata _value) external;\n    function setBool(bytes32 _key, bool _value) external;\n    function setInt(bytes32 _key, int _value) external;\n    function setBytes32(bytes32 _key, bytes32 _value) external;\n\n    // Deleters\n    function deleteAddress(bytes32 _key) external;\n    function deleteUint(bytes32 _key) external;\n    function deleteString(bytes32 _key) external;\n    function deleteBytes(bytes32 _key) external;\n    function deleteBool(bytes32 _key) external;\n    function deleteInt(bytes32 _key) external;\n    function deleteBytes32(bytes32 _key) external;\n\n    // Arithmetic\n    function addUint(bytes32 _key, uint256 _amount) external;\n    function subUint(bytes32 _key, uint256 _amount) external;\n\n    // Protected storage\n    function getNodeWithdrawalAddress(address _nodeAddress) external view returns (address);\n    function getNodePendingWithdrawalAddress(address _nodeAddress) external view returns (address);\n    function setWithdrawalAddress(address _nodeAddress, address _newWithdrawalAddress, bool _confirm) external;\n    function confirmWithdrawalAddress(address _nodeAddress) external;\n}\n"
      }
    },
    "settings": {
      "remappings": [],
      "optimizer": {
        "enabled": true,
        "runs": 15000
      },
      "evmVersion": "istanbul",
      "libraries": {},
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "abi"
          ]
        }
      }
    }
  }}