Difference between ERC20 and ERC223 token in Solidity


If you are going to study Solidity means, then definitely heard about ICO tokens.Let's jump into it.

What is called Tokens?
          In ethereum ecosystem, Tokens can represent any tradable coins, certificates, loyalty points, etc...An ICO tokens hold some balances in one particular address.That balance represents a value that is defined by contract creator.The unit of the balance commonly called as Tokens.

What is called ERC20?
          Ethereum Request for Comments 20 or ERC20 is an ethereum token standard to develop ethereum smart contracts.It has some common standard to implement token.ERC20 defines the function balanceOf,totalSupply,transfer,transferFrom,approve,allowance.
What is called ERC223?
                It has Backward Compatible with ERC20 tokens. It is the latest ethereum token standard and supports every function of ERC20.

What is the difference between ERC20 and ERC223?
         1.No losing of tokens
         2.Token transfer handlers
         3.Less gas cost
1.No Losing Tokens
     In ERC20, there are two distinct ways to transfer tokens.we can send the tokens directly or delegate to another smart contract.
You can either call transfer function to send tokens to a wallet address or call approve function and then call transferFrom from the receiver contract.To be aware when we will trigger that the transfer method.If you simply mistyping your address, leads to loss of tokens.
       In ERC223, it uses the same transfer function to send tokens to either wallet or contract.It eliminates the problems of losing token by invoking a new transfer method.
    This function will transfer tokens and call a function name called tokenFallback(address,uint256, bytes) from _to if _to is a contract.This tokenFallback will be called at the receiver side and take the parameters.From this, it eliminates the potential for confusion and lost tokens.
2.Token transfer handlers
    In ERC223, it allows developers to handle the incoming token transaction.In ERC20 token are sending using the transfer function, It does not notify the receiver contract that a transaction had occurred.The tokens are just credited to the address of the receiver without any notification or processing state.With it, there is no way to handle the incoming transactions and non-supported tokens.
    In ERC223, New transfer function overcome this issue by allowing the smart contract to handle the sent tokens.It can able to reject the non-supported tokens.
 3.Less gas cost
     The transfer of ERC20 is a two-step process
 You have to call approve function from the contract and call the transferFrom function from the receiver side.
      The transfer of ERC223 is a one-step process
It allows the same transaction by using the same transfer function.If the receiver is a non-contract address, ERC223 use the same transfer method of ERC20.If the receiver is contract or wallet, the contract will call the tokenFallBack function on another side, If tokenFallBack does not exist on another side means, the transaction will fail
     So ERC223 consumes half the amount of gas than ERC20.
I hope this one is useful to you.If you want me to write about other topics in solidity or any other programming languages on labels of my blog, please let me know in the comment section.

              For more Technical information  Follow me on Facebook -->Be Perky
Instagram-->be_perky

                

   

Comments

  1. Sign Up Free on NIMBUS PLATFORM - Up to 15% Monthly Profitability

    We are a company dedicated to Crypto Arbitrage with excellent results. Our referral system offers 50% in the First Level. Register now!

    NIMBUS

    ReplyDelete

Post a Comment