function _amountAvailable(address from) internal view returns (uint256) { vesting memory vested = _vesting[from]; uint256 totalBalance = _totalBalanceOf(from); if (vested.amount > 0) { // vesting applies uint256 vestingIndex = _vestingDays.findUpperBound(today() - vested.startDate); if (vestingIndex < _vestingDays.length) { // still in vesting phase uint256 vestingBasisPoints = _vestingBasisPoints[vestingIndex]; uint256 maxAmountAvailable = vested.amount.mul(vestingBasisPoints).div( BASIS_POINT_DIVISOR ); uint256 remainingVestedAmount = vested.amount.sub(maxAmountAvailable); return totalBalance.sub(remainingVestedAmount); } else { return totalBalance; } } else { return totalBalance; } }
0.4.18