I have noticed, in Uniswap v2 for exemple, that the contract imports its own library.
For exemple, UniswapV2Pair.sol
pragma solidity =0.5.16;
import './interfaces/IUniswapV2Pair.sol';
...
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IUniswapV2Callee.sol';
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
So that UniswapV2Pair is IUniswapV2Pair... Notably, IUniswapV2Pair contains all functions found in IUniswapV2ERC20, and then all the functions from UniswapV2Pair, but without the logic (i.e. just function's name, arguments, returned values).
Where is the need for import its own interface in a smart contract? Can someone shed some lights about what is happening here? Thanks