More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,425 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw RPL | 21121018 | 74 days ago | IN | 0 ETH | 0.00014411 | ||||
Stake RPL For | 21060383 | 83 days ago | IN | 0 ETH | 0.00123772 | ||||
Withdraw RPL | 21060156 | 83 days ago | IN | 0 ETH | 0.0019154 | ||||
Stake RPL For | 21059975 | 83 days ago | IN | 0 ETH | 0.00100119 | ||||
Withdraw RPL | 21059419 | 83 days ago | IN | 0 ETH | 0.00154633 | ||||
Withdraw RPL | 21059106 | 83 days ago | IN | 0 ETH | 0.00167633 | ||||
Withdraw RPL | 21058269 | 83 days ago | IN | 0 ETH | 0.00241391 | ||||
Withdraw RPL | 21057585 | 83 days ago | IN | 0 ETH | 0.00244632 | ||||
Stake RPL For | 21057353 | 83 days ago | IN | 0 ETH | 0.00154034 | ||||
Stake RPL For | 21057167 | 83 days ago | IN | 0 ETH | 0.00140875 | ||||
Stake RPL | 21055728 | 84 days ago | IN | 0 ETH | 0.00112183 | ||||
Withdraw RPL | 21055565 | 84 days ago | IN | 0 ETH | 0.00171098 | ||||
Withdraw RPL | 21055452 | 84 days ago | IN | 0 ETH | 0.00151356 | ||||
Stake RPL | 21054869 | 84 days ago | IN | 0 ETH | 0.00053183 | ||||
Stake RPL For | 21054395 | 84 days ago | IN | 0 ETH | 0.00074441 | ||||
Stake RPL | 21054051 | 84 days ago | IN | 0 ETH | 0.00059153 | ||||
Stake RPL | 21053546 | 84 days ago | IN | 0 ETH | 0.0005318 | ||||
Stake RPL For | 21052979 | 84 days ago | IN | 0 ETH | 0.00078385 | ||||
Set Stake RPL Fo... | 21052920 | 84 days ago | IN | 0 ETH | 0.00043306 | ||||
Stake RPL For | 21052286 | 84 days ago | IN | 0 ETH | 0.00084135 | ||||
Stake RPL | 21051837 | 84 days ago | IN | 0 ETH | 0.00130506 | ||||
Stake RPL | 21051623 | 84 days ago | IN | 0 ETH | 0.0010109 | ||||
Stake RPL | 21051295 | 84 days ago | IN | 0 ETH | 0.00129431 | ||||
Stake RPL For | 21050924 | 84 days ago | IN | 0 ETH | 0.00242404 | ||||
Stake RPL | 21050865 | 84 days ago | IN | 0 ETH | 0.00194994 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
21364301 | 40 days ago | 0 ETH | |||||
21364301 | 40 days ago | 0 ETH | |||||
21364257 | 40 days ago | 0 ETH | |||||
21364257 | 40 days ago | 0 ETH | |||||
21364247 | 40 days ago | 0 ETH | |||||
21364247 | 40 days ago | 0 ETH | |||||
21313990 | 48 days ago | 0 ETH | |||||
21313990 | 48 days ago | 0 ETH | |||||
21313949 | 48 days ago | 0 ETH | |||||
21313949 | 48 days ago | 0 ETH | |||||
21313936 | 48 days ago | 0 ETH | |||||
21313936 | 48 days ago | 0 ETH | |||||
21121018 | 74 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH | |||||
21060404 | 83 days ago | 0 ETH |
Loading...
Loading
Contract Name:
RocketNodeStaking
Compiler Version
v0.8.18+commit.87f61d96
Contract Source Code (Solidity Standard Json-Input format)
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.18; import "../../interface/util/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"; import "../../interface/network/RocketNetworkSnapshotsInterface.sol"; import "../network/RocketNetworkSnapshots.sol"; import "../../interface/node/RocketNodeManagerInterface.sol"; /// @notice Handles node deposits and minipool creation contract RocketNodeStaking is RocketBase, RocketNodeStakingInterface { // Constants bytes32 immutable internal totalKey; // 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); event RPLLockingAllowed(address indexed node, bool allowed, uint256 time); event RPLLocked(address indexed from, uint256 amount, uint256 time); event RPLUnlocked(address indexed from, uint256 amount, uint256 time); event RPLTransferred(address indexed from, address indexed to, uint256 amount, uint256 time); modifier onlyRPLWithdrawalAddressOrNode(address _nodeAddress) { // Check that the call is coming from RPL withdrawal address (or node if unset) RocketNodeManagerInterface rocketNodeManager = RocketNodeManagerInterface(getContractAddress("rocketNodeManager")); if (rocketNodeManager.getNodeRPLWithdrawalAddressIsSet(_nodeAddress)) { address rplWithdrawalAddress = rocketNodeManager.getNodeRPLWithdrawalAddress(_nodeAddress); require(msg.sender == rplWithdrawalAddress, "Must be called from RPL withdrawal address"); } else { require(msg.sender == _nodeAddress, "Must be called from node address"); } _; } constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) { version = 5; // Precompute keys totalKey = keccak256(abi.encodePacked("rpl.staked.total.amount")); } /// @notice Returns the total quantity of RPL staked on the network function getTotalRPLStake() override external view returns (uint256) { return getUint(totalKey); } /// @dev Increases the total network RPL stake /// @param _amount How much to increase by function increaseTotalRPLStake(uint256 _amount) private { addUint(totalKey, _amount); } /// @dev Decrease the total network RPL stake /// @param _amount How much to decrease by function decreaseTotalRPLStake(uint256 _amount) private { subUint(totalKey, _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) { bytes32 key = keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)); RocketNetworkSnapshotsInterface rocketNetworkSnapshots = RocketNetworkSnapshotsInterface(getContractAddress("rocketNetworkSnapshots")); (bool exists,, uint224 value) = rocketNetworkSnapshots.latest(key); uint256 stake = uint256(value); if (!exists){ // Fallback to old value stake = getUint(key); } return stake; } /// @dev Increases a node operator's RPL stake /// @param _amount How much to increase by function increaseNodeRPLStake(address _nodeAddress, uint256 _amount) private { RocketNetworkSnapshotsInterface rocketNetworkSnapshots = RocketNetworkSnapshotsInterface(getContractAddress("rocketNetworkSnapshots")); bytes32 key = keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)); (bool exists,, uint224 value) = rocketNetworkSnapshots.latest(key); if (!exists){ value = uint224(getUint(key)); } rocketNetworkSnapshots.push(key, value + uint224(_amount)); } /// @dev Decrease a node operator's RPL stake /// @param _amount How much to decrease by function decreaseNodeRPLStake(address _nodeAddress, uint256 _amount) private { RocketNetworkSnapshotsInterface rocketNetworkSnapshots = RocketNetworkSnapshotsInterface(getContractAddress("rocketNetworkSnapshots")); bytes32 key = keccak256(abi.encodePacked("rpl.staked.node.amount", _nodeAddress)); (bool exists,, uint224 value) = rocketNetworkSnapshots.latest(key); if (!exists){ value = uint224(getUint(key)); } rocketNetworkSnapshots.push(key, value - uint224(_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) { RocketNetworkSnapshotsInterface rocketNetworkSnapshots = RocketNetworkSnapshotsInterface(getContractAddress("rocketNetworkSnapshots")); bytes32 key = keccak256(abi.encodePacked("eth.matched.node.amount", _nodeAddress)); (bool exists, , uint224 value) = rocketNetworkSnapshots.latest(key); if (exists) { // Value was previously set in a snapshot so return that return value; } else { // Fallback to old method uint256 ethMatched = getUint(key); if (ethMatched > 0) { // Value was previously calculated and stored so return that return ethMatched; } else { // Fallback for backwards compatibility before ETH matched was recorded (all legacy minipools matched 16 ETH from protocol) RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager")); return rocketMinipoolManager.getNodeActiveMinipoolCount(_nodeAddress) * 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 = getNodeETHMatched(_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 * launchAmount; return totalEthStaked - ethMatched; } else { // Fallback for legacy minipools is number of staking minipools * 16 return activeMinipoolCount * 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 = getNodeETHMatched(_nodeAddress); if (ethMatched == 0) { // Node operator only has legacy minipools and all legacy minipools had a 1:1 ratio return calcBase * 2; } else { RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool")); uint256 launchAmount = rocketDAOProtocolSettingsMinipool.getLaunchBalance(); RocketMinipoolManagerInterface rocketMinipoolManager = RocketMinipoolManagerInterface(getContractAddress("rocketMinipoolManager")); uint256 totalEthStaked = rocketMinipoolManager.getNodeActiveMinipoolCount(_nodeAddress) * launchAmount; return (totalEthStaked * calcBase) / (totalEthStaked - 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 public 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 * maximumStakePercent / 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 * minimumStakePercent / 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 * minimumStakePercent / 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 * maximumStakePercent / 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) *rocketNetworkPrices.getRPLPrice() / minimumStakePercent; } /// @notice Returns whether this node allows RPL locking or not /// @param _nodeAddress The address of the node operator to query for function getRPLLockingAllowed(address _nodeAddress) external view returns (bool) { return getBool(keccak256(abi.encodePacked("rpl.locking.allowed", _nodeAddress))); } /// @notice Accept an RPL stake from the node operator's own address /// Requires the node's RPL withdrawal address to be unset /// @param _amount The amount of RPL to stake function stakeRPL(uint256 _amount) override external { stakeRPLFor(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 public onlyLatestContract("rocketNodeStaking", address(this)) onlyRegisteredNode(_nodeAddress) { // Must be node's RPL withdrawal address if set or the node's address or an allow listed address or rocketMerkleDistributorMainnet if (msg.sender != getAddress(keccak256(abi.encodePacked("contract.address", "rocketMerkleDistributorMainnet")))) { RocketNodeManagerInterface rocketNodeManager = RocketNodeManagerInterface(getContractAddress("rocketNodeManager")); bool fromNode = false; if (rocketNodeManager.getNodeRPLWithdrawalAddressIsSet(_nodeAddress)) { address rplWithdrawalAddress = rocketNodeManager.getNodeRPLWithdrawalAddress(_nodeAddress); fromNode = msg.sender == rplWithdrawalAddress; } else { address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(_nodeAddress); fromNode = (msg.sender == _nodeAddress) || (msg.sender == withdrawalAddress); } if (!fromNode) { require(getBool(keccak256(abi.encodePacked("node.stake.for.allowed", _nodeAddress, msg.sender))), "Not allowed to stake for"); } } _stakeRPL(_nodeAddress, _amount); } /// @notice Sets the allow state for this node to perform functions that require locking RPL /// @param _nodeAddress The address of the node operator to change the state for /// @param _allowed Whether locking is allowed or not function setRPLLockingAllowed(address _nodeAddress, bool _allowed) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyRPLWithdrawalAddressOrNode(_nodeAddress) { // Set the value setBool(keccak256(abi.encodePacked("rpl.locking.allowed", _nodeAddress)), _allowed); // Log it emit RPLLockingAllowed(_nodeAddress, _allowed, block.timestamp); } /// @notice Explicitly allow or remove allowance of an address to be able to stake on behalf of a node /// @dev The node operator is determined by the address calling this method, it is here for backwards compatibility /// @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 { setStakeRPLForAllowed(msg.sender, _caller, _allowed); } /// @notice Explicitly allow or remove allowance of an address to be able to stake on behalf of a node /// @param _nodeAddress The address of the node operator allowing the caller /// @param _caller The address you wish to allow /// @param _allowed Whether the address is allowed or denied function setStakeRPLForAllowed(address _nodeAddress, address _caller, bool _allowed) override public onlyLatestContract("rocketNodeStaking", address(this)) onlyRPLWithdrawalAddressOrNode(_nodeAddress) { // Set the value setBool(keccak256(abi.encodePacked("node.stake.for.allowed", _nodeAddress, _caller)), _allowed); // Log it emit StakeRPLForAllowed(_nodeAddress, _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 Returns the amount of RPL that is locked for a given node /// @param _nodeAddress The address of the node operator to query for function getNodeRPLLocked(address _nodeAddress) override public view returns (uint256) { return getUint(keccak256(abi.encodePacked("rpl.locked.node.amount", _nodeAddress))); } /// @notice Locks an amount of RPL from being withdrawn even if the node operator is over capitalised /// @param _nodeAddress The address of the node operator /// @param _amount The amount of RPL to lock function lockRPL(address _nodeAddress, uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyLatestNetworkContract() { // Check status require(getBool(keccak256(abi.encodePacked("rpl.locking.allowed", _nodeAddress))), "Node is not allowed to lock RPL"); // The node must have unlocked stake equaling or greater than the amount uint256 rplStake = getNodeRPLStake(_nodeAddress); bytes32 lockedStakeKey = keccak256(abi.encodePacked("rpl.locked.node.amount", _nodeAddress)); uint256 lockedStake = getUint(lockedStakeKey); require(rplStake - lockedStake >= _amount, "Not enough staked RPL"); // Increase locked RPL setUint(lockedStakeKey, lockedStake + _amount); // Emit event emit RPLLocked(_nodeAddress, _amount, block.timestamp); } /// @notice Unlocks an amount of RPL making it possible to withdraw if the nod is over capitalised /// @param _nodeAddress The address of the node operator /// @param _amount The amount of RPL to unlock function unlockRPL(address _nodeAddress, uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyLatestNetworkContract() { // The node must have locked stake equaling or greater than the amount bytes32 lockedStakeKey = keccak256(abi.encodePacked("rpl.locked.node.amount", _nodeAddress)); uint256 lockedStake = getUint(lockedStakeKey); require(_amount <= lockedStake, "Not enough locked RPL"); // Decrease locked RPL setUint(lockedStakeKey, lockedStake - _amount); // Emit event emit RPLUnlocked(_nodeAddress, _amount, block.timestamp); } /// @notice Transfers RPL from one node to another /// @param _from The node to transfer from /// @param _to The node to transfer to /// @param _amount The amount of RPL to transfer function transferRPL(address _from, address _to, uint256 _amount) override external onlyLatestContract("rocketNodeStaking", address(this)) onlyLatestNetworkContract() onlyRegisteredNode(_from) { // Check sender has enough RPL require(getNodeRPLStake(_from) >= _amount, "Sender has insufficient RPL"); // Transfer the stake decreaseNodeRPLStake(_from, _amount); increaseNodeRPLStake(_to, _amount); // Emit event emit RPLTransferred(_from, _to, _amount, block.timestamp); } /// @notice Withdraw staked RPL back to the node account or withdraw RPL address /// Can only be called by a node if they have not set their RPL withdrawal address /// @param _amount The amount of RPL to withdraw function withdrawRPL(uint256 _amount) override external { withdrawRPL(msg.sender, _amount); } /// @notice Withdraw staked RPL back to the node account or withdraw RPL address /// If RPL withdrawal address has been set, must be called from it. Otherwise, must be called from /// node's primary withdrawal address or their node address. /// @param _nodeAddress The address of the node withdrawing /// @param _amount The amount of RPL to withdraw function withdrawRPL(address _nodeAddress, uint256 _amount) override public onlyLatestContract("rocketNodeStaking", address(this)) { // Check valid node require(getBool(keccak256(abi.encodePacked("node.exists", _nodeAddress))), "Invalid node"); // Check address is permitted to withdraw RocketNodeManagerInterface rocketNodeManager = RocketNodeManagerInterface(getContractAddress("rocketNodeManager")); address rplWithdrawalAddress = rocketNodeManager.getNodeRPLWithdrawalAddress(_nodeAddress); if (rocketNodeManager.getNodeRPLWithdrawalAddressIsSet(_nodeAddress)) { // If RPL withdrawal address is set, must be called from it require(msg.sender == rplWithdrawalAddress, "Invalid caller"); } else { // Otherwise, must be called from node address or withdrawal address address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(_nodeAddress); require(msg.sender == _nodeAddress || msg.sender == withdrawalAddress, "Invalid caller"); } // 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 - getNodeRPLStakedTime(_nodeAddress) >= rocketDAOProtocolSettingsRewards.getRewardsClaimIntervalTime(), "The withdrawal cooldown period has not passed"); // Get & check node's current RPL stake uint256 rplStake = getNodeRPLStake(_nodeAddress); uint256 lockedStake = getNodeRPLLocked(_nodeAddress); require(rplStake - lockedStake >= _amount, "Withdrawal amount exceeds node's staked RPL balance"); // Check withdrawal would not under collateralise node require(rplStake - _amount >= getNodeMaximumRPLStake(_nodeAddress) + lockedStake, "Node's staked RPL balance after withdrawal is less than required balance"); // Update RPL stake amounts decreaseTotalRPLStake(_amount); decreaseNodeRPLStake(_nodeAddress, _amount); // Transfer RPL tokens to node's RPL withdrawal address (if unset, defaults to primary withdrawal address) rocketVault.withdrawToken(rplWithdrawalAddress, IERC20(getContractAddress("rocketTokenRPL")), _amount); // Emit RPL withdrawn event emit RPLWithdrawn(_nodeAddress, _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 * _ethSlashAmount / 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); } }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity >0.5.0 <0.9.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the 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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool); }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // 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(address(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); } }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // 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 }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // 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 }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // 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; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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 tryDistribute(address _nodeAddress) external; function incrementNodeFinalisedMinipoolCount(address _nodeAddress) external; function setMinipoolPubkey(bytes calldata _pubkey) external; function getMinipoolDepositType(address _minipoolAddress) external view returns (MinipoolDeposit); }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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 submitPrices(uint256 _block, uint256 _slotTimestamp, uint256 _rplPrice) external; function executeUpdatePrices(uint256 _block, uint256 _slotTimestamp, uint256 _rplPrice) external; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.5.0 <0.9.0; 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 getRPLLockingAllowed(address _nodeAddress) external view returns (bool); function stakeRPL(uint256 _amount) external; function stakeRPLFor(address _nodeAddress, uint256 _amount) external; function setRPLLockingAllowed(address _nodeAddress, bool _allowed) external; function setStakeRPLForAllowed(address _caller, bool _allowed) external; function setStakeRPLForAllowed(address _nodeAddress, address _caller, bool _allowed) external; function getNodeRPLLocked(address _nodeAddress) external view returns (uint256); function lockRPL(address _nodeAddress, uint256 _amount) external; function unlockRPL(address _nodeAddress, uint256 _amount) external; function transferRPL(address _from, address _to, uint256 _amount) external; function withdrawRPL(uint256 _amount) external; function withdrawRPL(address _nodeAddress, uint256 _amount) external; function slashRPL(address _nodeAddress, uint256 _ethSlashAmount) external; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.5.0 <0.9.0; interface RocketDAOProtocolSettingsRewardsInterface { function setSettingRewardsClaimers(uint256 _trustedNodePercent, uint256 _protocolPercent, uint256 _nodePercent) external; function getRewardsClaimerPerc(string memory _contractName) external view returns (uint256); function getRewardsClaimersPerc() external view returns (uint256 _trustedNodePercent, uint256 _protocolPercent, uint256 _nodePercent); function getRewardsClaimersTrustedNodePerc() external view returns (uint256); function getRewardsClaimersProtocolPerc() external view returns (uint256); function getRewardsClaimersNodePerc() external view returns (uint256); function getRewardsClaimersTimeUpdated() external view returns (uint256); function getRewardsClaimIntervalPeriods() external view returns (uint256); function getRewardsClaimIntervalTime() external view returns (uint256); }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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); }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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); function getMaximumStakeForVotingPower() external view returns (uint256); }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) import "./IERC20.sol"; pragma solidity >0.5.0 <0.9.0; interface IERC20Burnable is IERC20 { function burn(uint256 amount) external; function burnFrom(address account, uint256 amount) external; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // SPDX-License-Identifier: GPL-3.0-only import "./util/IERC20Burnable.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(IERC20Burnable _tokenAddress, uint256 _amount) external; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ 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; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.5.0 <0.9.0; struct Checkpoint224 { uint32 _block; uint224 _value; } /// @notice Accounting for snapshotting of values based on block numbers interface RocketNetworkSnapshotsInterface { function push(bytes32 _key, uint224 _value) external; function length(bytes32 _key) external view returns (uint256); function latest(bytes32 _key) external view returns (bool, uint32, uint224); function latestBlock(bytes32 _key) external view returns (uint32); function latestValue(bytes32 _key) external view returns (uint224); function lookup(bytes32 _key, uint32 _block) external view returns (uint224); function lookupRecent(bytes32 _key, uint32 _block, uint256 _recency) external view returns (uint224); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: MIT // Copyright (c) 2016-2023 zOS Global Limited and contributors // Adapted from OpenZeppelin `Checkpoints` contract pragma solidity 0.8.18; import "@openzeppelin4/contracts/utils/math/Math.sol"; import "../RocketBase.sol"; import "../../interface/network/RocketNetworkSnapshotsInterface.sol"; /// @notice Accounting for snapshotting of values based on block numbers contract RocketNetworkSnapshots is RocketBase, RocketNetworkSnapshotsInterface { constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) { // Set contract version version = 1; } function push(bytes32 _key, uint224 _value) onlyLatestContract("rocketNetworkSnapshots", address(this)) onlyLatestNetworkContract external { _insert(_key, _value); } function length(bytes32 _key) public view returns (uint256) { return rocketStorage.getUint(keccak256(abi.encodePacked("snapshot.length", _key))); } function latest(bytes32 _key) external view returns (bool, uint32, uint224) { uint256 len = length(_key); if (len == 0) { return (false, 0, 0); } Checkpoint224 memory checkpoint = _load(_key, len - 1); return (true, checkpoint._block, checkpoint._value); } function latestBlock(bytes32 _key) external view returns (uint32) { uint256 len = length(_key); return len == 0 ? 0 : _blockAt(_key, len - 1); } function latestValue(bytes32 _key) external view returns (uint224) { uint256 len = length(_key); return len == 0 ? 0 : _valueAt(_key, len - 1); } function lookup(bytes32 _key, uint32 _block) external view returns (uint224) { uint256 len = length(_key); uint256 pos = _binaryLookup(_key, _block, 0, len); return pos == 0 ? 0 : _valueAt(_key, pos - 1); } function lookupRecent(bytes32 _key, uint32 _block, uint256 _recency) external view returns (uint224) { uint256 len = length(_key); uint256 low = 0; uint256 high = len; if (len > 5 && len > _recency) { uint256 mid = len - _recency; if (_block < _blockAt(_key, mid)) { high = mid; } else { low = mid + 1; } } uint256 pos = _binaryLookup(_key, _block, low, high); return pos == 0 ? 0 : _valueAt(_key, pos - 1); } function _insert(bytes32 _key, uint224 _value) private { uint32 blockNumber = uint32(block.number); uint256 pos = length(_key); if (pos > 0) { Checkpoint224 memory last = _load(_key, pos - 1); // Checkpoint keys must be non-decreasing. require (last._block <= blockNumber, "Unordered snapshot insertion"); // Update or push new checkpoint if (last._block == blockNumber) { last._value = _value; _set(_key, pos - 1, last); } else { _push(_key, Checkpoint224({_block: blockNumber, _value: _value})); } } else { _push(_key, Checkpoint224({_block: blockNumber, _value: _value})); } } function _binaryLookup( bytes32 _key, uint32 _block, uint256 _low, uint256 _high ) private view returns (uint256) { while (_low < _high) { uint256 mid = Math.average(_low, _high); if (_blockAt(_key, mid) > _block) { _high = mid; } else { _low = mid + 1; } } return _high; } function _load(bytes32 _key, uint256 _pos) private view returns (Checkpoint224 memory) { bytes32 key = bytes32(uint256(_key) + _pos); bytes32 raw = rocketStorage.getBytes32(key); Checkpoint224 memory result; result._block = uint32(uint256(raw) >> 224); result._value = uint224(uint256(raw)); return result; } function _blockAt(bytes32 _key, uint256 _pos) private view returns (uint32) { bytes32 key = bytes32(uint256(_key) + _pos); bytes32 raw = rocketStorage.getBytes32(key); return uint32(uint256(raw) >> 224); } function _valueAt(bytes32 _key, uint256 _pos) private view returns (uint224) { bytes32 key = bytes32(uint256(_key) + _pos); bytes32 raw = rocketStorage.getBytes32(key); return uint224(uint256(raw)); } function _push(bytes32 _key, Checkpoint224 memory _item) private { bytes32 lengthKey = keccak256(abi.encodePacked("snapshot.length", _key)); uint256 snapshotLength = rocketStorage.getUint(lengthKey); bytes32 key = bytes32(uint256(_key) + snapshotLength); rocketStorage.setUint(lengthKey, snapshotLength + 1); rocketStorage.setBytes32(key, _encode(_item)); } function _set(bytes32 _key, uint256 _pos, Checkpoint224 memory _item) private { bytes32 key = bytes32(uint256(_key) + _pos); rocketStorage.setBytes32(key, _encode(_item)); } function _encode(Checkpoint224 memory _item) private pure returns (bytes32) { return bytes32( uint256(_item._block) << 224 | uint256(_item._value) ); } }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ pragma solidity >0.5.0 <0.9.0; // SPDX-License-Identifier: GPL-3.0-only // A struct containing all the information on-chain about a specific node struct NodeDetails { bool exists; uint256 registrationTime; string timezoneLocation; bool feeDistributorInitialised; address feeDistributorAddress; uint256 rewardNetwork; uint256 rplStake; uint256 effectiveRPLStake; uint256 minimumRPLStake; uint256 maximumRPLStake; uint256 ethMatched; uint256 ethMatchedLimit; uint256 minipoolCount; uint256 balanceETH; uint256 balanceRETH; uint256 balanceRPL; uint256 balanceOldRPL; uint256 depositCreditBalance; uint256 distributorBalanceUserETH; uint256 distributorBalanceNodeETH; address withdrawalAddress; address pendingWithdrawalAddress; bool smoothingPoolRegistrationState; uint256 smoothingPoolRegistrationChanged; address nodeAddress; }
/** * . * / \ * |.'.| * |'.'| * ,'| |'. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | * | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | * \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| * +---------------------------------------------------+ * | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | * +---------------------------------------------------+ * * Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to * be community-owned, decentralised, permissionless, & trustless. * * For more information about Rocket Pool, visit https://rocketpool.net * * Authored by the Rocket Pool Core Team * Contributors: https://github.com/rocket-pool/rocketpool/graphs/contributors * A special thanks to the Rocket Pool community for all their contributions. * */ // SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.5.0 <0.9.0; pragma abicoder v2; import "../../types/NodeDetails.sol"; interface RocketNodeManagerInterface { // Structs struct TimezoneCount { string timezone; uint256 count; } function getNodeCount() external view returns (uint256); function getNodeCountPerTimezone(uint256 offset, uint256 limit) external view returns (TimezoneCount[] memory); function getNodeAt(uint256 _index) external view returns (address); function getNodeExists(address _nodeAddress) external view returns (bool); function getNodeWithdrawalAddress(address _nodeAddress) external view returns (address); function getNodePendingWithdrawalAddress(address _nodeAddress) external view returns (address); function getNodeRPLWithdrawalAddress(address _nodeAddress) external view returns (address); function getNodeRPLWithdrawalAddressIsSet(address _nodeAddress) external view returns (bool); function unsetRPLWithdrawalAddress(address _nodeAddress) external; function setRPLWithdrawalAddress(address _nodeAddress, address _newRPLWithdrawalAddress, bool _confirm) external; function confirmRPLWithdrawalAddress(address _nodeAddress) external; function getNodePendingRPLWithdrawalAddress(address _nodeAddress) external view returns (address); function getNodeTimezoneLocation(address _nodeAddress) external view returns (string memory); function registerNode(string calldata _timezoneLocation) external; function getNodeRegistrationTime(address _nodeAddress) external view returns (uint256); function setTimezoneLocation(string calldata _timezoneLocation) external; function setRewardNetwork(address _nodeAddress, uint256 network) external; function getRewardNetwork(address _nodeAddress) external view returns (uint256); function getFeeDistributorInitialised(address _nodeAddress) external view returns (bool); function initialiseFeeDistributor() external; function getAverageNodeFee(address _nodeAddress) external view returns (uint256); function setSmoothingPoolRegistrationState(bool _state) external; function getSmoothingPoolRegistrationState(address _nodeAddress) external returns (bool); function getSmoothingPoolRegistrationChanged(address _nodeAddress) external returns (uint256); function getSmoothingPoolRegisteredNodeCount(uint256 _offset, uint256 _limit) external view returns (uint256); function getNodeDetails(address _nodeAddress) external view returns (NodeDetails memory); function getNodeAddresses(uint256 _offset, uint256 _limit) external view returns (address[] memory); }
{ "optimizer": { "enabled": true, "runs": 15000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract RocketStorageInterface","name":"_rocketStorageAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"RPLLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"node","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RPLLockingAllowed","type":"event"},{"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":"from","type":"address"},{"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":"RPLTransferred","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":"RPLUnlocked","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":"getNodeRPLLocked","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":[{"internalType":"address","name":"_nodeAddress","type":"address"}],"name":"getRPLLockingAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRPLStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lockRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"setRPLLockingAllowed","outputs":[],"stateMutability":"nonpayable","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":"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":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unlockRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nodeAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawRPL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawRPL","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405260008054610100600160a81b03191690553480156200002257600080fd5b506040516200425e3803806200425e8339810160408190526200004591620000bb565b6000805460056001600160a81b03199091166101006001600160a01b0385160260ff1916171790556040517f72706c2e7374616b65642e746f74616c2e616d6f756e74000000000000000000602082015260370160408051601f19818403018152919052805160209091012060805250620000ed565b600060208284031215620000ce57600080fd5b81516001600160a01b0381168114620000e657600080fd5b9392505050565b60805161414762000117600039600081816123a1015281816137a40152613c9801526141476000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c8063641a24d2116100e3578063c0d05dd81161008c578063e5e82b7c11610066578063e5e82b7c14610352578063f0d19b8914610365578063f3512f841461037857600080fd5b8063c0d05dd814610319578063c601bf781461032c578063cb1c83211461033f57600080fd5b80639961cee4116100bd5780639961cee4146102eb5780639a206c8e146102fe578063a493e6a21461030657600080fd5b8063641a24d2146102a25780636b088d5c146102c557806397be2143146102d857600080fd5b80632c177a531161014557806348aeedf51161011f57806348aeedf51461025d5780634e58ff6e1461027057806354fd4d501461028357600080fd5b80632c177a53146102245780633d65c1fa146102375780633e200d4b1461024a57600080fd5b8063194c63d811610176578063194c63d8146101eb57806321f3da44146101fe578063245395a61461021157600080fd5b806303fa87b41461019d578063088903a4146101c357806310b63749146101d8575b600080fd5b6101b06101ab366004613d8c565b61038b565b6040519081526020015b60405180910390f35b6101d66101d1366004613db7565b610503565b005b6101d66101e6366004613df0565b610512565b6101d66101f9366004613db7565b61080a565b6101d661020c366004613e31565b610b9b565b6101d661021f366004613e31565b61137c565b6101d6610232366004613e31565b6117b3565b6101d6610245366004613e5d565b611a2c565b6101d6610258366004613ea8565b611db4565b6101b061026b366004613d8c565b611dc1565b6101b061027e366004613d8c565b611f35565b6000546102909060ff1681565b60405160ff90911681526020016101ba565b6102b56102b0366004613d8c565b61202b565b60405190151581526020016101ba565b6101d66102d3366004613ea8565b612082565b6101b06102e6366004613d8c565b61208c565b6101b06102f9366004613d8c565b612250565b6101b061239a565b6101b0610314366004613d8c565b6123ca565b6101b0610327366004613d8c565b612614565b6101d661033a366004613e31565b61267c565b6101d661034d366004613e31565b6129ad565b6101b0610360366004613d8c565b612e40565b6101b0610373366004613d8c565b612fd4565b6101b0610386366004613d8c565b613223565b6000806103cc6040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b9050600061040e6040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190613ec1565b90506000610481866123ca565b9050836001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e59190613ec1565b6104ef8383613f09565b6104f99190613f20565b9695505050505050565b61050e338383611a2c565b5050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306105788260405160200161055d9190613f5b565b604051602081830303815290604052805190602001206132e3565b6001600160a01b0316816001600160a01b0316146105dd5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064015b60405180910390fd5b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f820152610641906043015b6040516020818303038152906040528051906020012061336e565b6106b25760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606087901b16602b820152859061070290603f01610626565b61074e5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b8361075887612250565b10156107a65760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722068617320696e73756666696369656e742052504c000000000060448201526064016105d4565b6107b086856133f9565b6107ba85856135d2565b604080518581524260208201526001600160a01b0380881692908916917f3bf4a4ef95ccf3119f6977afa759933d4edd361281f5c3b91203f43104fa3432910160405180910390a3505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306108558260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146108b55760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b8360006108f66040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529192509082169063e667d82890602401602060405180830381865afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d9190613fb3565b15610a8f576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526000919083169063b71f0c7c90602401602060405180830381865afa1580156109e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a099190613fd0565b9050336001600160a01b03821614610a895760405162461bcd60e51b815260206004820152602a60248201527f4d7573742062652063616c6c65642066726f6d2052504c20776974686472617760448201527f616c20616464726573730000000000000000000000000000000000000000000060648201526084016105d4565b50610ae7565b336001600160a01b03831614610ae75760405162461bcd60e51b815260206004820181905260248201527f4d7573742062652063616c6c65642066726f6d206e6f6465206164647265737360448201526064016105d4565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606088901b166033820152610b4d906047015b6040516020818303038152906040528051906020012086613717565b6040805186151581524260208201526001600160a01b038816917f6b33e987d80ef301261d0265922ffe70da2b332f0e097034ce01dbb998cbd01391015b60405180910390a2505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030610be68260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614610c465760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16602b820152610c9490603f01610626565b610ce05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b6000610d206040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015291925060009183169063b71f0c7c90602401602060405180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da99190613fd0565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301529192509083169063e667d82890602401602060405180830381865afa158015610e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e309190613fb3565b15610e9257336001600160a01b03821614610e8d5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642063616c6c657200000000000000000000000000000000000060448201526064016105d4565b610f8f565b600080546040517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b03898116600483015261010090920490911690635b49ff6290602401602060405180830381865afa158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190613fd0565b9050336001600160a01b0388161480610f415750336001600160a01b038216145b610f8d5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642063616c6c657200000000000000000000000000000000000060448201526064016105d4565b505b6000610fcf6040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e677352657761726473815250613274565b905060006110116040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b9050816001600160a01b03166394e5d5126040518163ffffffff1660e01b8152600401602060405180830381865afa158015611051573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110759190613ec1565b61107e89612614565b6110889042613fed565b10156110fc5760405162461bcd60e51b815260206004820152602d60248201527f546865207769746864726177616c20636f6f6c646f776e20706572696f64206860448201527f6173206e6f74207061737365640000000000000000000000000000000000000060648201526084016105d4565b600061110789612250565b905060006111148a613223565b9050886111218284613fed565b10156111955760405162461bcd60e51b815260206004820152603360248201527f5769746864726177616c20616d6f756e742065786365656473206e6f6465277360448201527f207374616b65642052504c2062616c616e63650000000000000000000000000060648201526084016105d4565b8061119f8b611f35565b6111a99190614000565b6111b38a84613fed565b101561124d5760405162461bcd60e51b815260206004820152604860248201527f4e6f64652773207374616b65642052504c2062616c616e63652061667465722060448201527f7769746864726177616c206973206c657373207468616e20726571756972656460648201527f2062616c616e6365000000000000000000000000000000000000000000000000608482015260a4016105d4565b6112568961379f565b6112608a8a6133f9565b826001600160a01b03166301e33667866112ae6040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018c9052606401600060405180830381600087803b15801561131557600080fd5b505af1158015611329573d6000803e3d6000fd5b5050604080518c81524260208201526001600160a01b038e1693507f9947063f70b076145616018b82ed1dd5585e15b7ae0a0b17a8b06bec4c4c31e292500160405180910390a250505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306113c78260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146114275760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b3361147a8160405160200161062691907f6d696e69706f6f6c2e6578697374730000000000000000000000000000000000815260609190911b6bffffffffffffffffffffffff1916600f82015260230190565b6114c65760405162461bcd60e51b815260206004820152601060248201527f496e76616c6964206d696e69706f6f6c0000000000000000000000000000000060448201526064016105d4565b60006115066040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b905060006115486040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b90506000826001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ae9190613ec1565b6115c088670de0b6b3a7640000613f09565b6115ca9190613f20565b905060006115d789612250565b9050808211156115e5578091505b81156116e557826001600160a01b031663ee91035e6116386040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260606004820152601460648201527f726f636b657441756374696f6e4d616e6167657200000000000000000000000060848201526001600160a01b0390911660248201526044810185905260a401600060405180830381600087803b1580156116cc57600080fd5b505af11580156116e0573d6000803e3d6000fd5b505050505b6116ee8261379f565b6116f889836133f9565b6040517f6d696e69706f6f6c2e72706c2e736c617368656400000000000000000000000060208201526bffffffffffffffffffffffff193360601b16603482015261175d90604801604051602081830303815290604052805190602001206001613717565b60408051838152602081018a9052428183015290516001600160a01b038b16917f38a2777b6a84fdb3fc375fe8ade69fdad1afdcdd93c79e7ae2319b806a626c4d919081900360600190a2505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306117fe8260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b03161461185e5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f8201526118ab90604301610626565b61191c5760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152600090604a016040516020818303038152906040528051906020012090506000611987826137c9565b9050808511156119d95760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768206c6f636b65642052504c000000000000000000000060448201526064016105d4565b6119ec826119e78784613fed565b613854565b604080518681524260208201526001600160a01b038816917f95f42213e171837caaa6cc7f589ef03a30179b7b85e386dfb146a30c5b10cfa99101610b8b565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030611a778260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614611ad75760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b846000611b186040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529192509082169063e667d82890602401602060405180830381865afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190613fb3565b15611cb1576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526000919083169063b71f0c7c90602401602060405180830381865afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2b9190613fd0565b9050336001600160a01b03821614611cab5760405162461bcd60e51b815260206004820152602a60248201527f4d7573742062652063616c6c65642066726f6d2052504c20776974686472617760448201527f616c20616464726573730000000000000000000000000000000000000000000060648201526084016105d4565b50611d09565b336001600160a01b03831614611d095760405162461bcd60e51b815260206004820181905260248201527f4d7573742062652063616c6c65642066726f6d206e6f6465206164647265737360448201526064016105d4565b6040517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208201526bffffffffffffffffffffffff19606089811b8216603684015288901b16604a820152611d6190605e01610b31565b6040805186151581524260208201526001600160a01b0380891692908a16917fb8502fe170368d1312ca3c9feac7aba9cd92406753d7eca9f11df9757081aec5910160405180910390a350505050505050565b611dbe33826129ad565b50565b600080611e026040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b90506000611e446040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613ec1565b905080836001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190613ec1565b611f1887612250565b611f229190613f09565b611f2c9190613f20565b95945050505050565b600080611f766040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b90506000611fb86040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316631e72ba866040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201e9190613ec1565b9050600061048186612e40565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603382015260009061207c90604701610626565b92915050565b611dbe3382610b9b565b600080612098836123ca565b9050806000036120bc576120b5670de0b6b3a76400006002613f09565b9392505050565b60006120df6040518060600160405280602181526020016140f160219139613274565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b8152600401602060405180830381865afa158015612121573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121459190613ec1565b905060006121876040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152919250600091849190841690631844ec0190602401602060405180830381865afa1580156121ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122139190613ec1565b61221d9190613f09565b90506122298582613fed565b61223b670de0b6b3a764000083613f09565b6122459190613f20565b979650505050505050565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606083901b1660368201526000908190604a0160405160208183030381529060405280519060200120905060006122f26040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b9050600080826001600160a01b03166379feb107856040518263ffffffff1660e01b815260040161232591815260200190565b606060405180830381865afa158015612342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123669190614013565b919350909150507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116826104f957612245856137c9565b60006123c57f00000000000000000000000000000000000000000000000000000000000000006137c9565b905090565b60008061240b6040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f6574682e6d6174636865642e6e6f64652e616d6f756e7400000000000000000060208201526bffffffffffffffffffffffff19606086901b166037820152909150600090604b01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b815260040161249f91815260200190565b606060405180830381865afa1580156124bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e09190614013565b92505091508115612512577bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1695945050505050565b600061251d846137c9565b9050801561252f579695505050505050565b600061256f6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015291925090821690631844ec0190602401602060405180830381865afa1580156125d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f69190613ec1565b6126089067de0b6b3a76400000613f09565b98975050505050505050565b6040517f72706c2e7374616b65642e6e6f64652e74696d6500000000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603482015260009061207c906048015b604051602081830303815290604052805190602001206137c9565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306126c78260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146127275760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f82015261277490604301610626565b6127e55760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16603382015261283390604701610626565b61287f5760405162461bcd60e51b815260206004820152601f60248201527f4e6f6465206973206e6f7420616c6c6f77656420746f206c6f636b2052504c0060448201526064016105d4565b600061288a85612250565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606088901b166036820152909150600090604a0160405160208183030381529060405280519060200120905060006128f8826137c9565b9050856129058285613fed565b10156129535760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207374616b65642052504c000000000000000000000060448201526064016105d4565b612961826119e78884614000565b604080518781524260208201526001600160a01b038916917fce4a5a05852c75132c79a7a41af76ced563f8391e69eea41a0b38214c4e847cf910160405180910390a250505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306129f88260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614612a585760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16602b8201528490612aa890603f01610626565b612af45760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b6040517f636f6e74726163742e616464726573730000000000000000000000000000000060208201527f726f636b65744d65726b6c654469737472696275746f724d61696e6e657400006030820152612b4f90604e0161055d565b6001600160a01b0316336001600160a01b031614612e2f576000612ba76040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015291925060009183169063e667d82890602401602060405180830381865afa158015612c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c309190613fb3565b15612cd0576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526000919084169063b71f0c7c90602401602060405180830381865afa158015612c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cbc9190613fd0565b6001600160a01b031633149150612d839050565b600080546040517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015261010090920490911690635b49ff6290602401602060405180830381865afa158015612d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5e9190613fd0565b9050336001600160a01b0389161480612d7f5750336001600160a01b038216145b9150505b80612e2c576040517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208201526bffffffffffffffffffffffff19606089811b8216603684015233901b16604a820152612de090605e01610626565b612e2c5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420616c6c6f77656420746f207374616b6520666f72000000000000000060448201526064016105d4565b50505b612e3985856138a9565b5050505050565b600080612e816040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152919250600091831690631844ec0190602401602060405180830381865afa158015612ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0a9190613ec1565b90506000612f17856123ca565b90508015612fc2576000612f426040518060600160405280602181526020016140f160219139613274565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa89190613ec1565b90506000612fb68286613f09565b90506126088482613fed565b611f2c8267de0b6b3a76400000613f09565b6000806130156040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b905060006130576040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b9050600061306485612250565b90506000613071866123ca565b9050600061307e87612e40565b90506000856001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e49190613ec1565b90506000856001600160a01b0316631e72ba866040518163ffffffff1660e01b8152600401602060405180830381865afa158015613126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314a9190613ec1565b90506000826131598386613f09565b6131639190613f20565b90508086111561317a579998505050505050505050565b6000876001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131de9190613ec1565b90506000846131ed8389613f09565b6131f79190613f20565b905080881015613213575060009b9a5050505050505050505050565b50959a9950505050505050505050565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603682015260009061207c90604a01612661565b60008061328b8360405160200161055d9190613f5b565b90506001600160a01b03811661207c5760405162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e64000000000000000000000000000060448201526064016105d4565b600080546040517f21f8a721000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b0316906321f8a72190602401602060405180830381865afa15801561334a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613fd0565b600080546040517f7ae1cfca000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b031690637ae1cfca90602401602060405180830381865afa1580156133d5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613fb3565b60006134396040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152909150600090604a01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b81526004016134cd91815260200190565b606060405180830381865afa1580156134ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061350e9190614013565b92505091508161352457613521836137c9565b90505b6001600160a01b038416635ba596498461353e888561407f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166024820152604401600060405180830381600087803b1580156135b257600080fd5b505af11580156135c6573d6000803e3d6000fd5b50505050505050505050565b60006136126040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152909150600090604a01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b81526004016136a691815260200190565b606060405180830381865afa1580156136c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136e79190614013565b9250509150816136fd576136fa836137c9565b90505b6001600160a01b038416635ba596498461353e88856140bb565b6000546040517fabfdcced0000000000000000000000000000000000000000000000000000000081526004810184905282151560248201526101009091046001600160a01b03169063abfdcced906044015b600060405180830381600087803b15801561378357600080fd5b505af1158015613797573d6000803e3d6000fd5b505050505050565b611dbe7f000000000000000000000000000000000000000000000000000000000000000082613c3e565b600080546040517fbd02d0f5000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b03169063bd02d0f590602401602060405180830381865afa158015613830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613ec1565b6000546040517fe2a4853a00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063e2a4853a90604401613769565b60006138e96040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b9050600061392b6040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101859052909150829082906001600160a01b038316906323b872dd906064016020604051808303816000875af115801561399e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c29190613fb3565b613a345760405162461bcd60e51b815260206004820152602a60248201527f436f756c64206e6f74207472616e736665722052504c20746f207374616b696e60448201527f6720636f6e74726163740000000000000000000000000000000000000000000060648201526084016105d4565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820187905283169063095ea7b3906044016020604051808303816000875af1158015613a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ac09190613fb3565b613b325760405162461bcd60e51b815260206004820152602360248201527f436f756c64206e6f7420617070726f7665207661756c742052504c206465706f60448201527f736974000000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517ff444295800000000000000000000000000000000000000000000000000000000815260606004820152601160648201527f726f636b65744e6f64655374616b696e6700000000000000000000000000000060848201526001600160a01b0383811660248301526044820187905282169063f44429589060a401600060405180830381600087803b158015613bc957600080fd5b505af1158015613bdd573d6000803e3d6000fd5b50505050613bea85613c93565b613bf486866135d2565b613bfe8642613cbd565b604080518681524260208201526001600160a01b038816917f4e3bcb61bb8e63cb9ed2c46d47eeb6ae847c629e909fbb32b9d17874affb4a899101610b8b565b6000546040517febb9d8c900000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063ebb9d8c990604401613769565b611dbe7f000000000000000000000000000000000000000000000000000000000000000082613d22565b6040517f72706c2e7374616b65642e6e6f64652e74696d6500000000000000000000000060208201526bffffffffffffffffffffffff19606084901b16603482015261050e906048016040516020818303038152906040528051906020012082613854565b6000546040517fadb353dc00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063adb353dc90604401613769565b6001600160a01b0381168114611dbe57600080fd5b600060208284031215613d9e57600080fd5b81356120b581613d77565b8015158114611dbe57600080fd5b60008060408385031215613dca57600080fd5b8235613dd581613d77565b91506020830135613de581613da9565b809150509250929050565b600080600060608486031215613e0557600080fd5b8335613e1081613d77565b92506020840135613e2081613d77565b929592945050506040919091013590565b60008060408385031215613e4457600080fd5b8235613e4f81613d77565b946020939093013593505050565b600080600060608486031215613e7257600080fd5b8335613e7d81613d77565b92506020840135613e8d81613d77565b91506040840135613e9d81613da9565b809150509250925092565b600060208284031215613eba57600080fd5b5035919050565b600060208284031215613ed357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761207c5761207c613eda565b600082613f56577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f636f6e74726163742e616464726573730000000000000000000000000000000081526000825160005b81811015613fa25760208186018101516010868401015201613f85565b506000920160100191825250919050565b600060208284031215613fc557600080fd5b81516120b581613da9565b600060208284031215613fe257600080fd5b81516120b581613d77565b8181038181111561207c5761207c613eda565b8082018082111561207c5761207c613eda565b60008060006060848603121561402857600080fd5b835161403381613da9565b602085015190935063ffffffff8116811461404d57600080fd5b60408501519092507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114613e9d57600080fd5b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8281168282160390808211156140b4576140b4613eda565b5092915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8181168382160190808211156140b4576140b4613eda56fe726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6ca2646970667358221220ac53aa41ded1c628ce09609959b0e1b8888dd49661772123efba6639c47dd1ea64736f6c634300081200330000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101985760003560e01c8063641a24d2116100e3578063c0d05dd81161008c578063e5e82b7c11610066578063e5e82b7c14610352578063f0d19b8914610365578063f3512f841461037857600080fd5b8063c0d05dd814610319578063c601bf781461032c578063cb1c83211461033f57600080fd5b80639961cee4116100bd5780639961cee4146102eb5780639a206c8e146102fe578063a493e6a21461030657600080fd5b8063641a24d2146102a25780636b088d5c146102c557806397be2143146102d857600080fd5b80632c177a531161014557806348aeedf51161011f57806348aeedf51461025d5780634e58ff6e1461027057806354fd4d501461028357600080fd5b80632c177a53146102245780633d65c1fa146102375780633e200d4b1461024a57600080fd5b8063194c63d811610176578063194c63d8146101eb57806321f3da44146101fe578063245395a61461021157600080fd5b806303fa87b41461019d578063088903a4146101c357806310b63749146101d8575b600080fd5b6101b06101ab366004613d8c565b61038b565b6040519081526020015b60405180910390f35b6101d66101d1366004613db7565b610503565b005b6101d66101e6366004613df0565b610512565b6101d66101f9366004613db7565b61080a565b6101d661020c366004613e31565b610b9b565b6101d661021f366004613e31565b61137c565b6101d6610232366004613e31565b6117b3565b6101d6610245366004613e5d565b611a2c565b6101d6610258366004613ea8565b611db4565b6101b061026b366004613d8c565b611dc1565b6101b061027e366004613d8c565b611f35565b6000546102909060ff1681565b60405160ff90911681526020016101ba565b6102b56102b0366004613d8c565b61202b565b60405190151581526020016101ba565b6101d66102d3366004613ea8565b612082565b6101b06102e6366004613d8c565b61208c565b6101b06102f9366004613d8c565b612250565b6101b061239a565b6101b0610314366004613d8c565b6123ca565b6101b0610327366004613d8c565b612614565b6101d661033a366004613e31565b61267c565b6101d661034d366004613e31565b6129ad565b6101b0610360366004613d8c565b612e40565b6101b0610373366004613d8c565b612fd4565b6101b0610386366004613d8c565b613223565b6000806103cc6040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b9050600061040e6040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190613ec1565b90506000610481866123ca565b9050836001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e59190613ec1565b6104ef8383613f09565b6104f99190613f20565b9695505050505050565b61050e338383611a2c565b5050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306105788260405160200161055d9190613f5b565b604051602081830303815290604052805190602001206132e3565b6001600160a01b0316816001600160a01b0316146105dd5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064015b60405180910390fd5b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f820152610641906043015b6040516020818303038152906040528051906020012061336e565b6106b25760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606087901b16602b820152859061070290603f01610626565b61074e5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b8361075887612250565b10156107a65760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722068617320696e73756666696369656e742052504c000000000060448201526064016105d4565b6107b086856133f9565b6107ba85856135d2565b604080518581524260208201526001600160a01b0380881692908916917f3bf4a4ef95ccf3119f6977afa759933d4edd361281f5c3b91203f43104fa3432910160405180910390a3505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306108558260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146108b55760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b8360006108f66040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529192509082169063e667d82890602401602060405180830381865afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d9190613fb3565b15610a8f576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526000919083169063b71f0c7c90602401602060405180830381865afa1580156109e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a099190613fd0565b9050336001600160a01b03821614610a895760405162461bcd60e51b815260206004820152602a60248201527f4d7573742062652063616c6c65642066726f6d2052504c20776974686472617760448201527f616c20616464726573730000000000000000000000000000000000000000000060648201526084016105d4565b50610ae7565b336001600160a01b03831614610ae75760405162461bcd60e51b815260206004820181905260248201527f4d7573742062652063616c6c65642066726f6d206e6f6465206164647265737360448201526064016105d4565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606088901b166033820152610b4d906047015b6040516020818303038152906040528051906020012086613717565b6040805186151581524260208201526001600160a01b038816917f6b33e987d80ef301261d0265922ffe70da2b332f0e097034ce01dbb998cbd01391015b60405180910390a2505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030610be68260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614610c465760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16602b820152610c9490603f01610626565b610ce05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b6000610d206040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015291925060009183169063b71f0c7c90602401602060405180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da99190613fd0565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301529192509083169063e667d82890602401602060405180830381865afa158015610e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e309190613fb3565b15610e9257336001600160a01b03821614610e8d5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642063616c6c657200000000000000000000000000000000000060448201526064016105d4565b610f8f565b600080546040517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b03898116600483015261010090920490911690635b49ff6290602401602060405180830381865afa158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190613fd0565b9050336001600160a01b0388161480610f415750336001600160a01b038216145b610f8d5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642063616c6c657200000000000000000000000000000000000060448201526064016105d4565b505b6000610fcf6040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e677352657761726473815250613274565b905060006110116040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b9050816001600160a01b03166394e5d5126040518163ffffffff1660e01b8152600401602060405180830381865afa158015611051573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110759190613ec1565b61107e89612614565b6110889042613fed565b10156110fc5760405162461bcd60e51b815260206004820152602d60248201527f546865207769746864726177616c20636f6f6c646f776e20706572696f64206860448201527f6173206e6f74207061737365640000000000000000000000000000000000000060648201526084016105d4565b600061110789612250565b905060006111148a613223565b9050886111218284613fed565b10156111955760405162461bcd60e51b815260206004820152603360248201527f5769746864726177616c20616d6f756e742065786365656473206e6f6465277360448201527f207374616b65642052504c2062616c616e63650000000000000000000000000060648201526084016105d4565b8061119f8b611f35565b6111a99190614000565b6111b38a84613fed565b101561124d5760405162461bcd60e51b815260206004820152604860248201527f4e6f64652773207374616b65642052504c2062616c616e63652061667465722060448201527f7769746864726177616c206973206c657373207468616e20726571756972656460648201527f2062616c616e6365000000000000000000000000000000000000000000000000608482015260a4016105d4565b6112568961379f565b6112608a8a6133f9565b826001600160a01b03166301e33667866112ae6040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018c9052606401600060405180830381600087803b15801561131557600080fd5b505af1158015611329573d6000803e3d6000fd5b5050604080518c81524260208201526001600160a01b038e1693507f9947063f70b076145616018b82ed1dd5585e15b7ae0a0b17a8b06bec4c4c31e292500160405180910390a250505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306113c78260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146114275760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b3361147a8160405160200161062691907f6d696e69706f6f6c2e6578697374730000000000000000000000000000000000815260609190911b6bffffffffffffffffffffffff1916600f82015260230190565b6114c65760405162461bcd60e51b815260206004820152601060248201527f496e76616c6964206d696e69706f6f6c0000000000000000000000000000000060448201526064016105d4565b60006115066040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b905060006115486040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b90506000826001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ae9190613ec1565b6115c088670de0b6b3a7640000613f09565b6115ca9190613f20565b905060006115d789612250565b9050808211156115e5578091505b81156116e557826001600160a01b031663ee91035e6116386040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260606004820152601460648201527f726f636b657441756374696f6e4d616e6167657200000000000000000000000060848201526001600160a01b0390911660248201526044810185905260a401600060405180830381600087803b1580156116cc57600080fd5b505af11580156116e0573d6000803e3d6000fd5b505050505b6116ee8261379f565b6116f889836133f9565b6040517f6d696e69706f6f6c2e72706c2e736c617368656400000000000000000000000060208201526bffffffffffffffffffffffff193360601b16603482015261175d90604801604051602081830303815290604052805190602001206001613717565b60408051838152602081018a9052428183015290516001600160a01b038b16917f38a2777b6a84fdb3fc375fe8ade69fdad1afdcdd93c79e7ae2319b806a626c4d919081900360600190a2505050505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306117fe8260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b03161461185e5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f8201526118ab90604301610626565b61191c5760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152600090604a016040516020818303038152906040528051906020012090506000611987826137c9565b9050808511156119d95760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768206c6f636b65642052504c000000000000000000000060448201526064016105d4565b6119ec826119e78784613fed565b613854565b604080518681524260208201526001600160a01b038816917f95f42213e171837caaa6cc7f589ef03a30179b7b85e386dfb146a30c5b10cfa99101610b8b565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e6700000000000000000000000000000081525030611a778260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614611ad75760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b846000611b186040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529192509082169063e667d82890602401602060405180830381865afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190613fb3565b15611cb1576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526000919083169063b71f0c7c90602401602060405180830381865afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2b9190613fd0565b9050336001600160a01b03821614611cab5760405162461bcd60e51b815260206004820152602a60248201527f4d7573742062652063616c6c65642066726f6d2052504c20776974686472617760448201527f616c20616464726573730000000000000000000000000000000000000000000060648201526084016105d4565b50611d09565b336001600160a01b03831614611d095760405162461bcd60e51b815260206004820181905260248201527f4d7573742062652063616c6c65642066726f6d206e6f6465206164647265737360448201526064016105d4565b6040517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208201526bffffffffffffffffffffffff19606089811b8216603684015288901b16604a820152611d6190605e01610b31565b6040805186151581524260208201526001600160a01b0380891692908a16917fb8502fe170368d1312ca3c9feac7aba9cd92406753d7eca9f11df9757081aec5910160405180910390a350505050505050565b611dbe33826129ad565b50565b600080611e026040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b90506000611e446040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613ec1565b905080836001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190613ec1565b611f1887612250565b611f229190613f09565b611f2c9190613f20565b95945050505050565b600080611f766040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b90506000611fb86040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b90506000816001600160a01b0316631e72ba866040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201e9190613ec1565b9050600061048186612e40565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603382015260009061207c90604701610626565b92915050565b611dbe3382610b9b565b600080612098836123ca565b9050806000036120bc576120b5670de0b6b3a76400006002613f09565b9392505050565b60006120df6040518060600160405280602181526020016140f160219139613274565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b8152600401602060405180830381865afa158015612121573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121459190613ec1565b905060006121876040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152919250600091849190841690631844ec0190602401602060405180830381865afa1580156121ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122139190613ec1565b61221d9190613f09565b90506122298582613fed565b61223b670de0b6b3a764000083613f09565b6122459190613f20565b979650505050505050565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606083901b1660368201526000908190604a0160405160208183030381529060405280519060200120905060006122f26040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b9050600080826001600160a01b03166379feb107856040518263ffffffff1660e01b815260040161232591815260200190565b606060405180830381865afa158015612342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123669190614013565b919350909150507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116826104f957612245856137c9565b60006123c57fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a3066137c9565b905090565b60008061240b6040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f6574682e6d6174636865642e6e6f64652e616d6f756e7400000000000000000060208201526bffffffffffffffffffffffff19606086901b166037820152909150600090604b01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b815260040161249f91815260200190565b606060405180830381865afa1580156124bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e09190614013565b92505091508115612512577bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1695945050505050565b600061251d846137c9565b9050801561252f579695505050505050565b600061256f6040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015291925090821690631844ec0190602401602060405180830381865afa1580156125d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f69190613ec1565b6126089067de0b6b3a76400000613f09565b98975050505050505050565b6040517f72706c2e7374616b65642e6e6f64652e74696d6500000000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603482015260009061207c906048015b604051602081830303815290604052805190602001206137c9565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306126c78260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b0316146127275760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f636f6e74726163742e657869737473000000000000000000000000000000000060208201526bffffffffffffffffffffffff193360601b16602f82015261277490604301610626565b6127e55760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206f72206f75746461746564206e6574776f726b20636f6e7460448201527f726163740000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517f72706c2e6c6f636b696e672e616c6c6f7765640000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16603382015261283390604701610626565b61287f5760405162461bcd60e51b815260206004820152601f60248201527f4e6f6465206973206e6f7420616c6c6f77656420746f206c6f636b2052504c0060448201526064016105d4565b600061288a85612250565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606088901b166036820152909150600090604a0160405160208183030381529060405280519060200120905060006128f8826137c9565b9050856129058285613fed565b10156129535760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207374616b65642052504c000000000000000000000060448201526064016105d4565b612961826119e78884614000565b604080518781524260208201526001600160a01b038916917fce4a5a05852c75132c79a7a41af76ced563f8391e69eea41a0b38214c4e847cf910160405180910390a250505050505050565b6040518060400160405280601181526020017f726f636b65744e6f64655374616b696e67000000000000000000000000000000815250306129f88260405160200161055d9190613f5b565b6001600160a01b0316816001600160a01b031614612a585760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e74726163740000000060448201526064016105d4565b6040517f6e6f64652e65786973747300000000000000000000000000000000000000000060208201526bffffffffffffffffffffffff19606086901b16602b8201528490612aa890603f01610626565b612af45760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206e6f6465000000000000000000000000000000000000000060448201526064016105d4565b6040517f636f6e74726163742e616464726573730000000000000000000000000000000060208201527f726f636b65744d65726b6c654469737472696275746f724d61696e6e657400006030820152612b4f90604e0161055d565b6001600160a01b0316336001600160a01b031614612e2f576000612ba76040518060400160405280601181526020017f726f636b65744e6f64654d616e61676572000000000000000000000000000000815250613274565b6040517fe667d8280000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015291925060009183169063e667d82890602401602060405180830381865afa158015612c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c309190613fb3565b15612cd0576040517fb71f0c7c0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526000919084169063b71f0c7c90602401602060405180830381865afa158015612c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cbc9190613fd0565b6001600160a01b031633149150612d839050565b600080546040517f5b49ff620000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015261010090920490911690635b49ff6290602401602060405180830381865afa158015612d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5e9190613fd0565b9050336001600160a01b0389161480612d7f5750336001600160a01b038216145b9150505b80612e2c576040517f6e6f64652e7374616b652e666f722e616c6c6f7765640000000000000000000060208201526bffffffffffffffffffffffff19606089811b8216603684015233901b16604a820152612de090605e01610626565b612e2c5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420616c6c6f77656420746f207374616b6520666f72000000000000000060448201526064016105d4565b50505b612e3985856138a9565b5050505050565b600080612e816040518060400160405280601581526020017f726f636b65744d696e69706f6f6c4d616e616765720000000000000000000000815250613274565b6040517f1844ec010000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152919250600091831690631844ec0190602401602060405180830381865afa158015612ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0a9190613ec1565b90506000612f17856123ca565b90508015612fc2576000612f426040518060600160405280602181526020016140f160219139613274565b90506000816001600160a01b03166308e50d386040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa89190613ec1565b90506000612fb68286613f09565b90506126088482613fed565b611f2c8267de0b6b3a76400000613f09565b6000806130156040518060400160405280601381526020017f726f636b65744e6574776f726b50726963657300000000000000000000000000815250613274565b905060006130576040518060400160405280601d81526020017f726f636b657444414f50726f746f636f6c53657474696e67734e6f6465000000815250613274565b9050600061306485612250565b90506000613071866123ca565b9050600061307e87612e40565b90506000856001600160a01b031663724d4a096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156130c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e49190613ec1565b90506000856001600160a01b0316631e72ba866040518163ffffffff1660e01b8152600401602060405180830381865afa158015613126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314a9190613ec1565b90506000826131598386613f09565b6131639190613f20565b90508086111561317a579998505050505050505050565b6000876001600160a01b0316636fdbe57b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131de9190613ec1565b90506000846131ed8389613f09565b6131f79190613f20565b905080881015613213575060009b9a5050505050505050505050565b50959a9950505050505050505050565b6040517f72706c2e6c6f636b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606083901b16603682015260009061207c90604a01612661565b60008061328b8360405160200161055d9190613f5b565b90506001600160a01b03811661207c5760405162461bcd60e51b815260206004820152601260248201527f436f6e7472616374206e6f7420666f756e64000000000000000000000000000060448201526064016105d4565b600080546040517f21f8a721000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b0316906321f8a72190602401602060405180830381865afa15801561334a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613fd0565b600080546040517f7ae1cfca000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b031690637ae1cfca90602401602060405180830381865afa1580156133d5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613fb3565b60006134396040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152909150600090604a01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b81526004016134cd91815260200190565b606060405180830381865afa1580156134ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061350e9190614013565b92505091508161352457613521836137c9565b90505b6001600160a01b038416635ba596498461353e888561407f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166024820152604401600060405180830381600087803b1580156135b257600080fd5b505af11580156135c6573d6000803e3d6000fd5b50505050505050505050565b60006136126040518060400160405280601681526020017f726f636b65744e6574776f726b536e617073686f747300000000000000000000815250613274565b6040517f72706c2e7374616b65642e6e6f64652e616d6f756e740000000000000000000060208201526bffffffffffffffffffffffff19606086901b166036820152909150600090604a01604051602081830303815290604052805190602001209050600080836001600160a01b03166379feb107846040518263ffffffff1660e01b81526004016136a691815260200190565b606060405180830381865afa1580156136c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136e79190614013565b9250509150816136fd576136fa836137c9565b90505b6001600160a01b038416635ba596498461353e88856140bb565b6000546040517fabfdcced0000000000000000000000000000000000000000000000000000000081526004810184905282151560248201526101009091046001600160a01b03169063abfdcced906044015b600060405180830381600087803b15801561378357600080fd5b505af1158015613797573d6000803e3d6000fd5b505050505050565b611dbe7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682613c3e565b600080546040517fbd02d0f5000000000000000000000000000000000000000000000000000000008152600481018490526101009091046001600160a01b03169063bd02d0f590602401602060405180830381865afa158015613830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c9190613ec1565b6000546040517fe2a4853a00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063e2a4853a90604401613769565b60006138e96040518060400160405280600e81526020017f726f636b6574546f6b656e52504c000000000000000000000000000000000000815250613274565b9050600061392b6040518060400160405280600b81526020017f726f636b65745661756c74000000000000000000000000000000000000000000815250613274565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101859052909150829082906001600160a01b038316906323b872dd906064016020604051808303816000875af115801561399e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c29190613fb3565b613a345760405162461bcd60e51b815260206004820152602a60248201527f436f756c64206e6f74207472616e736665722052504c20746f207374616b696e60448201527f6720636f6e74726163740000000000000000000000000000000000000000000060648201526084016105d4565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820187905283169063095ea7b3906044016020604051808303816000875af1158015613a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ac09190613fb3565b613b325760405162461bcd60e51b815260206004820152602360248201527f436f756c64206e6f7420617070726f7665207661756c742052504c206465706f60448201527f736974000000000000000000000000000000000000000000000000000000000060648201526084016105d4565b6040517ff444295800000000000000000000000000000000000000000000000000000000815260606004820152601160648201527f726f636b65744e6f64655374616b696e6700000000000000000000000000000060848201526001600160a01b0383811660248301526044820187905282169063f44429589060a401600060405180830381600087803b158015613bc957600080fd5b505af1158015613bdd573d6000803e3d6000fd5b50505050613bea85613c93565b613bf486866135d2565b613bfe8642613cbd565b604080518681524260208201526001600160a01b038816917f4e3bcb61bb8e63cb9ed2c46d47eeb6ae847c629e909fbb32b9d17874affb4a899101610b8b565b6000546040517febb9d8c900000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063ebb9d8c990604401613769565b611dbe7fe9120b7223ae2a37e3e3d2dfb439c54ebbdeabe89bce6d355f59122854c4a30682613d22565b6040517f72706c2e7374616b65642e6e6f64652e74696d6500000000000000000000000060208201526bffffffffffffffffffffffff19606084901b16603482015261050e906048016040516020818303038152906040528051906020012082613854565b6000546040517fadb353dc00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526101009091046001600160a01b03169063adb353dc90604401613769565b6001600160a01b0381168114611dbe57600080fd5b600060208284031215613d9e57600080fd5b81356120b581613d77565b8015158114611dbe57600080fd5b60008060408385031215613dca57600080fd5b8235613dd581613d77565b91506020830135613de581613da9565b809150509250929050565b600080600060608486031215613e0557600080fd5b8335613e1081613d77565b92506020840135613e2081613d77565b929592945050506040919091013590565b60008060408385031215613e4457600080fd5b8235613e4f81613d77565b946020939093013593505050565b600080600060608486031215613e7257600080fd5b8335613e7d81613d77565b92506020840135613e8d81613d77565b91506040840135613e9d81613da9565b809150509250925092565b600060208284031215613eba57600080fd5b5035919050565b600060208284031215613ed357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761207c5761207c613eda565b600082613f56577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f636f6e74726163742e616464726573730000000000000000000000000000000081526000825160005b81811015613fa25760208186018101516010868401015201613f85565b506000920160100191825250919050565b600060208284031215613fc557600080fd5b81516120b581613da9565b600060208284031215613fe257600080fd5b81516120b581613d77565b8181038181111561207c5761207c613eda565b8082018082111561207c5761207c613eda565b60008060006060848603121561402857600080fd5b835161403381613da9565b602085015190935063ffffffff8116811461404d57600080fd5b60408501519092507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81168114613e9d57600080fd5b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8281168282160390808211156140b4576140b4613eda565b5092915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8181168382160190808211156140b4576140b4613eda56fe726f636b657444414f50726f746f636f6c53657474696e67734d696e69706f6f6ca2646970667358221220ac53aa41ded1c628ce09609959b0e1b8888dd49661772123efba6639c47dd1ea64736f6c63430008120033
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
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.