mirror of
https://github.com/status-im/contracts.git
synced 2025-02-23 20:18:42 +00:00
add events
This commit is contained in:
parent
d6ee98f43f
commit
2a06243124
@ -1,6 +1,7 @@
|
|||||||
pragma solidity >=0.5.0 <0.6.0;
|
pragma solidity >=0.5.0 <0.6.0;
|
||||||
|
|
||||||
contract Controlled {
|
contract Controlled {
|
||||||
|
event NewController(address controller);
|
||||||
/// @notice The address of the controller is the only address that can call
|
/// @notice The address of the controller is the only address that can call
|
||||||
/// a function with this modifier
|
/// a function with this modifier
|
||||||
modifier onlyController {
|
modifier onlyController {
|
||||||
@ -18,5 +19,6 @@ contract Controlled {
|
|||||||
/// @param _newController The new controller of the contract
|
/// @param _newController The new controller of the contract
|
||||||
function changeController(address payable _newController) public onlyController {
|
function changeController(address payable _newController) public onlyController {
|
||||||
controller = _newController;
|
controller = _newController;
|
||||||
|
emit NewController(_newController);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ pragma solidity >=0.5.0 <0.6.0;
|
|||||||
/// @dev `Owned` is a base level contract that assigns an `owner` that can be
|
/// @dev `Owned` is a base level contract that assigns an `owner` that can be
|
||||||
/// later changed
|
/// later changed
|
||||||
contract Owned {
|
contract Owned {
|
||||||
|
event OwnerChanged(address newOwner);
|
||||||
|
|
||||||
/// @dev `owner` is the only address that can call a function with this
|
/// @dev `owner` is the only address that can call a function with this
|
||||||
/// modifier
|
/// modifier
|
||||||
@ -24,6 +25,7 @@ contract Owned {
|
|||||||
/// @param _newOwner The address of the new owner. 0x0 can be used to create
|
/// @param _newOwner The address of the new owner. 0x0 can be used to create
|
||||||
/// an unowned neutral vault, however that cannot be undone
|
/// an unowned neutral vault, however that cannot be undone
|
||||||
function changeOwner(address payable _newOwner) public onlyOwner {
|
function changeOwner(address payable _newOwner) public onlyOwner {
|
||||||
|
emit OwnerChanged(_newOwner);
|
||||||
newOwner = _newOwner;
|
newOwner = _newOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user