* add prettier-solidity + config * run prettier * update lockfile * run prettier again * Prettier missed one /: * keep bridge adapter the same * yarn prettier
57 lines
1.6 KiB
Solidity
57 lines
1.6 KiB
Solidity
// SPDX-License-Identifier: Apache-2.0
|
|
/*
|
|
|
|
Copyright 2019 ZeroEx Intl.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
pragma solidity ^0.6.5;
|
|
|
|
import "./interfaces/IOwnableV06.sol";
|
|
import "./errors/LibRichErrorsV06.sol";
|
|
import "./errors/LibOwnableRichErrorsV06.sol";
|
|
|
|
contract OwnableV06 is IOwnableV06 {
|
|
/// @dev The owner of this contract.
|
|
/// @return 0 The owner address.
|
|
address public override owner;
|
|
|
|
constructor() public {
|
|
owner = msg.sender;
|
|
}
|
|
|
|
modifier onlyOwner() {
|
|
_assertSenderIsOwner();
|
|
_;
|
|
}
|
|
|
|
/// @dev Change the owner of this contract.
|
|
/// @param newOwner New owner address.
|
|
function transferOwnership(address newOwner) public override onlyOwner {
|
|
if (newOwner == address(0)) {
|
|
LibRichErrorsV06.rrevert(LibOwnableRichErrorsV06.TransferOwnerToZeroError());
|
|
} else {
|
|
owner = newOwner;
|
|
emit OwnershipTransferred(msg.sender, newOwner);
|
|
}
|
|
}
|
|
|
|
function _assertSenderIsOwner() internal view {
|
|
if (msg.sender != owner) {
|
|
LibRichErrorsV06.rrevert(LibOwnableRichErrorsV06.OnlyOwnerError(msg.sender, owner));
|
|
}
|
|
}
|
|
}
|