From b390f2181ad85ea36e51574e449db48d6e59475f Mon Sep 17 00:00:00 2001 From: satyam Date: Mon, 27 May 2019 06:21:02 +0530 Subject: [PATCH 1/2] cleanup --- contracts/libraries/TokenLib.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/libraries/TokenLib.sol b/contracts/libraries/TokenLib.sol index e0f318fa9..b4e219d64 100644 --- a/contracts/libraries/TokenLib.sol +++ b/contracts/libraries/TokenLib.sol @@ -7,7 +7,6 @@ import "../tokens/SecurityTokenStorage.sol"; import "../interfaces/ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../modules/PermissionManager/IPermissionManager.sol"; -import "./KindMath.sol"; library TokenLib { From 1fc24463c7198faa8b4c13b62e131f597bcd8280 Mon Sep 17 00:00:00 2001 From: satyam Date: Wed, 29 May 2019 18:41:30 +0530 Subject: [PATCH 2/2] remove the KindMath --- contracts/libraries/KindMath.sol | 48 -------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 contracts/libraries/KindMath.sol diff --git a/contracts/libraries/KindMath.sol b/contracts/libraries/KindMath.sol deleted file mode 100644 index e9de30c65..000000000 --- a/contracts/libraries/KindMath.sol +++ /dev/null @@ -1,48 +0,0 @@ -pragma solidity ^0.5.0; - -/** - * @title KindMath - * @notice ref. https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol - * @dev Math operations with safety checks that returns boolean - */ -library KindMath { - - /** - * @dev Multiplies two numbers, return false on overflow. - */ - function checkMul(uint256 a, uint256 b) internal pure returns (bool) { - // Gas optimization: this is cheaper than requireing 'a' not being zero, but the - // benefit is lost if 'b' is also tested. - // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 - if (a == 0) { - return true; - } - - uint256 c = a * b; - if (c / a == b) - return true; - else - return false; - } - - /** - * @dev Subtracts two numbers, return false on overflow (i.e. if subtrahend is greater than minuend). - */ - function checkSub(uint256 a, uint256 b) internal pure returns (bool) { - if (b <= a) - return true; - else - return false; - } - - /** - * @dev Adds two numbers, return false on overflow. - */ - function checkAdd(uint256 a, uint256 b) internal pure returns (bool) { - uint256 c = a + b; - if (c < a) - return false; - else - return true; - } -}