This contract is a modified version of the
OwnableUnset.sol implementation, where transferring and renouncing ownership works as a 2-step process. This can be used as a confirmation mechanism to prevent potential mistakes when transferring ownership of the contract, where the control of the contract could be lost forever. (e.g: providing the wrong address as a parameter to the function, transferring ownership to an EOA for which the user lost its private key, etc...)
Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally.
The number of block that MUST pass before one is able to confirm renouncing ownership.
|Number of blocks.|
The number of blocks during which one can renounce ownership.
|Number of blocks.|
function acceptOwnership() external nonpayable;
msg.sender is accepting ownership of contract:
- This function can only be called by the
function owner() external view returns (address);
Returns the address of the current owner.
If no ownership transfer is in progress, the pendingOwner will be
function pendingOwner() external view returns (address);
The address that ownership of the contract is transferred to. This address may use
acceptOwnership() to gain ownership of the contract.
Leaves the contract without an owner. Once ownership of the contract has been renounced, any function that is restricted to be called only by the owner will be permanently inaccessible, making these functions not callable anymore and unusable.
function renounceOwnership() external nonpayable;
msg.sender is renouncing ownership of contract
Renounce ownership of the contract in a 2-step process.
The first call will initiate the process of renouncing ownership.
The second call is used as a confirmation and will leave the contract without an owner.
function transferOwnership(address newOwner) external nonpayable;
Transfer ownership initiated by
Initiate the process of transferring ownership of the contract by setting the new owner as the pending owner. If the new owner is a contract that supports + implements LSP1, this will also attempt to notify the new owner that ownership has been transferred to them by calling the
universalReceiver() function on the
newOwnercannot accept ownership of the contract in the same transaction. (For instance, via a callback from its
|The address of the new owner.|
Any method labeled as
internal serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs.
Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities.
function _checkOwner() internal view;
Throws if the sender is not the owner.
function _setOwner(address newOwner) internal nonpayable;
Changes the owner if
newOwner and oldOwner are different
This pattern is useful in inheritance.
function _transferOwnership(address newOwner) internal nonpayable;
Set the pending owner of the contract and cancel any renounce ownership process that was previously started.
newOwnercannot be the address of the contract itself.
|The address of the new pending owner.|
function _acceptOwnership() internal nonpayable;
Set the pending owner of the contract as the new owner.
function _renounceOwnership() internal nonpayable;
Initiate or confirm the process of renouncing ownership after a specific delay of blocks have passed.
Successfully renounced ownership of the contract. This contract is now owned by anyone, it's owner is
Emitted when the ownership of the contract has been renounced.
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
The transfer of ownership of the contract was initiated. Pending new owner set to:
|The address of the previous owner.|
|The address of the new owner.|
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Ownership renouncement initiated.
Emitted when starting the
renounceOwnership(..) 2-step process.
error LSP14CallerNotPendingOwner(address caller);
Reverts when the
caller that is trying to accept ownership of the contract is not the pending owner.
|The address that tried to accept ownership.|
Cannot transfer ownership to the address of the contract itself.
Reverts when trying to transfer ownership to the
Cannot accept ownership in the same transaction with
Reverts when pending owner accept ownership in the same transaction of transferring ownership.
Cannot confirm ownership renouncement yet. The ownership renouncement is allowed from:
Reverts when trying to renounce ownership before the initial confirmation delay.
|The start timestamp when one can confirm the renouncement of ownership.|
|The end timestamp when one can confirm the renouncement of ownership.|
error OwnableCallerNotTheOwner(address callerAddress);
Reverts when only the owner is allowed to call the function.
|The address that tried to make the call.|