Skip to Content
Mastering Blockchain Programming with Solidity
book

Mastering Blockchain Programming with Solidity

by Jitendra Chittoda
August 2019
Intermediate to advanced
486 pages
13h 52m
English
Packt Publishing
Content preview from Mastering Blockchain Programming with Solidity

Understanding Solidity value types

The int, uint, bool, and address data types are also called value types. The variables of these types will always be passed by value. This means that their values are always copied when they are used as the function arguments or assigned to another variable.

Some int and uint value types in Solidity support various sizes to reduce gas consumption and storage space. You should choose the appropriate value type based on your data requirements. The bool and address value types do not have different sizes, as their size is fixed. The size of the value types is as follows:

Value type Different sizes When size is undefined 
int int8, int16, int24 .... int256 (a step of 8) int uses int256
uint uint8, uint16 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood
Complete Cryptocurrency and Blockchain Course | Learn Solidity

Complete Cryptocurrency and Blockchain Course | Learn Solidity

Ravinder Deol, Codestars By Rob Percival, Thomas Wiesner

Publisher Resources

ISBN: 9781839218262Supplemental Content