fn _approve_for(&mut self, to: AccountId, id: Id) {
        let caller = Self::env().caller();
        let owner = self._owner_of(&id);
        if !(owner == Some(caller)
            || self._approved_for_all(owner.expect("Erc721Error with AccountId"), caller))
        {
            panic!("{}", Erc721Error::NotAllowed.as_ref());
        };

        assert_ne!(to, ZERO_ADDRESS.into(), "{}", Erc721Error::NotAllowed.as_ref());
        assert!(self._token_approvals_mut().insert(id, to).is_none(), "{}", Erc721Error::CannotInsert.as_ref());
        self.emit_approval_event(caller, to, id);
    }
/// Approve the passed AccountId to transfer the specified token on behalf of the message's sender.
Approve the passed AccountId to transfer the specified token on behalf of the message's sender.
Approve the passed AccountId to transfer the specified token on behalf of the message ' s sender .
fn _approve_for(&mut self, to: AccountId, id: Id) {
        let caller = Self::env().caller();
        let owner = self._owner_of(&id);
        if !(owner == Some(caller)
            || self._approved_for_all(owner.expect("Erc721Error with AccountId"), caller))
        {
            panic!("{}", Erc721Error::NotAllowed.as_ref());
        };
        assert_ne!(to, ZERO_ADDRESS.into(), "{}", Erc721Error::NotAllowed.as_ref());
        assert!(self._token_approvals_mut().insert(id, to).is_none(), "{}", Erc721Error::CannotInsert.as_ref());
        self.emit_approval_event(caller, to, id);
    }
fn _approve_for ( & mut self , to : AccountId , id : Id ) { let caller = Self :: env ( ) . caller ( ) ; let owner = self . _owner_of ( & id ) ; if ! ( owner == Some ( caller ) || self . _approved_for_all ( owner . expect ( " " ) , caller ) ) { panic ! ( " " Erc721Error NotAllowed as_ref ( ) ) ; } ; assert_ne ! ( to ZERO_ADDRESS into ( ) " " Erc721Error NotAllowed as_ref ( ) ) ; assert ! ( self token_approvals_mut ( ) insert ( id to ) is_none ( ) " " Erc721Error CannotInsert as_ref ( ) ) ; self . emit_approval_event ( caller , to , id ) ; }
Approve the passed AccountId to transfer the specified token on behalf of the message's sender.
Approve the passed AccountId to transfer the specified token on behalf of the message ' s sender .
&mut self
to
AccountId
id
Id
&mut self
to
AccountId
id
Id