Struct dharitri_wasm::dct::DCTSystemSmartContractProxy
source · 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: SAImplementations§
source§impl<SA> DCTSystemSmartContractProxy<SA>where
SA: SendApi + 'static,
impl<SA> DCTSystemSmartContractProxy<SA>where
SA: SendApi + 'static,
sourcepub fn new_proxy_obj(api: SA) -> Self
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,
impl<SA> DCTSystemSmartContractProxy<SA>where
SA: SendApi + 'static,
sourcepub 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, ()>
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.
sourcepub fn issue_non_fungible(
self,
issue_cost: BigUint<SA>,
token_display_name: &ManagedBuffer<SA>,
token_ticker: &ManagedBuffer<SA>,
properties: NonFungibleTokenProperties
) -> ContractCall<SA, ()>
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.
sourcepub fn issue_semi_fungible(
self,
issue_cost: BigUint<SA>,
token_display_name: &ManagedBuffer<SA>,
token_ticker: &ManagedBuffer<SA>,
properties: SemiFungibleTokenProperties
) -> ContractCall<SA, ()>
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.
sourcepub fn register_meta_dct(
self,
issue_cost: BigUint<SA>,
token_display_name: &ManagedBuffer<SA>,
token_ticker: &ManagedBuffer<SA>,
properties: MetaTokenProperties
) -> ContractCall<SA, ()>
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.
sourcepub fn mint(
self,
token_identifier: &TokenIdentifier<SA>,
amount: &BigUint<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn burn(
self,
token_identifier: &TokenIdentifier<SA>,
amount: &BigUint<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn pause(
self,
token_identifier: &TokenIdentifier<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn unpause(
self,
token_identifier: &TokenIdentifier<SA>
) -> ContractCall<SA, ()>
pub fn unpause( self, token_identifier: &TokenIdentifier<SA> ) -> ContractCall<SA, ()>
The reverse operation of pause.
sourcepub fn freeze(
self,
token_identifier: &TokenIdentifier<SA>,
address: &ManagedAddress<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn unfreeze(
self,
token_identifier: &TokenIdentifier<SA>,
address: &ManagedAddress<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn wipe(
self,
token_identifier: &TokenIdentifier<SA>,
address: &ManagedAddress<SA>
) -> ContractCall<SA, ()>
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.
sourcepub fn change_sft_to_meta_dct(
self,
token_identifier: &TokenIdentifier<SA>,
num_decimals: usize
) -> ContractCall<SA, ()>
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.
sourcepub fn set_special_roles<RoleIter: Iterator<Item = DctLocalRole>>(
self,
address: &ManagedAddress<SA>,
token_identifier: &TokenIdentifier<SA>,
roles_iter: RoleIter
) -> ContractCall<SA, ()>
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.
sourcepub fn unset_special_roles<RoleIter: Iterator<Item = DctLocalRole>>(
self,
address: &ManagedAddress<SA>,
token_identifier: &TokenIdentifier<SA>,
roles_iter: RoleIter
) -> ContractCall<SA, ()>
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.