pub struct Ownable2StepHostRef { /* private fields */ }Expand description
Ownable2Step Host Ref.
Implementations§
Source§impl Ownable2StepHostRef
impl Ownable2StepHostRef
Sourcepub fn init(&mut self, owner: Address)
pub fn init(&mut self, owner: Address)
Initializes the module setting an owner as the initial owner.
Sourcepub fn get_pending_owner(&self) -> Option<Address>
pub fn get_pending_owner(&self) -> Option<Address>
Returns the address of the pending owner.
Sourcepub fn transfer_ownership(&mut self, new_owner: &Address)
pub fn transfer_ownership(&mut self, new_owner: &Address)
Starts the ownership transfer of the module to a new_owner.
Replaces the pending_ownerif there is one.
This function can only be accessed by the current owner of the module.
Sourcepub fn renounce_ownership(&mut self)
pub fn renounce_ownership(&mut self)
If the contract’s owner chooses to renounce their ownership, the contract will no longer have an owner. This means that any functions that can only be accessed by the owner will no longer be available.
The function can only be called by the current owner, and it will permanently remove the owner’s privileges.
Sourcepub fn accept_ownership(&mut self)
pub fn accept_ownership(&mut self)
The new owner accepts the ownership transfer. Replaces the current owner and clears the pending owner.
Sourcepub fn assert_owner(&self, address: &Address)
pub fn assert_owner(&self, address: &Address)
Reverts with if the function called by any account other than the owner.
Source§impl Ownable2StepHostRef
impl Ownable2StepHostRef
Sourcepub fn try_init(&mut self, owner: Address) -> OdraResult<()>
pub fn try_init(&mut self, owner: Address) -> OdraResult<()>
Initializes the module setting an owner as the initial owner.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_get_owner(&self) -> OdraResult<Address>
pub fn try_get_owner(&self) -> OdraResult<Address>
Returns the address of the current owner.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_get_pending_owner(&self) -> OdraResult<Option<Address>>
pub fn try_get_pending_owner(&self) -> OdraResult<Option<Address>>
Returns the address of the pending owner.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_transfer_ownership(&mut self, new_owner: &Address) -> OdraResult<()>
pub fn try_transfer_ownership(&mut self, new_owner: &Address) -> OdraResult<()>
Starts the ownership transfer of the module to a new_owner.
Replaces the pending_ownerif there is one.
This function can only be accessed by the current owner of the module.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_renounce_ownership(&mut self) -> OdraResult<()>
pub fn try_renounce_ownership(&mut self) -> OdraResult<()>
If the contract’s owner chooses to renounce their ownership, the contract will no longer have an owner. This means that any functions that can only be accessed by the owner will no longer be available.
The function can only be called by the current owner, and it will permanently
remove the owner’s privileges.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_accept_ownership(&mut self) -> OdraResult<()>
pub fn try_accept_ownership(&mut self) -> OdraResult<()>
The new owner accepts the ownership transfer. Replaces the current owner and clears
the pending owner.
Does not fail in case of error, returns odra::OdraResult instead.
Sourcepub fn try_assert_owner(&self, address: &Address) -> OdraResult<()>
pub fn try_assert_owner(&self, address: &Address) -> OdraResult<()>
Reverts with if the function called by any account other than the owner.
Does not fail in case of error, returns odra::OdraResult instead.
Trait Implementations§
Source§impl EntryPointsCallerProvider for Ownable2StepHostRef
impl EntryPointsCallerProvider for Ownable2StepHostRef
Source§fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
Source§impl HasIdent for Ownable2StepHostRef
impl HasIdent for Ownable2StepHostRef
Source§impl HostRef for Ownable2StepHostRef
impl HostRef for Ownable2StepHostRef
Source§fn new(address: Address, env: HostEnv) -> Self
fn new(address: Address, env: HostEnv) -> Self
Source§fn with_tokens(&self, tokens: U512) -> Self
fn with_tokens(&self, tokens: U512) -> Self
Source§fn contract_address(&self) -> Address
fn contract_address(&self) -> Address
Source§fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
Source§fn last_call(&self) -> ContractCallResult
fn last_call(&self) -> ContractCallResult
Auto Trait Implementations§
impl Freeze for Ownable2StepHostRef
impl !RefUnwindSafe for Ownable2StepHostRef
impl !Send for Ownable2StepHostRef
impl !Sync for Ownable2StepHostRef
impl Unpin for Ownable2StepHostRef
impl !UnwindSafe for Ownable2StepHostRef
Blanket Implementations§
Source§impl<T> Addressable for Twhere
T: HostRef,
impl<T> Addressable for Twhere
T: HostRef,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more