pub struct DCTSystemSmartContractProxy<SA>
where SA: SendApi + 'static,
{ pub api: SA, }
Expand description

Proxy for the DCT system smart contract. Unlike other contract proxies, this one has a fixed address, so the proxy object doesn’t really contain any data, it is more of a placeholder.

Fields§

§api: SA

Implementations§

source§

impl<SA> DCTSystemSmartContractProxy<SA>
where SA: SendApi + 'static,

source

pub fn new_proxy_obj(api: SA) -> Self

Constructor. TODO: consider moving this to a new Proxy contructor trait (bonus: better proxy constructor syntax).

source§

impl<SA> DCTSystemSmartContractProxy<SA>
where SA: SendApi + 'static,

source

pub fn issue_fungible( self, issue_cost: BigUint<SA>, token_display_name: &ManagedBuffer<SA>, token_ticker: &ManagedBuffer<SA>, initial_supply: &BigUint<SA>, properties: FungibleTokenProperties ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to issue a new fungible DCT token.

source

pub fn issue_non_fungible( self, issue_cost: BigUint<SA>, token_display_name: &ManagedBuffer<SA>, token_ticker: &ManagedBuffer<SA>, properties: NonFungibleTokenProperties ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to issue a new non-fungible DCT token.

source

pub fn issue_semi_fungible( self, issue_cost: BigUint<SA>, token_display_name: &ManagedBuffer<SA>, token_ticker: &ManagedBuffer<SA>, properties: SemiFungibleTokenProperties ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to issue a new semi-fungible DCT token.

source

pub fn register_meta_dct( self, issue_cost: BigUint<SA>, token_display_name: &ManagedBuffer<SA>, token_ticker: &ManagedBuffer<SA>, properties: MetaTokenProperties ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to register a new Meta DCT token.

source

pub fn mint( self, token_identifier: &TokenIdentifier<SA>, amount: &BigUint<SA> ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to mint more fungible DCT tokens. It will fail if the SC is not the owner of the token.

source

pub fn burn( self, token_identifier: &TokenIdentifier<SA>, amount: &BigUint<SA> ) -> ContractCall<SA, ()>

Produces a contract call to the DCT system SC, which causes it to burn fungible DCT tokens owned by the SC.

source

pub fn pause( self, token_identifier: &TokenIdentifier<SA> ) -> ContractCall<SA, ()>

The manager of an DCT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping.

source

pub fn unpause( self, token_identifier: &TokenIdentifier<SA> ) -> ContractCall<SA, ()>

The reverse operation of pause.

source

pub fn freeze( self, token_identifier: &TokenIdentifier<SA>, address: &ManagedAddress<SA> ) -> ContractCall<SA, ()>

The manager of an DCT token may freeze the tokens held by a specific account. As a consequence, no tokens may be transferred to or from the frozen account. Freezing and unfreezing the tokens of an account are operations designed to help token managers to comply with regulations.

source

pub fn unfreeze( self, token_identifier: &TokenIdentifier<SA>, address: &ManagedAddress<SA> ) -> ContractCall<SA, ()>

The reverse operation of freeze, unfreezing, will allow further transfers to and from the account.

source

pub fn wipe( self, token_identifier: &TokenIdentifier<SA>, address: &ManagedAddress<SA> ) -> ContractCall<SA, ()>

The manager of an DCT token may wipe out all the tokens held by a frozen account. This operation is similar to burning the tokens, but the account must have been frozen beforehand, and it must be done by the token manager. Wiping the tokens of an account is an operation designed to help token managers to comply with regulations.

source

pub fn change_sft_to_meta_dct( self, token_identifier: &TokenIdentifier<SA>, num_decimals: usize ) -> ContractCall<SA, ()>

This function converts an SFT to a metaDCT by adding decimals to its structure in the metachain DCT System SC. This function as almost all in case of DCT can be called only by the owner.

source

pub fn set_special_roles<RoleIter: Iterator<Item = DctLocalRole>>( self, address: &ManagedAddress<SA>, token_identifier: &TokenIdentifier<SA>, roles_iter: RoleIter ) -> ContractCall<SA, ()>

This function can be called only if canSetSpecialRoles was set to true. The metachain system SC will evaluate the arguments and call “DCTSetRole@tokenId@listOfRoles” for the given address. This will be actually a cross shard call. This function as almost all in case of DCT can be called only by the owner.

source

pub fn unset_special_roles<RoleIter: Iterator<Item = DctLocalRole>>( self, address: &ManagedAddress<SA>, token_identifier: &TokenIdentifier<SA>, roles_iter: RoleIter ) -> ContractCall<SA, ()>

This function can be called only if canSetSpecialRoles was set to true. The metachain system SC will evaluate the arguments and call “DCTUnsetRole@tokenId@listOfRoles” for the given address. This will be actually a cross shard call. This function as almost all in case of DCT can be called only by the owner.

source

pub fn transfer_ownership( self, token_identifier: &TokenIdentifier<SA>, new_owner: &Address ) -> ContractCall<SA, ()>

source

pub fn transfer_nft_create_role( self, token_identifier: &TokenIdentifier<SA>, old_creator: &Address, new_creator: &Address ) -> ContractCall<SA, ()>

source

pub fn dct_system_sc_address(&self) -> ManagedAddress<SA>

Auto Trait Implementations§

§

impl<SA> RefUnwindSafe for DCTSystemSmartContractProxy<SA>
where SA: RefUnwindSafe,

§

impl<SA> Send for DCTSystemSmartContractProxy<SA>
where SA: Send,

§

impl<SA> Sync for DCTSystemSmartContractProxy<SA>
where SA: Sync,

§

impl<SA> Unpin for DCTSystemSmartContractProxy<SA>
where SA: Unpin,

§

impl<SA> UnwindSafe for DCTSystemSmartContractProxy<SA>
where SA: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<M, F> ManagedFrom<M, F> for F
where M: ManagedTypeApi,

source§

fn managed_from(_: M, t: F) -> F

source§

impl<M, F, T> ManagedInto<M, T> for F
where T: ManagedFrom<M, F>, M: ManagedTypeApi,

source§

fn managed_into(self, api: M) -> T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.