View Source: contracts/Dependencies/Ownable.sol
↘ Derived Contracts: ActivePoolStorage, BorrowerOperationsStorage, CollSurplusPoolStorage, DefaultPoolStorage, FeeDistributorStorage, HintHelpersStorage, IMasset, LiquityBaseParams, MultiTroveGetterStorage, NueToken, PriceFeedStorage, Proxy, SortedTrovesStorage, StabilityPoolStorage, TroveManagerStorage, ZUSDToken
Ownable
Contract module which provides a basic access control mechanism, where
there is an account (an owner) that can be granted exclusive access to
specific functions.
This module is used through inheritance. It will make available the modifier
onlyOwner
, which can be applied to your functions to restrict their use to
the owner.
Constants & Variables
bytes32 private constant KEY_OWNER;
Events
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Throws if called by any account other than the owner.
modifier onlyOwner() internal
Initializes the contract setting the deployer as the initial owner.
function () internal nonpayable
Source Code
constructor () internal {
_setOwner(msg.sender);
}
Set address of the owner.
function _setOwner(address _owner) internal nonpayable
Arguments
Name | Type | Description |
---|---|---|
_owner | address | Address of the owner. |
Source Code
function _setOwner(address _owner) internal {
require(_owner != address(0), "Ownable::setOwner: invalid address");
emit OwnershipTransferred(getOwner(), _owner);
bytes32 key = KEY_OWNER;
assembly {
sstore(key, _owner)
}
}
Set address of the owner (only owner can call this function)
function setOwner(address _owner) public nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
_owner | address | Address of the owner. |
Source Code
function setOwner(address _owner) public onlyOwner {
_setOwner(_owner);
}
Return address of the owner.
function getOwner() public view
returns(_owner address)
Source Code
function getOwner() public view returns (address _owner) {
bytes32 key = KEY_OWNER;
assembly {
_owner := sload(key)
}
}
- ActivePool
- ActivePoolStorage
- BaseMath
- BorrowerOperations
- BorrowerOperationsScript
- BorrowerOperationsStorage
- BorrowerWrappersScript
- CheckContract
- CollSurplusPool
- CollSurplusPoolStorage
- console
- Context
- DefaultPool
- DefaultPoolStorage
- DocsCover
- DSAuth
- DSAuthEvents
- DSAuthority
- DSNote
- DSProxy
- DSProxyCache
- DSProxyFactory
- ERC20
- ETHTransferScript
- FeeDistributor
- FeeDistributorStorage
- GasPool
- HintHelpers
- HintHelpersStorage
- IActivePool
- IBalanceRedirectPresale
- IBorrowerOperations
- ICollSurplusPool
- IDefaultPool
- IERC20
- IERC2612
- IExternalPriceFeed
- IFeeDistributor
- IFeeSharingProxy
- ILiquityBase
- ILiquityBaseParams
- IMasset
- IMoCBaseOracle
- Initializable
- IPool
- IPriceFeed
- IRSKOracle
- ISortedTroves
- IStabilityPool
- ITroveManager
- IWrbtc
- IZUSDToken
- LiquityBase
- LiquityBaseParams
- LiquityMath
- LiquitySafeMath128
- MoCMedianizer
- MultiTroveGetter
- MultiTroveGetterStorage
- NueToken
- Ownable
- PriceFeed
- PriceFeedStorage
- ProxiableContract
- ProxiableContract2
- Proxy
- RskOracle
- SafeMath
- SortedTroves
- SortedTrovesStorage
- StabilityPool
- StabilityPoolScript
- StabilityPoolStorage
- Storage
- Storage2
- TokenScript
- TroveManager
- TroveManagerBase
- TroveManagerBase1MinuteBootstrap
- TroveManagerRedeemOps
- TroveManagerScript
- TroveManagerStorage
- UpgradableProxy
- ZUSDToken
- ZUSDTokenStorage