Controlled.sol
1 pragma solidity ^0.5.2; 2 3 4 contract Controlled { 5 /// @notice The address of the controller is the only address that can call 6 /// a function with this modifier 7 modifier onlyController { 8 require(msg.sender == controller, "Unauthorized"); 9 _; 10 } 11 12 address payable public controller; 13 14 constructor() internal { 15 controller = msg.sender; 16 } 17 18 /// @notice Changes the controller of the contract 19 /// @param _newController The new controller of the contract 20 function changeController(address payable _newController) external onlyController { 21 controller = _newController; 22 } 23 }