I want to understand if there is a difference between byte data-type and uint8 in solidity ?
Thanks
Runtime-wise, they are identical.
Compilation-wise, they are different:
byte
operandsbyte
variablesFor example, instead of doing this:
uint8 x = 1;
uint8 y = 2;
uint8 z = x + y;
You need to do this:
byte x = byte(uint8(1));
byte y = byte(uint8(2));
byte z = byte(uint8(x) + uint8(y));