library AddressUtils {

	/**
	 * @notice Checks if the target address is a contract
	 *
	 * @dev It is unsafe to assume that an address for which this function returns
	 *      false is an externally-owned account (EOA) and not a contract.
	 *
	 * @dev Among others, `isContract` will return false for the following
	 *      types of addresses:
	 *        - an externally-owned account
	 *        - a contract in construction
	 *        - an address where a contract will be created
	 *        - an address where a contract lived, but was destroyed
	 *
	 * @param addr address to check
	 * @return whether the target address is a contract
	 */
	function isContract(address addr) internal view returns (bool) {
		// a variable to load `extcodesize` to
		uint256 size = 0;

		// 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.
		// solium-disable-next-line security/no-inline-assembly
		assembly {
			// retrieve the size of the code at address `addr`
			size := extcodesize(addr)
		}

		// positive size indicates a smart contract address
		return size > 0;
	}
}
/**
 * @title Address Utils
 *
 * @dev Utility library of inline functions on addresses
 *
 * @dev Copy of the Zeppelin's library:
 *      https://github.com/gnosis/openzeppelin-solidity/blob/master/contracts/AddressUtils.sol
 */
function isContract(address addr) internal view returns (bool) {
	// a variable to load `extcodesize` to
	uint256 size = 0;

	// 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.
	// solium-disable-next-line security/no-inline-assembly
	assembly {
		// retrieve the size of the code at address `addr`
		size := extcodesize(addr)
	}

	// positive size indicates a smart contract address
	return size > 0;
}

/**
 	 * @notice Checks if the target address is a contract
 	 *
 	 * @dev It is unsafe to assume that an address for which this function returns
 	 *      false is an externally-owned account (EOA) and not a contract.
 	 *
 	 * @dev Among others, `isContract` will return false for the following
 	 *      types of addresses:
 	 *        - an externally-owned account
 	 *        - a contract in construction
 	 *        - an address where a contract will be created
 	 *        - an address where a contract lived, but was destroyed
 	 *
 	 * @param addr address to check
 	 * @return whether the target address is a contract
 	 */