Skip to content

Commit

Permalink
ESDTSystemSCAddress in interactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Aug 29, 2024
1 parent 804bf49 commit 6e6c9e1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use multiversx_sc_codec::{EncodeErrorHandler, TopEncode, TopEncodeOutput};

use crate::{
abi::TypeAbiFrom,
api::{CallTypeApi, ManagedTypeApi},
types::{AnnotatedValue, ManagedAddress, ManagedBuffer, TxScEnv, TxTo, TxToSpecified},
api::ManagedTypeApi,
types::{AnnotatedValue, ManagedAddress, ManagedBuffer, TxEnv, TxTo, TxToSpecified},
};

/// Address of the system smart contract that manages ESDT.
Expand Down Expand Up @@ -35,21 +35,21 @@ impl ESDTSystemSCAddress {
}
}

impl<Api> AnnotatedValue<TxScEnv<Api>, ManagedAddress<Api>> for ESDTSystemSCAddress
impl<Env> AnnotatedValue<Env, ManagedAddress<Env::Api>> for ESDTSystemSCAddress
where
Api: CallTypeApi,
Env: TxEnv,
{
fn annotation(&self, _env: &TxScEnv<Api>) -> ManagedBuffer<Api> {
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api> {
ManagedBuffer::from(SYSTEM_SC_ADDRESS_ANNOTATION)
}

fn to_value(&self, _env: &TxScEnv<Api>) -> ManagedAddress<Api> {
fn to_value(&self, _env: &Env) -> ManagedAddress<Env::Api> {
ESDTSystemSCAddress.to_managed_address()
}
}

impl<Api> TxTo<TxScEnv<Api>> for ESDTSystemSCAddress where Api: CallTypeApi {}
impl<Api> TxToSpecified<TxScEnv<Api>> for ESDTSystemSCAddress where Api: CallTypeApi {}
impl<Env> TxTo<Env> for ESDTSystemSCAddress where Env: TxEnv {}
impl<Env> TxToSpecified<Env> for ESDTSystemSCAddress where Env: TxEnv {}

impl TopEncode for ESDTSystemSCAddress {
fn top_encode_or_handle_err<O, H>(&self, output: O, h: H) -> Result<(), H::HandledErr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl SysFuncCallsInteract {
.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.issue_fungible(
Expand Down Expand Up @@ -270,7 +270,7 @@ impl SysFuncCallsInteract {
.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.issue_non_fungible(
Expand Down Expand Up @@ -306,7 +306,7 @@ impl SysFuncCallsInteract {
.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.issue_semi_fungible(
Expand Down Expand Up @@ -344,7 +344,7 @@ impl SysFuncCallsInteract {
.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.issue_and_set_all_roles(
Expand Down Expand Up @@ -372,7 +372,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.set_special_roles(
Expand Down Expand Up @@ -430,7 +430,7 @@ impl SysFuncCallsInteract {
.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.register_meta_esdt(
Expand Down Expand Up @@ -461,7 +461,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.change_sft_to_meta_esdt(&TokenIdentifier::from(token_id), num_decimals)
Expand Down Expand Up @@ -511,7 +511,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.pause(&TokenIdentifier::from(token_id))
Expand All @@ -525,7 +525,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.unpause(&TokenIdentifier::from(token_id))
Expand All @@ -541,7 +541,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.freeze(&TokenIdentifier::from(token_id), &managed_address)
Expand All @@ -557,7 +557,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.unfreeze(&TokenIdentifier::from(token_id), &managed_address)
Expand All @@ -573,7 +573,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.freeze_nft(&TokenIdentifier::from(token_id), nonce, &managed_address)
Expand All @@ -589,7 +589,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.unfreeze_nft(&TokenIdentifier::from(token_id), nonce, &managed_address)
Expand All @@ -605,7 +605,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(&ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.wipe(&TokenIdentifier::from(token_id), &managed_address)
Expand All @@ -621,7 +621,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.wipe_nft(&TokenIdentifier::from(token_id), nonce, &managed_address)
Expand Down Expand Up @@ -676,7 +676,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.unset_special_roles(
Expand All @@ -698,7 +698,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.transfer_ownership(&TokenIdentifier::from(token_id), &managed_addr)
Expand All @@ -722,7 +722,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.transfer_nft_create_role(
Expand All @@ -740,7 +740,7 @@ impl SysFuncCallsInteract {
self.interactor
.tx()
.from(&self.wallet_address)
.to(ESDTSystemSCAddress.to_managed_address())
.to(ESDTSystemSCAddress)
.gas(100_000_000u64)
.typed(ESDTSystemSCProxy)
.control_changes(
Expand Down

0 comments on commit 6e6c9e1

Please sign in to comment.