Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy on Crab #4

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
- 0x1756B204a72e1B879D9C63b47f31640a57b8c727
```

## Crab
```
Delegation Wall: 0x7479798bD9A2972afB4Da5FF9f88bd18Daf546a1
Delegation Announcer: 0x05FFdA9C7FD9E30e49e420b0AA6c1772f94e83A7
TokenVoting Plugin Setup: 0x879BD4Ca5158cE3b1Fc419D4e7789503923F3d76
TokenVoting Plugin Repo: 0x5eB66e31b5Bf40D074aB149643E69ca3fee4Fb7A
CrabDAO: 0x663fC3000f0101BF16FDc9F73F02DA6Efa8c5875
Installed Plugins:
- 0xFF335B8aF2B601d09A499199705Ed3E7bdADa66E
```

## 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).
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ optimizer_runs = 999999
evm_version = "london"
bytecode_hash = "ipfs"
extra_output_files = ["metadata"]
eth_rpc_url = "https://koi-rpc.darwinia.network"
eth_rpc_url = "https://crab-rpc.darwinia.network"
etherscan_api_key = "xxx"

[rpc_endpoints]
Expand Down
31 changes: 22 additions & 9 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {MajorityVotingBase} from "@aragon/osx/plugins/governance/majority-voting

import {TokenVotingPluginSetup} from "../src/plugins/token-voting/TokenVotingPluginSetup.sol";
import {DelegationWall} from "../src/DelegationWall.sol";
import {DelegateAnnouncer} from "../src/DelegateAnnouncer.sol";

contract Deploy is Script {
address gRING = 0xdafa555e2785DC8834F4Ea9D1ED88B6049142999;
Expand All @@ -22,6 +23,7 @@ contract Deploy is Script {
address[] pluginAddress;

DelegationWall delegationWall;
DelegateAnnouncer delegateAnnouncer;
TokenVotingPluginSetup tokenVotingPluginSetup;
PluginRepo tokenVotingPluginRepo;
DAO ringDAO;
Expand All @@ -40,6 +42,7 @@ contract Deploy is Script {
console2.log("Deploying from:", msg.sender);

delegationWall = new DelegationWall();
delegateAnnouncer = new DelegateAnnouncer();

// 1. Deploying the Plugin Setup
deployPluginSetup();
Expand Down Expand Up @@ -70,9 +73,10 @@ contract Deploy is Script {

// 7. Logging the resulting addresses
console2.log("Delegation Wall: ", address(delegationWall));
console2.log("Delegation Announcer: ", address(delegateAnnouncer));
console2.log("TokenVoting Plugin Setup: ", address(tokenVotingPluginSetup));
console2.log("TokenVoting Plugin Repo: ", address(tokenVotingPluginRepo));
console2.log("Ring DAO: ", address(ringDAO));
console2.log("RingDAO: ", address(ringDAO));
console2.log("Installed Plugins: ");
for (uint256 i = 0; i < pluginAddress.length; i++) {
console2.log("- ", pluginAddress[i]);
Expand All @@ -83,9 +87,9 @@ contract Deploy is Script {
if (block.chainid == 701) {
return 400e18;
} else if (block.chainid == 44) {
revert("TODO");
return 20_000_000e18;
} else if (block.chainid == 46) {
return 40000000e18;
return 40_000_000e18;
}
}

Expand All @@ -96,16 +100,25 @@ contract Deploy is Script {

function deployPluginRepo() public {
tokenVotingPluginRepo = PluginRepoFactory(pluginRepoFactory).createPluginRepoWithFirstVersion(
string.concat("ringdao-token-voting-", vm.toString(block.timestamp)),
string.concat("ringdao-token-voting-", vm.toString(block.chainid)),
address(tokenVotingPluginSetup),
maintainer,
hex"12", // TODO: Give these actual values on prod
hex"34"
"QmZYBxHyEd8emirXHQovFDUokGyabyKXBu7hfX7GES6ziT",
"QmScsjGhLeAuwhTpqcfY6ya1h1j4LT4hWJFJP3sQjHVyVr"
);
}

function getDAOSettings() public view returns (DAOFactory.DAOSettings memory) {
return DAOFactory.DAOSettings(address(0), "", string.concat("governance-", vm.toString(block.timestamp)), "");
if (block.chainid == 701) {
return
DAOFactory.DAOSettings(address(0), "", string.concat("governance-", vm.toString(block.timestamp)), "");
} else if (block.chainid == 44) {
// crab-vote.ring-dao.eth
return DAOFactory.DAOSettings(address(0), "", "crab-vote", "");
// vote.ring-dao.eth
} else if (block.chainid == 46) {
return DAOFactory.DAOSettings(address(0), "", "vote", "");
}
}

function getPluginSettings() public view returns (DAOFactory.PluginSettings[] memory pluginSettings) {
Expand All @@ -119,8 +132,8 @@ contract Deploy is Script {
votingMode: MajorityVotingBase.VotingMode.Standard,
supportThreshold: 500_000, // 50%
minParticipation: 1, // 0.0001%
minDuration: 60 minutes,
minProposerVotingPower: 1e18
minDuration: 2 weeks,
minProposerVotingPower: 1_000_000e18
}),
TokenVotingPluginSetup.TokenSettings({addr: gRING})
);
Expand Down
Loading