Skip to main content

ContractStorage

Trait ContractStorage 

Source
pub trait ContractStorage {
    // Required methods
    fn address(&self) -> Address;
    fn storage(&self) -> &StorageCtx;
    fn storage_mut(&mut self) -> &mut StorageCtx;

    // Provided method
    fn is_initialized(&self) -> Result<bool> { ... }
}
Expand description

Trait providing access to a contract’s address.

Automatically implemented by the #[contract] macro.

Required Methods§

Source

fn address(&self) -> Address

Contract address.

Source

fn storage(&self) -> &StorageCtx

Contract storage accessor.

Source

fn storage_mut(&mut self) -> &mut StorageCtx

Contract storage mutable accessor.

Provided Methods§

Source

fn is_initialized(&self) -> Result<bool>

Returns true if the contract has been initialized (has bytecode deployed).

Implementors§