Skip to content

Commit

Permalink
Remove upgrade path
Browse files Browse the repository at this point in the history
  • Loading branch information
kanewallmann committed Jul 16, 2024
1 parent a08da96 commit fb53ec9
Show file tree
Hide file tree
Showing 69 changed files with 243 additions and 4,460 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ contract RocketDAOProtocolSettingsNode is RocketDAOProtocolSettings, RocketDAOPr
setSettingBool("node.vacant.minipools.enabled", false);
setSettingUint("node.per.minipool.stake.minimum", 0.1 ether); // 10% of user ETH value (matched ETH)
setSettingUint("node.per.minipool.stake.maximum", 1.5 ether); // 150% of node ETH value (provided ETH)
setSettingUint("node.voting.power.stake.maximum", 1.5 ether); // 150% of node ETH value (provided ETH)
// Settings initialised
setBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ contract RocketDAOProtocolSettingsProposals is RocketDAOProtocolSettings, Rocket

constructor(RocketStorageInterface _rocketStorageAddress) RocketDAOProtocolSettings(_rocketStorageAddress, "proposals") {
version = 1;
// Initialize settings on deployment
if(!getBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")))) {
// Init settings
setSettingUint("proposal.vote.phase1.time", 1 weeks); // How long a proposal can be voted on in phase 1
setSettingUint("proposal.vote.phase2.time", 1 weeks); // How long a proposal can be voted on in phase 2
setSettingUint("proposal.vote.delay.time", 1 weeks); // How long before a proposal can be voted on after it is created
setSettingUint("proposal.execute.time", 4 weeks); // How long a proposal can be executed after its voting period is finished
setSettingUint("proposal.bond", 100 ether); // The amount of RPL a proposer has to put up as a bond for creating a new proposal
setSettingUint("proposal.challenge.bond", 10 ether); // The amount of RPL a challenger has to put up as a bond for challenging a proposal
setSettingUint("proposal.challenge.period", 30 minutes); // The amount of time a proposer has to respond to a challenge before a proposal is defeated
setSettingUint("proposal.quorum", 0.51 ether); // The quorum required to pass a proposal
setSettingUint("proposal.veto.quorum", 0.51 ether); // The quorum required to veto a proposal
setSettingUint("proposal.max.block.age", 1024); // The maximum age of a block a proposal can be raised at
// Settings initialised
setBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")), true);
}
}

/// @notice Update a setting, overrides inherited setting method with extra checks for this contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ contract RocketDAOProtocolSettingsSecurity is RocketDAOProtocolSettings, RocketD

constructor(RocketStorageInterface _rocketStorageAddress) RocketDAOProtocolSettings(_rocketStorageAddress, "security") {
version = 1;
// Initialize settings on deployment
if(!getBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")))) {
// Init settings
setSettingUint("members.quorum", 0.5 ether); // Member quorum threshold that must be met for proposals to pass (51%)
setSettingUint("members.leave.time", 4 weeks); // How long a member must give notice for before manually leaving the security council
setSettingUint("proposal.vote.time", 2 weeks); // How long a proposal can be voted on
setSettingUint("proposal.execute.time", 4 weeks); // How long a proposal can be executed after its voting period is finished
setSettingUint("proposal.action.time", 4 weeks); // Certain proposals require a secondary action to be run after the proposal is successful (joining, leaving etc). This is how long until that action expires

// Default permissions for security council
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "deposit", "deposit.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "deposit", "deposit.assign.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "minipool", "minipool.submit.withdrawable.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "minipool", "minipool.bond.reduction.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "network", "network.submit.balances.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "network", "network.submit.prices.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "node", "node.registration.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "node", "node.smoothing.pool.registration.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "node", "node.deposit.enabled")), true);
setBool(keccak256(abi.encodePacked("dao.security.allowed.setting", "node", "node.vacant.minipools.enabled")), true);

setBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")), true);
}
}

/// @dev Overrides inherited setting method with extra sanity checks for this contract
Expand Down
6 changes: 6 additions & 0 deletions contracts/contract/network/RocketNetworkSnapshots.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ contract RocketNetworkSnapshots is RocketBase, RocketNetworkSnapshotsInterface {
constructor(RocketStorageInterface _rocketStorageAddress) RocketBase(_rocketStorageAddress) {
// Set contract version
version = 1;

// Setup for if this contract is being deployed as part of a new instance deployment
if (!rocketStorage.getDeployedStatus()) {
_insert(keccak256("network.prices.rpl"), 0.01 ether);
_insert(keccak256("node.voting.power.stake.maximum"), 1.5 ether);
}
}

function push(bytes32 _key, uint224 _value) onlyLatestContract("rocketNetworkSnapshots", address(this)) onlyLatestNetworkContract external {
Expand Down
2 changes: 2 additions & 0 deletions contracts/contract/rewards/RocketMerkleDistributorMainnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ contract RocketMerkleDistributorMainnet is RocketBase, RocketMerkleDistributorMa
// Precompute keys
rocketVaultKey = keccak256(abi.encodePacked("contract.address", "rocketVault"));
rocketTokenRPLKey = keccak256(abi.encodePacked("contract.address", "rocketTokenRPL"));
// Set this contract as the relay for network 0
setAddress(keccak256(abi.encodePacked("rewards.relay.address", uint256(0))), address(this));
}

// Called by RocketRewardsPool to include a snapshot into this distributor
Expand Down
Loading

0 comments on commit fb53ec9

Please sign in to comment.