EatTheBlocks Forum

Development mastery : When to use ERC20 and IERC20?


I have 2 questions regarding the ERC20 token video in the Defi development mastery:

  1. In order to create an ERC20 token, an ERC20.sol in openzeppelin is being imported and is being used. In order to transfer token between contracts, an IERC20.sol in openzeppelin is being used. My question is when to use ERC20 and when to use IERC20?

  2. In the token.transferFrom function, is msg.sender is the owner of the contractA? Address(this) means the address of contractA?

Does anyone know? Thanks!