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?

2 Answers 2


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


uint is an alias for uint256. A good example contract that focuses on primitives https://solidity-by-example.org/primitives

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.