2

I understand the ERC20 standards which includes the functions like totalSupply()

balanceOf()

allowance()

transfer()

approve()

transferFrom()

When I check the openzeppelin, I could see "contract ERC20 is IERC20" which has some additional functions.

Question

  1. What is IERC20?
  2. How it is different from ERC20 ?
2
contract ERC20 is IERC20

Interpret that this way:

ERC20 is an implementation of the Interface defined in IERC20.

IERC20 defines function signatures without specifying behavior; the function names, inputs and outputs, but no process. ERC20 inherits this Interface and is required to implement all the functions described or else the contract will not deploy.

If this is deployed, then we can safely say that all the functions described in the ERC20 Interface laid out in IERC20 have corresponding implementations in ERC20.

Hope it helps.

  • I see that IERC20 has new methods like decreaseAllowance(), _mint(),_burn() and some more.. Are these included in new ERC20 standard ? While I studied this couple of months back I have not seen this .. – iappmaker Oct 21 '18 at 18:38
  • ERC20 specifies the behavior of some standard functions but there is nothing in the spec that prevents extension. Those functions are about burnable, mintable and other extensions. As I glance at the IERC20, I don't see these non-standard extensions. github.com/OpenZeppelin/openzeppelin-solidity/blob/master/… – Rob Hitchens - B9lab Oct 21 '18 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.