Objects & Types
Types of Objects
Type
Description
Unsigned integer (whole number)
256 is the default if nothing is specified
But it's good to be specific and use
uint256
Initializes as default
0if not assigned a value as that is the null value in SoliditySmallest is
unit8as 8 bits is a byte
Positive or negative whole number
bytes32is the max size allowedbytescan have "any size"?But I think that will still limit the actual content to 32 bytes
Actually a type of
bytesin the background, but only used for text
boolean
true/false
An address!
contract SimpleStorage {
bool hasFavouriteNumber = true;
uint256 favouriteNumber = 5;
string favouriteNumberInText = "Five";
int256 favouriteInt = -5;
address myAddress = 0x5E666460E5BB4A8Bb14E805478176c36f3b293AB;
bytes32 favouriteBytes = "cat";
}Example
Last updated