Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
"lint-staged": "^7.2.0",
"module-alias": "^2.1.0",
"openzeppelin-solidity": "^2.2",
"set-protocol-contracts": "^1.3.13-beta",
"set-protocol-oracles": "^1.0.1",
"set-protocol-contracts": "^1.3.35-beta",
"set-protocol-oracles": "^1.0.5",
"set-protocol-utils": "^1.0.0-beta.45",
"tiny-promisify": "^1.0.0",
"truffle-flattener": "^1.4.2",
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/allocators/binaryAllocator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -48,7 +48,7 @@ import { getWeb3 } from '@utils/web3Helper';

import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
8 changes: 5 additions & 3 deletions test/contracts/managers/allocators/socialAllocator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -43,9 +43,10 @@ import { expectRevertError } from '@utils/tokenAssertions';
import { extractNewSetTokenAddressFromLogs } from '@utils/contract_logs/core';
import { getWeb3 } from '@utils/web3Helper';

import { CoreHelper } from 'set-protocol-contracts';
import { OracleHelper } from 'set-protocol-oracles';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down Expand Up @@ -90,6 +91,7 @@ contract('SocialAllocator', accounts => {
const erc20Helper = new ERC20Helper(deployerAccount);
const managerHelper = new ManagerHelper(deployerAccount);
const oracleHelper = new OracleHelper(deployerAccount);
const coreHelper = new CoreHelper(deployerAccount, deployerAccount);

before(async () => {
ABIDecoder.addABI(Core.abi);
Expand Down Expand Up @@ -158,7 +160,7 @@ contract('SocialAllocator', accounts => {
btcLegacyMakerOracleAdapter.address,
);

oracleWhiteList = await protocolHelper.deployOracleWhiteListAsync(
oracleWhiteList = await coreHelper.deployOracleWhiteListAsync(
[wrappedETH.address, wrappedBTC.address, usdcMock.address],
[ethOracleProxy.address, btcOracleProxy.address, usdcOracle.address],
);
Expand Down
2 changes: 1 addition & 1 deletion test/contracts/managers/assetPairManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/btcDaiRebalancingManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import {
BTCDaiRebalancingManagerContract,
} from '@utils/contracts';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
DEFAULT_GAS,
Expand All @@ -40,7 +40,7 @@ import { LogManagerProposal } from '@utils/contract_logs/btcDaiRebalancingManage

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/btcEthRebalancingManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
BTCETHRebalancingManagerContract,
} from '@utils/contracts';

import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
DEFAULT_GAS,
Expand All @@ -42,7 +42,7 @@ import { LogManagerProposal } from '@utils/contract_logs/btcEthRebalancingManage

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/ethDaiRebalancingManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from 'set-protocol-oracles';

import { ETHDaiRebalancingManagerContract } from '@utils/contracts';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
DEFAULT_GAS,
Expand All @@ -40,7 +40,7 @@ import { LogManagerProposal } from '@utils/contract_logs/ethDaiRebalancingManage

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/inverseMacoStrategyManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -52,7 +52,7 @@ import { LogManagerProposal } from '@utils/contract_logs/macoStrategyManager';

import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BigNumberSetup } from '@utils/bigNumberSetup';
import {
FlexibleTimingManagerLibraryMockContract
} from '@utils/contracts';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import { expectRevertError } from '@utils/tokenAssertions';
import { getWeb3 } from '@utils/web3Helper';
Expand Down
2 changes: 1 addition & 1 deletion test/contracts/managers/lib/managerLibraryMock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BigNumberSetup } from '@utils/bigNumberSetup';
import {
ManagerLibraryMockContract
} from '@utils/contracts';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { getWeb3 } from '@utils/web3Helper';
import { DEFAULT_AUCTION_PRICE_DIVISOR } from '@utils/constants';

Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/macoStrategyManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -49,7 +49,7 @@ import { LogManagerProposal } from '@utils/contract_logs/macoStrategyManager';

import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/macoStrategyManagerV2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -52,7 +52,7 @@ import { LogManagerProposal } from '@utils/contract_logs/macoStrategyManager';

import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
38 changes: 28 additions & 10 deletions test/contracts/managers/socialTradingManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -41,7 +41,8 @@ import {
ONE_DAY_IN_SECONDS,
UNLIMITED_ALLOWANCE_IN_BASE_UNITS,
WBTC_DECIMALS,
ZERO
ZERO,
ONE_HOUR_IN_SECONDS
} from '@utils/constants';

import { expectRevertError } from '@utils/tokenAssertions';
Expand All @@ -53,9 +54,16 @@ import {
} from '@utils/contract_logs/socialTradingManager';
import { getWeb3 } from '@utils/web3Helper';

import {
CoreHelper,
FeeCalculatorHelper,
LiquidatorHelper,
ValuationHelper
} from 'set-protocol-contracts';
import { ERC20Helper as ERC20Contracts } from 'set-protocol-contracts';
import { OracleHelper } from 'set-protocol-oracles';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down Expand Up @@ -113,6 +121,12 @@ contract('SocialTradingManager', accounts => {
const managerHelper = new ManagerHelper(deployerAccount);
const oracleHelper = new OracleHelper(deployerAccount);

const coreHelper = new CoreHelper(deployerAccount, deployerAccount);
const feeCalculatorHelper = new FeeCalculatorHelper(deployerAccount);
const ercContracts = new ERC20Contracts(deployerAccount);
const valuationHelper = new ValuationHelper(deployerAccount, coreHelper, ercContracts, oracleHelper);
const liquidatorHelper = new LiquidatorHelper(deployerAccount, ercContracts, valuationHelper);

before(async () => {
ABIDecoder.addABI(Core.abi);
ABIDecoder.addABI(SocialTradingManager.abi);
Expand Down Expand Up @@ -174,21 +188,25 @@ contract('SocialTradingManager', accounts => {
btcLegacyMakerOracleAdapter.address,
);

oracleWhiteList = await protocolHelper.deployOracleWhiteListAsync(
oracleWhiteList = await coreHelper.deployOracleWhiteListAsync(
[wrappedETH.address, wrappedBTC.address],
[ethOracleProxy.address, btcOracleProxy.address],
);

liquidator = await protocolHelper.deployLinearLiquidatorAsync(
liquidator = await liquidatorHelper.deployLinearAuctionLiquidatorAsync(
core.address,
oracleWhiteList.address
oracleWhiteList.address,
ONE_HOUR_IN_SECONDS.mul(4),
new BigNumber(3),
new BigNumber(21),
'LinearAuctionLiquidator'
);
liquidatorWhiteList = await protocolHelper.deployWhiteListAsync([liquidator.address, newLiquidator]);
liquidatorWhiteList = await coreHelper.deployWhiteListAsync([liquidator.address, newLiquidator]);

feeCalculator = await protocolHelper.deployFixedFeeCalculatorAsync();
feeCalculatorWhiteList = await protocolHelper.deployWhiteListAsync([feeCalculator.address]);
feeCalculator = await feeCalculatorHelper.deployFixedFeeCalculatorAsync();
feeCalculatorWhiteList = await coreHelper.deployWhiteListAsync([feeCalculator.address]);

rebalancingFactory = await protocolHelper.deployRebalancingSetTokenV2FactoryAsync(
rebalancingFactory = await coreHelper.deployRebalancingSetTokenV2FactoryAsync(
core.address,
rebalancingComponentWhiteList.address,
liquidatorWhiteList.address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';

import {
Expand All @@ -33,7 +33,7 @@ import {
import { getWeb3 } from '@utils/web3Helper';

import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/managers/triggers/rsiTrendingTrigger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';

import {
Expand All @@ -35,7 +35,7 @@ import { expectRevertError } from '@utils/tokenAssertions';
import { getWeb3 } from '@utils/web3Helper';

import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/integrations/assetPairManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BigNumber } from 'bignumber.js';

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { ether } from '@utils/units';
import {
Core,
Expand Down Expand Up @@ -57,7 +57,7 @@ import { getWeb3 } from '@utils/web3Helper';

import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { ManagerHelper } from '@utils/helpers/managerHelper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ProtocolHelper } from '@utils/helpers/protocolHelper';

BigNumberSetup.configure();
Expand Down
2 changes: 1 addition & 1 deletion test/scenarios/btc-eth/btcEthMultipleRebalance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { getWeb3 } from '@utils/web3Helper';

import { getScenarioData } from './scenarioData';
Expand Down
2 changes: 1 addition & 1 deletion test/scenarios/btc-eth/btcEthMultipleRebalanceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
4 changes: 2 additions & 2 deletions test/scenarios/btc-eth/btcEthRebalancing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import {
DEFAULT_GAS,
UNLIMITED_ALLOWANCE_IN_BASE_UNITS,
} from '@utils/constants';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { getWeb3 } from '@utils/web3Helper';

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import ChaiSetup from '@utils/chaiSetup';
import { BigNumberSetup } from '@utils/bigNumberSetup';
import { Blockchain } from '@utils/blockchain';
import { Blockchain } from 'set-protocol-contracts';
import { getWeb3 } from '@utils/web3Helper';

import { getScenarioData } from './scenarioData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {

import { ProtocolHelper } from '@utils/helpers/protocolHelper';
import { ERC20Helper } from '@utils/helpers/erc20Helper';
import { OracleHelper } from '@utils/helpers/oracleHelper';
import { OracleHelper } from 'set-protocol-oracles';
import { ManagerHelper } from '@utils/helpers/managerHelper';

BigNumberSetup.configure();
Expand Down
Loading