Solidity Data Types
Yassine Chraa
Posted on December 10, 2022
- Values Types:
- uint(Unsigned Integer), uint8,..., uint256
- int, int8,..., int256
- bool(Boolean)
- address: use to stock Ethereum address
- bytes: Holds a 30 byte value
- enum: The data representation is the same as for enums in C
example:
enum Countries{ Morocco, CANDA, ESPAIN};
- function: There are three types of functions;
pure
,view
andpayable
- References Types:
- Arrays:
uint[] memory a = new uint[](7);
- Data Location: There are three data locations;
memory
,storage
andcalldata
. - struct: used to create new types
- Arrays:
struct Funder {
address addr;
uint amount;
}
3.Mapping Types:
- Syntax:
mapping(KeyType => ValueType) VariableName;
💖 💪 🙅 🚩
Yassine Chraa
Posted on December 10, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.