Solidity get interface id and ERC165

To get interface id, use

type(ITest).interfaceId

Remember interfaceId = xor of all selectors (methods) name and param type, don't care to return type

For example:

  • Return zero with empty interface
=> bytes4: 0x00000000