Finishing Wallet Video Queries

Hi all, I am currently on the lecture on Finishing Wallet but I have some queries on it.

  1. For the wallet.sol, why do we inherit from IERC20 and not ERC20 given that ERC20 imports from IERC20 and not the other way round? Why are we importing ERC20 for the token.sol and the IERC20 for the wallet.sol?

  2. As Solidity 0.8.0 has added built-in support for checked math and SafeMath is no longer needed, how should the line of code below be changed?
    balances[msg.sender][ticker] = balances[msg.sender][ticker].add(amount);
    Should it just be
    balances[msg.sender][ticker] = balances[msg.sender][ticker] + amount;

  3. Every time IERC20 is called, it is formatted as below:
    IERC20(tokenMapping[ticker].tokenAddress)
    Is this the standard format to use every time we use functions from an external contract? To use IERC20, one would always have to add a () after it?

  4. In the video when Filip enters the following, he receives an error because the token contract has not received any allowance to transfer.
    wallet.deposit(100, web3.utils.fromUtf8("LINK"))
    However, when I enter the same command, I receive the following results. May I know why there would be a discrepancy?

Result {
  '0': '0x4c494e4b00000000000000000000000000000000000000000000000000000000',
  '1': '0xBD03aBA1064E8C5e2E1a8E27FDFAe09D6dd9E3b3',
  ticker: '0x4c494e4b00000000000000000000000000000000000000000000000000000000',
  tokenAddress: '0xBD03aBA1064E8C5e2E1a8E27FDFAe09D6dd9E3b3'
}
truffle(develop)> link.address
'0xBD03aBA1064E8C5e2E1a8E27FDFAe09D6dd9E3b3'
truffle(develop)> wallet.deposit(100, web3.utils.fromUtf8("LINK"))
{
  tx: '0x0909c006db3fdc3da85304884d369fef25ae16fc941fb6276882c4a910827cf5',
  receipt: {
    transactionHash: '0x0909c006db3fdc3da85304884d369fef25ae16fc941fb6276882c4a910827cf5',
    transactionIndex: 0,
    blockHash: '0xb637016ac0df80ea038fbebbb17f955ac904a80189b4ca7ff0931dc69ff03125',
    blockNumber: 8,
    from: '0x70cf8f46e81ccb8f26144d531383cff98931756c',
    to: '0x73d6db82d18aedc2280d9c71c74f2884106e7071',
    gasUsed: 22047,
    cumulativeGasUsed: 22047,
    contractAddress: null,
    logs: [],
    status: true,
    logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    rawLogs: []
  },
  logs: []
}
  1. However, after I run the approve function as well as check the accounts according to the statement below, I do not get any deposits
    wallet.balances(accounts[0], web3.utils.fromUtf8("LINK"))
    result: BN { negative: 0, words: [ 0, <1 empty item> ], length: 1, red: null }