2020-07-24 19:16:01 -03:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
|
|
pragma solidity 0.5.11;
|
2018-04-23 01:58:58 -03:00
|
|
|
|
|
|
|
contract Controlled {
|
|
|
|
/// @notice The address of the controller is the only address that can call
|
|
|
|
/// a function with this modifier
|
2020-07-24 19:16:01 -03:00
|
|
|
modifier onlyController {
|
|
|
|
require(msg.sender == controller, "Unauthorized");
|
|
|
|
_;
|
2018-04-23 01:58:58 -03:00
|
|
|
}
|
|
|
|
|
2020-07-24 19:16:01 -03:00
|
|
|
address payable public controller;
|
2018-04-23 01:58:58 -03:00
|
|
|
|
2020-07-24 19:16:01 -03:00
|
|
|
constructor() internal {
|
|
|
|
controller = msg.sender;
|
2018-04-23 01:58:58 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
/// @notice Changes the controller of the contract
|
|
|
|
/// @param _newController The new controller of the contract
|
2020-07-24 19:16:01 -03:00
|
|
|
function changeController(address payable _newController) public onlyController {
|
2018-04-23 01:58:58 -03:00
|
|
|
controller = _newController;
|
|
|
|
}
|
|
|
|
}
|