mirror of
https://github.com/status-im/discover-dapps.git
synced 2025-03-02 02:50:28 +00:00
22 lines
637 B
Solidity
22 lines
637 B
Solidity
|
pragma solidity ^0.5.1;
|
||
|
|
||
|
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");
|
||
|
_;
|
||
|
}
|
||
|
|
||
|
address payable public controller;
|
||
|
|
||
|
constructor() internal {
|
||
|
controller = msg.sender;
|
||
|
}
|
||
|
|
||
|
/// @notice Changes the controller of the contract
|
||
|
/// @param _newController The new controller of the contract
|
||
|
function changeController(address payable _newController) public onlyController {
|
||
|
controller = _newController;
|
||
|
}
|
||
|
}
|