ens-usernames/contracts/common/Controlled.sol

25 lines
670 B
Solidity
Raw Normal View History

// 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
modifier onlyController {
require(msg.sender == controller, "Unauthorized");
_;
2018-04-23 01:58:58 -03:00
}
address payable public controller;
2018-04-23 01:58:58 -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
function changeController(address payable _newController) public onlyController {
2018-04-23 01:58:58 -03:00
controller = _newController;
}
}