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
- What is IERC20?
- How it is different from ERC20 ?
Best Answer
Interpret that this way:
ERC20
is an implementation of the Interface defined inIERC20
.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 inERC20
.Hope it helps.