forked from Uniswap/v4-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Owned.sol
29 lines (23 loc) · 784 Bytes
/
Owned.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.19;
contract Owned {
address public owner;
bytes12 private STORAGE_PLACEHOLDER;
error InvalidCaller();
/// @notice Emitted when the owner of the factory is changed
/// @param oldOwner The owner before the owner was changed
/// @param newOwner The owner after the owner was changed
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
modifier onlyOwner() {
if (msg.sender != owner) revert InvalidCaller();
_;
}
constructor() {
owner = msg.sender;
emit OwnerChanged(address(0), msg.sender);
}
function setOwner(address _owner) external onlyOwner {
emit OwnerChanged(owner, _owner);
owner = _owner;
}
}