Solidity includes a type for working with addresses, whether they’re EOAs or contracts. The address
type is a value type, so a new copy is created when you assign it to a new variable (it’s passed by value).
There are two types of addresses in Solidity: normal addresses and payable addresses:
address
: the general-purpose address type for storing Ethereum addresses.
payable address
: Similar to the above but with the additional capacity to send and receive Ether.
Addresses that are marked as payable
come with a few additional methods and properties, namely balance
, send()
and transfer()
.
payable
addresses can be implicitly converted into normal addresses, but the reverse is not true (simple addresses need to be explicitly converted into payable ones).
Meta Data
Source: solidity programming essentials
Relevant Context(s):
Related Notes: