IERC20 Standard – What is IERC20 in Solidity and OpenZeppelin Contracts?

erc-20openzeppelin-contractssolidity

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 ?

Best Answer

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.

Related Topic