Add a simple wrapper for address. (#1773)
* Updated code style to no more than120 characters per line. * Unify code comments style with Doxygen-style tags. * Fix the conflicts. * Add a return value in the contract ERC20Burnable. * A Add a wrapper function to change type of address to address payable. * U Modify Address utils. * A Add test case for Address. * U Modify code style in ERC20Burnable. * Add changelog entry. * Improved dev docs.
This commit is contained in:
@ -6,4 +6,8 @@ contract AddressImpl {
|
||||
function isContract(address account) external view returns (bool) {
|
||||
return Address.isContract(account);
|
||||
}
|
||||
|
||||
function toPayable(address account) external pure returns (address payable) {
|
||||
return Address.toPayable(account);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,4 +24,12 @@ library Address {
|
||||
assembly { size := extcodesize(account) }
|
||||
return size > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Converts an `address` into `address payable`. Note that this is
|
||||
* simply a type cast: the actual underlying value is not changed.
|
||||
*/
|
||||
function toPayable(address account) internal pure returns (address payable) {
|
||||
return address(uint160(account));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user