fn perform_transfer(
            &mut self,
            from: AccountId,
            to: AccountId,
            token_id: TokenId,
            value: Balance,
        ) {
            let mut sender_balance = self
                .balances
                .get(&(from, token_id))
                .expect("Caller should have ensured that `from` holds `token_id`.");
            sender_balance -= value;
            self.balances.insert(&(from, token_id), &sender_balance);

            let mut recipient_balance = self.balances.get(&(to, token_id)).unwrap_or(0);
            recipient_balance += value;
            self.balances.insert(&(to, token_id), &recipient_balance);

            let caller = self.env().caller();
            self.env().emit_event(TransferSingle {
                operator: Some(caller),
                from: Some(from),
                to: Some(from),
                token_id,
                value,
            });
        }
// Helper function for performing single token transfers.
//
// Should not be used directly since it's missing certain checks which are important to the
// ERC-1155 standard (it is expected that the caller has already performed these).
//
// # Panics
//
// If `from` does not hold any `token_id` tokens.
Helper function for performing single token transfers.
Should not be used directly since it's missing certain checks which are important to the
ERC-1155 standard (it is expected that the caller has already performed these).
Helper function for performing single token transfers . Should not be used directly since it ' s missing certain checks which are important to the ERC - 1155 standard ( it is expected that the caller has already performed these ) .
fn perform_transfer(
            &mut self,
            from: AccountId,
            to: AccountId,
            token_id: TokenId,
            value: Balance,
        ) {
            let mut sender_balance = self
                .balances
                .get(&(from, token_id))
                .expect("Caller should have ensured that `from` holds `token_id`.");
            sender_balance -= value;
            self.balances.insert(&(from, token_id), &sender_balance);
            let mut recipient_balance = self.balances.get(&(to, token_id)).unwrap_or(0);
            recipient_balance += value;
            self.balances.insert(&(to, token_id), &recipient_balance);
            let caller = self.env().caller();
            self.env().emit_event(TransferSingle {
                operator: Some(caller),
                from: Some(from),
                to: Some(from),
                token_id,
                value,
            });
        }
fn perform_transfer ( & mut self , from : AccountId , to : AccountId , token_id : TokenId , value : Balance , ) { let mut sender_balance = self . balances . get ( & ( from , token_id ) ) . expect ( " " ) ; sender_balance -= value ; self . balances . insert ( & ( from , token_id ) , & sender_balance ) ; let mut recipient_balance = self . balances . get ( & ( to , token_id ) ) . unwrap_or ( 0 ) ; recipient_balance += value ; self . balances . insert ( & ( to , token_id ) , & recipient_balance ) ; let caller = self . env ( ) . caller ( ) ; self . env ( ) . emit_event ( TransferSingle { operator : Some ( caller ) , from : Some ( from ) , to : Some ( from ) , token_id , value , } ) ; }
Helper function for performing single token transfers.
Helper function for performing single token transfers .
&mut self
from
AccountId
to
AccountId
token_id
TokenId
value
Balance
&mut self
from
AccountId
to
AccountId
token_id
TokenId
value
Balance
panics
If `from` does not hold any `token_id` tokens.
If ` from ` does not hold any ` token_id ` tokens .