Skip to content

Commit

Permalink
Simply (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 authored Aug 9, 2024
1 parent 75212f0 commit c2bab93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 104 deletions.
48 changes: 9 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,30 @@

## Koi
```
Multisig Plugin Setup: 0xC93c3931a2045FCb9C2280f710717900F9C14fBc
TokenVoting Plugin Setup: 0x91943aa31Db7c43761318F0191156044c0f86021
OptimisticTokenVoting Plugin Setup: 0x71111E17BC5597595d80b2fEc787fAbAD69a98e2
Multisig Plugin Repo: 0xee93c838B32b70680f36f43652b643712e4ED28f
TokenVoting Plugin Repo: 0x1149E11017DE9C0D1943B7B764134dB4640DC7b3
OptimisticTokenVoting Plugin Repo: 0x733b9C8d6762d3FAC6C2Ee61F55971492644C0D7
Ring DAO: 0x638A95b929977bFe720290e12C71B3901d310afE
TokenVoting Plugin Setup: 0xDd571cd0E2b3Ee0f27D6C5C4D991Aefd6AFE10bC
TokenVoting Plugin Repo: 0x1576A49553E4a57515688392b88489DAa0271e9c
Ring DAO: 0x5791F849b27cf3d3794eAA2aDECa00f475508d20
Installed Plugins:
- 0x005D4B92F66dB792b375c274550b11BE41BD93eB
- 0x875D59D1058425F0c945e9193B29638c5622e657
- 0xE4615D1F35B5A589c65a5A1720E1b65A3965aB18
- 0xbD7837d84C5028B81b0CDFEc699f53F5C9594422
```

## Optimistic Token Voting plugin
## Token Voting plugin

This plugin is an adapted version of Aragon's [Optimistic Token Voting plugin](https://github.com/aragon/optimistic-token-voting-plugin).
This plugin is an adapted version of Aragon's [Token Voting plugin](https://github.com/aragon/osx/tree/v1.3.0/packages/contracts/src/plugins/governance/majority-voting/token).

Only addresses that have been granted `PROPOSER_PERMISSION_ID` on the plugin can create proposals. These adresses belong to the multisig's governed by the Security Council.
Only community members(who owns enough tokens or has enough voting power from being a delegatee) can create proposals.

Proposals can only be executed when the veto threshold hasn't been reached after a minimum period of time.
Proposals can only be executed when the support threshold and minimum participation have been reached after a minimum period of time.

The governance settings need to be defined when the plugin is installed but the DAO can update them at any time.

### Permissions

- Only proposers can create proposals on the plugin
- Only community members can create proposals on the plugin
- The plugin can execute actions on the DAO
- The DAO can update the plugin settings
- The DAO can upgrade the plugin

## Standard Multisig

It allows the Security Council members to create and approve proposals. After a certain minimum of approvals is met, proposals can be relayed to the [Optimistic Token Voting plugin](#optimistic-token-voting-plugin) only.

![Standard proposal flow](./img/std-proposal-flow.png)

### Permissions

- Only members can create proposals
- Only members can approve
- The plugin can only create proposals on the [Optimistic Token Voting plugin](#optimistic-token-voting-plugin) provided that the `duration` is equal or greater than the minimum defined
- The DAO can update the plugin settings

## Emergency Multisig

Like before, this plugin allows Security Council members to create and approve proposals. If a super majority approves, proposals can be executed immediately.

### Permissions

- Only members can create proposals
- Only members can approve
- The plugin can execute actions on the DAO immediately
- The DAO can update the plugin settings

## DO's and DONT's

- Never grant `ROOT_PERMISSION` unless you are just trying things out
Expand Down
70 changes: 5 additions & 65 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,18 @@ import {PluginRepo} from "@aragon/osx/framework/plugin/repo/PluginRepo.sol";
import {hashHelpers, PluginSetupRef} from "@aragon/osx/framework/plugin/setup/PluginSetupProcessorHelpers.sol";
import {MajorityVotingBase} from "@aragon/osx/plugins/governance/majority-voting/MajorityVotingBase.sol";

import {MultisigPluginSetup, Multisig} from "../src/plugins/multisig/MultisigPluginSetup.sol";
import {TokenVotingPluginSetup} from "../src/plugins/token-voting/TokenVotingPluginSetup.sol";
import {
OptimisticTokenVotingPluginSetup,
OptimisticTokenVotingPlugin
} from "../src/plugins/optimistic-token-voting/OptimisticTokenVotingPluginSetup.sol";

contract Deploy is Script {
address gRING = 0x87BD07263D0Ed5687407B80FEB16F2E32C2BA44f;
address multisigPlugin = 0x005D4B92F66dB792b375c274550b11BE41BD93eB;
address maintainer = 0x0f14341A7f464320319025540E8Fe48Ad0fe5aec;

address pluginRepoFactory;
DAOFactory daoFactory;
address[] pluginAddress;

MultisigPluginSetup multisigPluginSetup;
TokenVotingPluginSetup tokenVotingPluginSetup;
OptimisticTokenVotingPluginSetup optimisticTokenVotingPluginSetup;

PluginRepo multisigPluginRepo;
PluginRepo tokenVotingPluginRepo;
PluginRepo optimisticTokenVotingPluginRepo;

DAO ringDAO;

function setUp() public {
Expand All @@ -44,6 +32,8 @@ contract Deploy is Script {
function run() public {
vm.startBroadcast();

require(msg.sender == maintainer, "!maintainer");

console2.log("Chain ID:", block.chainid);
console2.log("Deploying from:", msg.sender);

Expand Down Expand Up @@ -75,12 +65,8 @@ contract Deploy is Script {
vm.stopBroadcast();

// 7. Logging the resulting addresses
console2.log("Multisig Plugin Setup: ", address(multisigPluginSetup));
console2.log("TokenVoting Plugin Setup: ", address(tokenVotingPluginSetup));
console2.log("OptimisticTokenVoting Plugin Setup: ", address(optimisticTokenVotingPluginSetup));
console2.log("Multisig Plugin Repo: ", address(multisigPluginRepo));
console2.log("TokenVoting Plugin Repo: ", address(tokenVotingPluginRepo));
console2.log("OptimisticTokenVoting Plugin Repo: ", address(optimisticTokenVotingPluginRepo));
console2.log("Ring DAO: ", address(ringDAO));
console2.log("Installed Plugins: ");
for (uint256 i = 0; i < pluginAddress.length; i++) {
Expand All @@ -89,32 +75,14 @@ contract Deploy is Script {
}

function deployPluginSetup() public {
multisigPluginSetup = new MultisigPluginSetup();
tokenVotingPluginSetup = new TokenVotingPluginSetup();
optimisticTokenVotingPluginSetup = new OptimisticTokenVotingPluginSetup();
}

function deployPluginRepo() public {
multisigPluginRepo = PluginRepoFactory(pluginRepoFactory).createPluginRepoWithFirstVersion(
string.concat("ringdao-multisig-", vm.toString(block.timestamp)),
address(multisigPluginSetup),
msg.sender,
hex"12", // TODO: Give these actual values on prod
hex"34"
);

tokenVotingPluginRepo = PluginRepoFactory(pluginRepoFactory).createPluginRepoWithFirstVersion(
string.concat("ringdao-token-voting-", vm.toString(block.timestamp)),
address(tokenVotingPluginSetup),
msg.sender,
hex"12", // TODO: Give these actual values on prod
hex"34"
);

optimisticTokenVotingPluginRepo = PluginRepoFactory(pluginRepoFactory).createPluginRepoWithFirstVersion(
string.concat("ringdao-optimistic-token-voting-", vm.toString(block.timestamp)),
address(optimisticTokenVotingPluginSetup),
msg.sender,
maintainer,
hex"12", // TODO: Give these actual values on prod
hex"34"
);
Expand All @@ -125,21 +93,8 @@ contract Deploy is Script {
}

function getPluginSettings() public view returns (DAOFactory.PluginSettings[] memory pluginSettings) {
pluginSettings = new DAOFactory.PluginSettings[](3);
pluginSettings[0] = getMultisigPluginSetting();
pluginSettings[1] = getTokenVotingPluginSetting();
pluginSettings[2] = getOptimisticTokenVotingPluginSetting();
}

function getMultisigPluginSetting() public view returns (DAOFactory.PluginSettings memory) {
address[] memory members = new address[](1);
members[0] = maintainer;
bytes memory pluginSettingsData = abi.encode(
members,
Multisig.MultisigSettings({onlyListed: true, minApprovals: 1, destinationProposalDuration: 60 minutes})
);
PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1);
return DAOFactory.PluginSettings(PluginSetupRef(tag, multisigPluginRepo), pluginSettingsData);
pluginSettings = new DAOFactory.PluginSettings[](1);
pluginSettings[0] = getTokenVotingPluginSetting();
}

function getTokenVotingPluginSetting() public view returns (DAOFactory.PluginSettings memory) {
Expand All @@ -156,19 +111,4 @@ contract Deploy is Script {
PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1);
return DAOFactory.PluginSettings(PluginSetupRef(tag, tokenVotingPluginRepo), pluginSettingsData);
}

function getOptimisticTokenVotingPluginSetting() public view returns (DAOFactory.PluginSettings memory) {
address[] memory proposers = new address[](1);
proposers[0] = multisigPlugin;
bytes memory pluginSettingsData = abi.encode(
OptimisticTokenVotingPlugin.OptimisticGovernanceSettings({
minVetoRatio: 500_000, // 50%
minDuration: 60 minutes
}),
OptimisticTokenVotingPluginSetup.TokenSettings({addr: gRING, underlyingTotalSupply: 1_000_000_000e18}),
proposers
);
PluginRepo.Tag memory tag = PluginRepo.Tag(1, 1);
return DAOFactory.PluginSettings(PluginSetupRef(tag, optimisticTokenVotingPluginRepo), pluginSettingsData);
}
}

0 comments on commit c2bab93

Please sign in to comment.