Address & Address Payable
In Solidity, address and address payable are special data types used to represent Ethereum addresses.
The address data type has the following attributes:
balance: returns the balance of the address in weicode:code at the Address (can be empty)codehash: the codehash of the Addresscall: allows sending a message to another address with a specified amount of wei and optional data
The address payable data type has all the attributes of the address data type, plus additional attributes:
transfer: same as thetransferattribute of theaddressdata type, but marked aspayableso that it can receive ethersend: same as thesendattribute of theaddressdata type, but marked aspayableso that it can receive ether. Note thatsendis not recommended to be used withaddress payable, as it can result in lost ether if the recipient address has a fallback function that consumes too much gas.
Overall, these attributes allow for interacting with Ethereum addresses and sending/receiving ether between them.
Last updated