Skip to main content

Ownable

Ownable

Thirdweb's Ownable is a contract extension to be used with any base contract. It exposes functions for setting and reading who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses information about who the contract's owner is.

Methods​

owner​

function owner() external view returns (address)

Returns the owner of the contract.

Returns​

NameTypeDescription
_0addressundefined

setOwner​

function setOwner(address _newOwner) external nonpayable

Lets an authorized wallet set a new owner for the contract.

Parameters​

NameTypeDescription
_newOwneraddressThe address to set as the new owner of the contract.

Events​

OwnerUpdated​

event OwnerUpdated(address indexed prevOwner, address indexed newOwner)

Parameters​

NameTypeDescription
prevOwner indexedaddressundefined
newOwner indexedaddressundefined