Skip to main content

OwnableContract

Interface representing ownable functionality for smart contracts.

The OwnableContract interface extends SmartContract and provides methods to ensure that only the owner can perform certain actions and to allow the transfer of ownership to a new owner.

By implementing the Ownable interface, contracts can secure critical operations and provide a transparent mechanism for ownership management.

Index

Methods

ensureOwnerSignature

  • ensureOwnerSignature(): Promise<AccountUpdate>
  • Ensures that the transaction is authorized by the contract owner. Typically used to restrict access to sensitive functions.


    Returns Promise<AccountUpdate>

    A promise that resolves to an AccountUpdate, representing the action of ensuring the owner's signature.

transferOwnership

  • transferOwnership(newOwner: PublicKey): Promise<PublicKey>
  • Transfers ownership of the contract to a new owner.


    Parameters

    • newOwner: PublicKey

      The public key of the new owner.

    Returns Promise<PublicKey>

    A promise that resolves to the public key of the old owner.

Page Options