library AddressUtils {

  /**
   * @dev Returns whether the target address is a contract.
   * @param _addr Address to check.
   */
  function isContract(
    address _addr
  )
    internal
    view
    returns (bool)
  {
    uint256 size;

    /**
     * XXX Currently there is no better way to check if there is a contract in an address than to
     * check the size of the code at that address.
     * See https://ethereum.stackexchange.com/a/14016/36603 for more details about how this works.
     * TODO: Check this again before the Serenity release, because all addresses will be
     * contracts then.
     */
    assembly { size := extcodesize(_addr) } // solium-disable-line security/no-inline-assembly
    return size > 0;
  }

}
/**
 * @dev Utility library of inline functions on addresses.
 */
function isContract(
  address _addr
)
  internal
  view
  returns (bool)
{
  uint256 size;

  /**
   * XXX Currently there is no better way to check if there is a contract in an address than to
   * check the size of the code at that address.
   * See https://ethereum.stackexchange.com/a/14016/36603 for more details about how this works.
   * TODO: Check this again before the Serenity release, because all addresses will be
   * contracts then.
   */
  assembly { size := extcodesize(_addr) } // solium-disable-line security/no-inline-assembly
  return size > 0;
}

/**
 * @dev Returns whether the target address is a contract.
 * @param _addr Address to check.
 */