-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParams.sol
73 lines (59 loc) · 2.26 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
73
// 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 constant MaxValidators = 21;
// Validator have to wait StakingLockPeriod blocks to withdraw staking
uint64 public constant StakingLockPeriod = 86400;
// Validator have to wait WithdrawProfitPeriod blocks to withdraw his profits
uint64 public constant WithdrawProfitPeriod = 28800;
uint256 public constant MinimalStakingCoin = 1000 ether;
// minimum initial staking to become a validator
uint256 public constant minimumValidatorStaking = 100000 ether;
// percent distrubution of Gas Fee earned by validator 100000 = 100%
uint public constant stakerPartPercent = 20000; //20%
uint public constant validatorPartPercent = 70000; //70%
uint public constant burnPartPercent = 10000; //10%
uint public constant contractPartPercent = 0; //0%
uint public constant burnStopAmount = 100000000000 ether; // after 10,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");
_;
}
}