Solidity – Why ERC-20 Interface Uses uint256 While Uniswap Router Uses uint

erc-20solidityuniswap

ERC-20 token interface functions like balanceOf, allowance returns an uint256. While the functions of the Uniswap router interface take uint for the token amounts and returns uint[] in some cases.

My question is, why these interfaces are using different integer types for token related functions? For instance I buy some tokens with swapExactETHForTokens which returns an uint[], then I call balanceOf on the contract of the purchased token and that returns an uint256. How will be uint256 from uint?

Best Answer

The simple uint and int are similar to uint256 and int256, respectively.

Related Topic