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
andint
are similar touint256
andint256
, respectively.