access-control:transfer-ownership
Transfer ownership of an Ownable contract. On Ownable2Step contracts this stages the pending owner, who must then accept.
Syntax
Section titled “Syntax”access-control:transfer-ownership <contract> <newOwner>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
contract |
address |
Ownable contract address |
newOwner |
address |
New owner address |
Examples
Section titled “Examples”load access-control
# Hand over a token contract to the DAO treasuryaccess-control:transfer-ownership 0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72 0x4F2083f5fBede34C2714aFfb3105539775f7FE64- Must be sent by the current owner.
- On plain
Ownablecontracts the transfer is immediate. OnOwnable2Stepcontracts this only stages the pending owner, who must then run access-control:accept-ownership; passing the zero address cancels a pending transfer.
See Also
Section titled “See Also”- access-control:accept-ownership — finalize a two-step transfer
- @access-control.owner — read the current owner
- @access-control.pendingOwner — read the pending owner