CCIP v2.0.0 IOwnable API Reference
IOwnable defines a minimal interface for managing contract ownership using a two-step transfer process.
If you implement this interface, ownership is transferred by proposing a new owner and requiring that owner to explicitly accept the role.
This interface is used by contracts to expose ownership control and is not typically used directly by applications.
Usage Boundary
You typically do not interact with this interface directly.
- Contracts implement this interface to expose ownership functionality.
- Administrative tooling or contract owners call these functions to manage ownership.
- You are responsible for correctly handling ownership transitions to avoid loss of control.
Contract
@chainlink/contracts/src/v0.8/shared/interfaces/IOwnable.sol
Import
import {IOwnable} from "@chainlink/contracts/src/v0.8/shared/interfaces/IOwnable.sol";
Interface surface
interface IOwnable {
owner
function owner() external view returns (address);
Returns the current owner of the contract.
transferOwnership
function transferOwnership(address recipient) external;
Proposes a new owner.
- Does not immediately transfer ownership.
- The proposed owner must call
acceptOwnershipto complete the transfer.
acceptOwnership
function acceptOwnership() external;
Accepts ownership of the contract.
- Can only be called by the proposed owner.
- Completes the ownership transfer.
}
Notes
- Ownership transfer follows a two-step process: propose → accept.
- Until
acceptOwnershipis called, the current owner retains control. - Proposing an incorrect address may result in loss of control if the new owner accepts.
- Ownership must be actively accepted to take effect.