What is the IERC20.sol contract used for if we have the ERC20.sol contract?
1 Like
The IERC20.sol is a interface contract, all in this file are standard as defined in the EIP.
As for ERC20.sol, it is an implementation of the IERC20.sol, you can define all your token logic in it.
3 Likes
Hi. what is meant by “interface” so does this connect EIP standards to something?
1 Like
For interface, you can check this doc: https://solidity.readthedocs.io/en/v0.7.4/contracts.html#interfaces,
and for EIP20, you can check at here: https://eips.ethereum.org/EIPS/eip-20
2 Likes
Awesome replies by @Skyge (
)
You can interact with a contract via the functions in the interface and don’t need the whole implementation, e.g. Example on how to use ERC20 token in another contract which uses IERC20 to interact with the token.
3 Likes
that makes sense thank you!
1 Like