Skip to content

address payable is enabled only from 0.5.0 #1244

@OmarTawfik

Description

@OmarTawfik

This needs to be changed in the parser grammar, and also the built-in definitions...

https://docs.soliditylang.org/en/latest/050-breaking-changes.html

The address type was split into address and address payable, where only address payable provides the transfer function. An address payable can be directly converted to an address, but the other way around is not allowed. Converting address to address payable is possible via conversion through uint160. If c is a contract, address(c) results in address payable only if c has a payable fallback function. If you use the :ref:withdraw pattern<withdrawal_pattern>, you most likely do not have to change your code because transfer is only used on msg.sender instead of stored addresses and msg.sender is an address payable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions