mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Cleaned up data types
This commit is contained in:
parent
bdd8a8b0c8
commit
fc528c92dd
@ -117,12 +117,10 @@ uint x;
|
||||
|
||||
// int of 256 bits, cannot be changed after instantiation
|
||||
int constant a = 8;
|
||||
|
||||
// with 'constant', compiler replaces each occurrence with actual value
|
||||
int256 constant a = 8; // same effect as line above, here the 256 is explicit
|
||||
uint constant VERSION_ID = 0x123A1; // A hex constant
|
||||
// with 'constant', compiler replaces each occurrence with actual value
|
||||
|
||||
// Be careful that you don't overflow, and protect against attacks that do
|
||||
|
||||
// For int and uint, can explicitly set space in steps of 8 up to 256
|
||||
// e.g., int8, int16, int24
|
||||
@ -130,6 +128,8 @@ uint8 b;
|
||||
int64 c;
|
||||
uint248 e;
|
||||
|
||||
// Be careful that you don't overflow, and protect against attacks that do
|
||||
|
||||
// No random functions built in, use other contracts for randomness
|
||||
|
||||
// Type casting
|
||||
|
Loading…
Reference in New Issue
Block a user