summaryrefslogtreecommitdiffstats
path: root/contracts/Governance.sol
blob: e93ec87926729ce760bc6e1fe0b3d8590a789777 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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: minStake
    uint256 public minStake;

    // 10: blockReward.
    uint256 public blockReward;

    // 11: blockGasLimit.
    uint256 public blockGasLimit;

    // 12: Network related.
    uint256 public numChains;

    // Lambda related.
    // 13
    uint256 public lambdaBA;
    // 14
    uint256 public lambdaDKG;

    // Total ordering related.
    // 15
    uint256 public k;
    // 16
    uint256 public phiRatio;  // stored as PhiRatio * 10^6

    // Set related.
    // 17
    uint256 public notarySetSize;
    // 18
    uint256 public dkgSetSize;

    // Time related.
    // 19
    uint256 public roundInterval;
    // 20
    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 MinStake,
        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) {
    }
}