-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGxCallableByDeploymentAdmin.sol
More file actions
37 lines (29 loc) · 1.04 KB
/
GxCallableByDeploymentAdmin.sol
File metadata and controls
37 lines (29 loc) · 1.04 KB
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
pragma solidity ^0.4.2;
import './GxAccountsInterface.sol';
// Implements "callableByDeploymentAdmin" modifier
contract GxCallableByDeploymentAdmin {
GxAccountsInterface public deploymentAdmins;
function GxCallableByDeploymentAdmin(address deploymentAdminsAddress) {
if (deploymentAdminsAddress == 0x0) {
throw;
}
deploymentAdmins = GxAccountsInterface(deploymentAdminsAddress);
}
modifier callableByDeploymentAdmin {
if (isDeploymentAdmin(msg.sender)) {
_;
} else {
throw;
}
}
function isDeploymentAdmin(address accountAddress) public constant returns (bool _i) {
return deploymentAdmins.contains(accountAddress);
}
function setDeploymentAdminsContract(address newDeploymentAdmins) public callableByDeploymentAdmin {
deploymentAdmins = GxAccountsInterface(newDeploymentAdmins);
}
// Function to recover the funds on the contract
function kill() callableByDeploymentAdmin {
selfdestruct(msg.sender);
}
}