Solidity Basic Code
Solidity Basic Code
/*
Negative numbers are allowed for int types. Eg
- int256 ranges from -2 ** 255 to 2 ** 255 - 1
*/
int public i = -123; // int is same as int256
// Default values
// Unassigned variables have a default value in Solidity
bool public defaultBoo2; // false
uint public defaultUint; // 0
int public defaultInt; // 0
address public defaultAddr; // 0x0000000000000000000000000000000000000000
/*
******** Global variables **********
*/
/*
block.timestamp tells us whats the timestamp for the current block
msg.sender tells us which address called the doSomething function
*/
uint timestamp = block.timestamp; // Current block timestamp
address sender = msg.sender; // address of the caller
}
}