use ink::primitives::AccountId;
use ink::{contract_ref, env::DefaultEnvironment};
pub type OwnableRef = contract_ref!(Ownable, DefaultEnvironment);
#[ink::trait_definition]
pub trait Ownable {
#[ink(message)]
fn owner(&self) -> Option<AccountId>;
#[ink(message)]
fn renounce_ownership(&mut self) -> Result<(), OwnableError>;
#[ink(message)]
fn transfer_ownership(
&mut self,
new_owner: AccountId,
) -> Result<(), OwnableError>;
}
pub trait OwnableStorage {
fn owner(&self) -> Option<AccountId>;
fn set_owner(&mut self, new_owner: &Option<AccountId>);
}
pub trait OwnableInternal {
fn _owner(&self) -> Option<AccountId>;
fn _update_owner(&mut self, owner: &Option<AccountId>);
fn _only_owner(&self) -> Result<(), OwnableError>;
}