23 lines
638 B
Solidity
Raw Normal View History

2018-12-11 00:13:51 -02:00
pragma solidity ^0.5.0;
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
modifier onlyController {
2018-12-11 00:13:51 -02:00
require(msg.sender == controller, "Unauthorized");
2018-04-23 01:58:58 -03:00
_;
}
2018-12-11 00:13:51 -02:00
address payable public controller;
2018-04-23 01:58:58 -03:00
2018-12-11 00:13:51 -02:00
constructor() internal {
2018-04-23 01:58:58 -03:00
controller = msg.sender;
}
/// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract
2018-12-11 00:13:51 -02:00
function changeController(address payable _newController) public onlyController {
2018-04-23 01:58:58 -03:00
controller = _newController;
}
}