library SafeMath {

	/**
	 * @dev 乘法
	 */
	function mul(uint256 a, uint256 b) internal pure returns (uint256) {
		if (a == 0) {
			return 0;
		}
		uint256 c = a * b;
		require(c / a == b);
		return c;
	}

	/**
	 * @dev 除法
	 */
	function div(uint256 a, uint256 b) internal pure returns (uint256) {
		require(b > 0); // Solidity only automatically asserts when dividing by 0
    uint256 c = a / b;

		return c;
	}

	/**
	 * @dev 减法
	 */
	function sub(uint256 a, uint256 b) internal pure returns (uint256) {
		require(b <= a);
		uint256 c = a - b;
    require(c <= a);

    return c;
	}

	/**
	 * @dev 加法
	 */
	function add(uint256 a, uint256 b) internal pure returns (uint256) {
		uint256 c = a + b;
    require(c >= a);

    return c;
	}
}
/**
 * @title 安全数学库
 * @dev 用于uint256的安全计算，合约内的积分操作均使用这个库的函数代替加减乘除，来避免上溢、下溢等问题
 */
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
	if (a == 0) {
		return 0;
	}
	uint256 c = a * b;
	require(c / a == b);
	return c;
}

/**
 	 * @dev 乘法
 	 */