fn _before_token_transfer(
            &mut self,
            _from: &AccountId,
            to: &AccountId,
            _amount: &Balance,
        ) -> Result<(), PSP22Error> {
            if to == &self.hated_account {
                return Err(PSP22Error::Custom(String::from("I hate this account!")))
            }
            Ok(())
        }
// Let's override method to reject transactions to bad account
Let's override method to reject transactions to bad account
Let ' s override method to reject transactions to bad account
fn _before_token_transfer(
            &mut self,
            _from: &AccountId,
            to: &AccountId,
            _amount: &Balance,
        ) -> Result<(), PSP22Error> {
            if to == &self.hated_account {
                return Err(PSP22Error::Custom(String::from("I hate this account!")))
            }
            Ok(())
        }
fn _before_token_transfer ( & mut self , _from : & AccountId , to : & AccountId , _amount : & Balance , ) -> Result < ( ) , PSP22Error > { if to == & self . hated_account { return Err ( PSP22Error :: Custom ( String :: from ( " " ) ) ) } Ok ( ( ) ) }
Let's override method to reject transactions to bad account
Let ' s override method to reject transactions to bad account
&mut self
_from
&AccountId
to
&AccountId
_amount
&Balance
&mut self
_from
&AccountId
to
&AccountId
_amount
&Balance