pub trait AddressAllocatorExt {
// Required methods
fn address_allocator_new(
&mut self,
method_context: MethodContext,
contract: Address,
) -> Result<(), ContractError>;
fn address_allocator_allocate_address(
&mut self,
method_context: MethodContext,
contract: Address,
) -> Result<Address, ContractError>;
}
Expand description
Extension trait that provides helper methods for calling AddressAllocator
’s methods on Env
for convenience purposes
Required Methods§
Sourcefn address_allocator_new(
&mut self,
method_context: MethodContext,
contract: Address,
) -> Result<(), ContractError>
fn address_allocator_new( &mut self, method_context: MethodContext, contract: Address, ) -> Result<(), ContractError>
Initialize address allocator for a shard
Sourcefn address_allocator_allocate_address(
&mut self,
method_context: MethodContext,
contract: Address,
) -> Result<Address, ContractError>
fn address_allocator_allocate_address( &mut self, method_context: MethodContext, contract: Address, ) -> Result<Address, ContractError>
Allocate a new address for a contract.
This can only be called by [Address::SYSTEM_CODE
] contract.