Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Make comment tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
felix2feng committed Feb 12, 2020
1 parent 8a04fc8 commit 1a0f1c1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
14 changes: 7 additions & 7 deletions contracts/core/tokens/RebalancingSetTokenV3Factory.sol
Expand Up @@ -128,7 +128,7 @@ contract RebalancingSetTokenV3Factory is RebalancingSetTokenV2Factory {
FactoryUtilsLibrary.InitRebalancingParameters memory parameters =
FactoryUtilsLibrary.parseRebalanceSetCallData(_callData);

// Ensure validit of rebalancing Set calldata
// Ensure validity of rebalancing Set calldata
FactoryUtilsLibrary.validateRebalanceSetCalldata(
parameters,
address(liquidatorWhitelist),
Expand Down Expand Up @@ -185,16 +185,16 @@ contract RebalancingSetTokenV3Factory is RebalancingSetTokenV2Factory {
"Must be core"
);

require(
_units[0] > 0,
"UnitShares not > 0"
);

// Ensure component array only includes one address which will be the currentSet
require(
_components.length == 1 &&
_units.length == 1,
"Components & units len != 1"
"Components or units len != 1"
);

require(
_units[0] > 0,
"UnitShares not > 0"
);

// Expect Set to rebalance to be valid and enabled Set
Expand Down
Expand Up @@ -106,8 +106,6 @@ contract RebalancingSettlement is
uint256 maxIssueAmount = calculateMaxIssueAmount(setToken);

// Issue amount of Sets that is closest multiple of nextNaturalUnit to the maxIssueAmount
// Since the initial division will round down to the nearest whole number when we multiply
// by that same number we will return the closest multiple less than the maxIssueAmount
uint256 issueAmount = maxIssueAmount.sub(maxIssueAmount.mod(setToken.naturalUnit));

return issueAmount;
Expand Down
26 changes: 12 additions & 14 deletions contracts/core/tokens/rebalancing-v3/FactoryUtilsLibrary.sol
Expand Up @@ -19,7 +19,6 @@ pragma experimental "ABIEncoderV2";

import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol";

import { Bytes32Library } from "../../../lib/Bytes32Library.sol";
import { ICore } from "../../interfaces/ICore.sol";
import { IWhiteList } from "../../interfaces/IWhiteList.sol";
import { LibBytes } from "../../../external/0x/LibBytes.sol";
Expand All @@ -32,7 +31,6 @@ import { LibBytes } from "../../../external/0x/LibBytes.sol";
library FactoryUtilsLibrary {
using SafeMath for uint256;
using LibBytes for bytes;
using Bytes32Library for bytes32;

struct InitRebalancingParameters {
address manager;
Expand All @@ -51,18 +49,18 @@ library FactoryUtilsLibrary {
*/
function validateRebalanceSetCalldata(
InitRebalancingParameters memory _parameters,
address liquidatorWhitelist,
address feeCalculatorWhitelist,
uint256 minimumRebalanceInterval,
uint256 minimumFailRebalancePeriod,
uint256 maximumFailRebalancePeriod
address _liquidatorWhitelist,
address _feeCalculatorWhitelist,
uint256 _minimumRebalanceInterval,
uint256 _minimumFailRebalancePeriod,
uint256 _maximumFailRebalancePeriod
)
public
view
{
require(
_parameters.manager != address(0),
"Bad manager"
"Null manager"
);

require(
Expand All @@ -73,24 +71,24 @@ library FactoryUtilsLibrary {
// Require liquidator address is non-zero and is whitelisted by the liquidatorWhitelist
require(
_parameters.liquidator != address(0) &&
IWhiteList(liquidatorWhitelist).whiteList(_parameters.liquidator),
IWhiteList(_liquidatorWhitelist).whiteList(_parameters.liquidator),
"Bad liquidator"
);

// Require rebalance fee is whitelisted by the liquidatorWhitelist
// Require rebalance fee calculator is whitelisted by the liquidatorWhitelist
require(
IWhiteList(feeCalculatorWhitelist).whiteList(address(_parameters.rebalanceFeeCalculator)),
IWhiteList(_feeCalculatorWhitelist).whiteList(address(_parameters.rebalanceFeeCalculator)),
"Bad fee calculator"
);

require(
_parameters.rebalanceInterval >= minimumRebalanceInterval,
_parameters.rebalanceInterval >= _minimumRebalanceInterval,
"Bad Rebalance interval"
);

require(
_parameters.rebalanceFailPeriod >= minimumFailRebalancePeriod &&
_parameters.rebalanceFailPeriod <= maximumFailRebalancePeriod,
_parameters.rebalanceFailPeriod >= _minimumFailRebalancePeriod &&
_parameters.rebalanceFailPeriod <= _maximumFailRebalancePeriod,
"Bad Fail Period"
);
}
Expand Down
1 change: 0 additions & 1 deletion contracts/core/tokens/rebalancing-v3/IncentiveFee.sol
Expand Up @@ -23,7 +23,6 @@ import { ERC20 } from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import { CommonMath } from "../../../lib/CommonMath.sol";
import { RebalancingLibrary } from "../../lib/RebalancingLibrary.sol";
import { RebalancingSetState } from "../rebalancing-v2/RebalancingSetState.sol";
import { RebalancingSettlement } from "../rebalancing-v2/RebalancingSettlement.sol";


/**
Expand Down

0 comments on commit 1a0f1c1

Please sign in to comment.