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§
Sourcefn storage(&self) -> &StorageCtx
fn storage(&self) -> &StorageCtx
Contract storage accessor.
Sourcefn storage_mut(&mut self) -> &mut StorageCtx
fn storage_mut(&mut self) -> &mut StorageCtx
Contract storage mutable accessor.
Provided Methods§
Sourcefn is_initialized(&self) -> Result<bool>
fn is_initialized(&self) -> Result<bool>
Returns true if the contract has been initialized (has bytecode deployed).