[Contract] Solidity address payable 转换与数组地址

 

address payable  -->  address

address payable addr1 = msg.sender;

address addr2 = addr1; // 隐式转

address addr3 = address(addr1); // 显式转

 

address  -->  address payable

address addr1 = msg.sender;

address payable addr2 = address( uint160(addr1) ); // 需要先经过uint160

 

普通数组地址是:address[],可支付数组地址是:address payable[]

 

Link:https://www.cnblogs.com/farwish/p/12374443.html

你可能感兴趣的:([Contract] Solidity address payable 转换与数组地址)