-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParams.sol
72 lines (57 loc) · 2.04 KB
/
Params.sol
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
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
contract Params {
bool public initialized;
// System contracts
address
public constant ValidatorContractAddr = 0x000000000000000000000000000000000000f000;
address
public constant PunishContractAddr = 0x000000000000000000000000000000000000F001;
address
public constant ProposalAddr = 0x000000000000000000000000000000000000F002;
// System params
uint16 public MaxValidators = 30;
// Validator have to wait StakingLockPeriod blocks to withdraw staking
uint64 public constant StakingLockPeriod = 86400;
uint256 public MinimalStakingCoin = 50000 ether;
// minimum initial staking to become a validator
uint256 public minimumValidatorStaking = 500000 ether;
// percent distrubution of Gas Fee earned by validator 100000 = 100%
uint public stakerPartPercent = 0; //0%
uint public validatorPartPercent = 0; //0%
uint public burnPartPercent = 100000; //100%
uint public contractPartPercent = 0; //0%
uint public burnStopAmount = 250000000 ether; // after 250,000,000 coins burn, it will stop burning
uint public totalBurnt;
modifier onlyMiner() {
require(msg.sender == block.coinbase, "Miner only");
_;
}
modifier onlyNotInitialized() {
require(!initialized, "Already initialized");
_;
}
modifier onlyInitialized() {
require(initialized, "Not init yet");
_;
}
modifier onlyPunishContract() {
require(msg.sender == PunishContractAddr, "Punish contract only");
_;
}
modifier onlyBlockEpoch(uint256 epoch) {
require(block.number % epoch == 0, "Block epoch only");
_;
}
modifier onlyValidatorsContract() {
require(
msg.sender == ValidatorContractAddr,
"Validators contract only"
);
_;
}
modifier onlyProposalContract() {
require(msg.sender == ProposalAddr, "Proposal contract only");
_;
}
}