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

Address value type

The address data type represents the public address of an external account or a smart contract. An address data type stores 20 bytes value that represents an Ethereum address. An Ethereum address is always represented in hexadecimal and prefixed with 0x. This makes the address of an Ethereum look something like 0xFf899Af34214B0D777bcD3c230EF637B763F0B01.

An address data type is declared and assigned a value as shown in the following code:

address owner = 0xFf899Af34214B0D777bcD3c230EF637B763F0B01; //Fixed value without quotesaddress sender = msg.sender; //Assignmentaddress emptyAddress = address(0);  //Sets the address to 0x0                                    address current = address(this); //Assigns current contract's addressrequire(msg.sender == owner); ...
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