forked from Synthetixio/synthetix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDappMaintenance.sol
45 lines (37 loc) · 1.4 KB
/
DappMaintenance.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
pragma solidity ^0.5.16;
import "./Owned.sol";
// https://docs.synthetix.io/contracts/source/contracts/dappmaintenance
/**
* @title DappMaintenance contract.
* @dev When the Synthetix system is on maintenance (upgrade, release...etc) the dApps also need
* to be put on maintenance so no transactions can be done. The DappMaintenance contract is here to keep a state of
* the dApps which indicates if yes or no, they should be up or down.
*/
contract DappMaintenance is Owned {
bool public isPausedStaking = false;
bool public isPausedSX = false;
/**
* @dev Constructor
*/
constructor(address _owner) public Owned(_owner) {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}
function setMaintenanceModeAll(bool isPaused) external onlyOwner {
isPausedStaking = isPaused;
isPausedSX = isPaused;
emit StakingMaintenance(isPaused);
emit SXMaintenance(isPaused);
}
function setMaintenanceModeStaking(bool isPaused) external onlyOwner {
isPausedStaking = isPaused;
emit StakingMaintenance(isPausedStaking);
}
function setMaintenanceModeSX(bool isPaused) external onlyOwner {
isPausedSX = isPaused;
emit SXMaintenance(isPausedSX);
}
event StakingMaintenance(bool isPaused);
event SXMaintenance(bool isPaused);
}