@@ -6,8 +6,7 @@ pragma solidity 0.5.17;
66 * @dev Governance owned registry of approved contracts and roles.
77 */
88contract Registry {
9-
10- enum ContractStatus { New, Approved, Disabled }
9+ enum ContractStatus {New, Approved, Disabled}
1110
1211 // Governance role is to enable recovery from key compromise by rekeying other roles.
1312 address internal governance;
@@ -36,7 +35,10 @@ contract Registry {
3635 event GovernanceUpdated ();
3736 event RegistryKeeperUpdated ();
3837 event PanicButtonUpdated ();
39- event OperatorContractUpgraderUpdated (address serviceContract , address upgrader );
38+ event OperatorContractUpgraderUpdated (
39+ address serviceContract ,
40+ address upgrader
41+ );
4042
4143 modifier onlyGovernance () {
4244 require (governance == msg .sender , "Not authorized " );
@@ -74,12 +76,21 @@ contract Registry {
7476 emit PanicButtonUpdated ();
7577 }
7678
77- function setOperatorContractUpgrader (address _serviceContract , address _operatorContractUpgrader ) public onlyGovernance {
79+ function setOperatorContractUpgrader (
80+ address _serviceContract ,
81+ address _operatorContractUpgrader
82+ ) public onlyGovernance {
7883 operatorContractUpgraders[_serviceContract] = _operatorContractUpgrader;
79- emit OperatorContractUpgraderUpdated (_serviceContract, _operatorContractUpgrader);
84+ emit OperatorContractUpgraderUpdated (
85+ _serviceContract,
86+ _operatorContractUpgrader
87+ );
8088 }
8189
82- function approveOperatorContract (address operatorContract ) public onlyRegistryKeeper {
90+ function approveOperatorContract (address operatorContract )
91+ public
92+ onlyRegistryKeeper
93+ {
8394 require (
8495 isNewOperatorContract (operatorContract),
8596 "Only new operator contracts can be approved "
@@ -89,7 +100,10 @@ contract Registry {
89100 emit OperatorContractApproved (operatorContract);
90101 }
91102
92- function disableOperatorContract (address operatorContract ) public onlyPanicButton {
103+ function disableOperatorContract (address operatorContract )
104+ public
105+ onlyPanicButton
106+ {
93107 require (
94108 isApprovedOperatorContract (operatorContract),
95109 "Only approved operator contracts can be disabled "
@@ -99,15 +113,27 @@ contract Registry {
99113 emit OperatorContractDisabled (operatorContract);
100114 }
101115
102- function isNewOperatorContract (address operatorContract ) public view returns (bool ) {
116+ function isNewOperatorContract (address operatorContract )
117+ public
118+ view
119+ returns (bool )
120+ {
103121 return operatorContracts[operatorContract] == ContractStatus.New;
104122 }
105123
106- function isApprovedOperatorContract (address operatorContract ) public view returns (bool ) {
124+ function isApprovedOperatorContract (address operatorContract )
125+ public
126+ view
127+ returns (bool )
128+ {
107129 return operatorContracts[operatorContract] == ContractStatus.Approved;
108130 }
109131
110- function operatorContractUpgraderFor (address _serviceContract ) public view returns (address ) {
132+ function operatorContractUpgraderFor (address _serviceContract )
133+ public
134+ view
135+ returns (address )
136+ {
111137 return operatorContractUpgraders[_serviceContract];
112138 }
113139}
0 commit comments