Files
openzeppelin-contracts/contracts/AddressUtils.sol
2018-03-09 17:19:11 -03:00

19 lines
430 B
Solidity

pragma solidity ^0.4.18;
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether there is code in the target address
* @param addr address address to check
* @return whether there is code in the target address
*/
function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) }
return size > 0;
}
}