-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathParams.sol
62 lines (51 loc) · 1.7 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
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
contract Params {
bool public initialized;
// System contracts
address
public constant ValidatorContractAddr = payable(0x000000000000000000000000000000000000f000);
address
public constant PunishContractAddr = 0x000000000000000000000000000000000000F001;
address
public constant ProposalAddr = 0x000000000000000000000000000000000000F002;
// System params
uint16 public MaxValidators = 1000;
// Validator have to wait StakingLockPeriod blocks to withdraw staking
uint64 public StakingLockPeriod = 86400;
// Validator have to wait WithdrawProfitPeriod blocks to withdraw his profits
//uint64 public constant WithdrawProfitPeriod = 28800;
uint256 public MinimalStakingCoin = 32 ether;
uint256 public minimumValidatorStaking = 1000000 * 1e18;
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");
_;
}
}