summaryrefslogtreecommitdiffstats
path: root/contracts/Governance.sol
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-03 23:21:56 +0800
committerWei-Ning Huang <w@dexon.org>2018-11-06 22:10:47 +0800
commit9765af47cc79f9698945835d6d885999a054dbad (patch)
treea9f0b72e5fbf199b0e571091d84aa3fcdc7d9352 /contracts/Governance.sol
parenta6d7513fc97b16d8f21d5032899e38a7cc81eca6 (diff)
downloaddexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar.gz
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar.bz2
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar.lz
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar.xz
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.tar.zst
dexon-governance-abi-9765af47cc79f9698945835d6d885999a054dbad.zip
contracts: add Governance contract signatures
Diffstat (limited to 'contracts/Governance.sol')
-rw-r--r--contracts/Governance.sol141
1 files changed, 141 insertions, 0 deletions
diff --git a/contracts/Governance.sol b/contracts/Governance.sol
new file mode 100644
index 0000000..43b8e35
--- /dev/null
+++ b/contracts/Governance.sol
@@ -0,0 +1,141 @@
+pragma solidity ^0.4.11;
+
+contract Governance {
+ // Nodes
+ struct Node {
+ address owner;
+ bytes publicKey;
+ uint256 staked;
+ string name;
+ string email;
+ string location;
+ string url;
+ }
+
+ // 0: round to blockHeight mapping.
+ uint256[] public roundHeight;
+
+ // 1: nodes.
+ Node[] public nodes;
+
+ // 2: stores the array index of nodes + 1
+ mapping(address => uint256) public offset;
+
+ // 3: CRS.
+ bytes32[] public crs;
+
+ // 4: dkgMasterPublicKeys
+ bytes[][] public dkgMasterPublicKeys;
+
+ // 5: dkgComplaints
+ bytes[][] public dkgComplaints;
+
+ // 6: dkgFinalizeds
+ mapping(address => bool)[] public dkgFinalizeds;
+
+ // 7: dkgFinalizedsCount
+ uint256[] public dkgFinalizedsCount;
+
+ // 8: owner address.
+ address public owner;
+
+ // 9: blockReward.
+ uint256 public blockReward;
+
+ // 10: blockGasLimit.
+ uint256 public blockGasLimit;
+
+ // 11: Network related.
+ uint256 public numChains;
+
+ // Lambda related.
+ // 12
+ uint256 public lambdaBA;
+ // 13
+ uint256 public lambdaDKG;
+
+ // Total ordering related.
+ // 14
+ uint256 public k;
+ // 15
+ uint256 public phiRatio; // stored as PhiRatio * 10^6
+
+ // Set related.
+ // 16
+ uint256 public notarySetSize;
+ // 17
+ uint256 public dkgSetSize;
+
+ // Time related.
+ // 18
+ uint256 public roundInterval;
+ // 19
+ uint256 public minBlockInterval;
+
+ // ----------
+ // Modifiers.
+ // ----------
+ modifier onlyOwner() {
+ require(msg.sender == owner);
+ _;
+ }
+
+ // ----------
+ // Events.
+ // ----------
+ event ConfigurationChanged();
+ event CRSProposed(uint256 indexed round, bytes32 crs);
+
+ // transferOwnership()
+ function transferOwnership(address newOwner) onlyOwner {
+ }
+
+ // UpdateConfiguration(...)
+ function updateConfiguration(
+ uint256 BlockReward,
+ uint256 BlockGasLimit,
+ uint256 NumChains,
+ uint256 LambdaBA,
+ uint256 LambdaDKG,
+ uint256 K,
+ uint256 PhiRatio,
+ uint256 NotarySetSize,
+ uint256 DKGSetSize,
+ uint256 RoundInterval,
+ uint256 MinBlockInterval)
+ public onlyOwner {
+ }
+
+ // SnapshotRound(round, height)
+ function snapshotRound(uint256 Round, uint256 Height) public {
+ }
+
+ // ProposeCRS(signedCRS)
+ function proposeCRS(uint256 Round, bytes SignedCRS) public {
+ }
+
+ // AddDKGComplaint(round, complaint)
+ function addDKGComplaint(uint256 Round, bytes Complaint) public {
+ }
+
+ // AddDKGMasterPublicKey(round, key)
+ function addDKGMasterPublicKey(uint256 Round, bytes PublicKey) public {
+ }
+
+ // AddDKGFinalize(round, finalize)
+ function addDKGFinalize(uint256 Round, bytes Finalize) public {
+ }
+
+ // Stake(public_key)
+ function stake(bytes PublicKey, string Name, string Email,
+ string Location, string Url) public payable {
+ }
+
+ // Unstake()
+ function unstake() public {
+ }
+
+ // Return number of nodes.
+ function nodesLength() view public returns (uint256) {
+ }
+}