From 57742ae7fc8cadebae6cc581ca91e84e83817157 Mon Sep 17 00:00:00 2001 From: tracy <25892474+traceurl@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:09:18 +0800 Subject: [PATCH] unchange FeeRateModel --- contracts/Factory/CrowdPoolingFactory.sol | 7 ++++--- contracts/SmartRoute/intf/IDODOV2.sol | 3 ++- contracts/lib/FeeRateModel.sol | 5 ----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/contracts/Factory/CrowdPoolingFactory.sol b/contracts/Factory/CrowdPoolingFactory.sol index 267793d..be10f4b 100644 --- a/contracts/Factory/CrowdPoolingFactory.sol +++ b/contracts/Factory/CrowdPoolingFactory.sol @@ -14,9 +14,9 @@ import {ICP} from "../CrowdPooling/intf/ICP.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {IERC20} from "../intf/IERC20.sol"; import {DecimalMath} from "../lib/DecimalMath.sol"; +import {FeeRateModel} from "../lib/FeeRateModel.sol"; -interface IFeeRateModel { - function getFeeRate(address trader) external view returns (uint256); +interface IFeeRateImpl { function addCpPoolInfo(address cpPool, address quoteToken, int globalQuota, address feeAddr, address quotaAddr) external; } @@ -131,7 +131,8 @@ contract CrowdPoolingFactory is InitializableOwnable { switches ); - IFeeRateModel(_DEFAULT_MT_FEE_RATE_MODEL_).addCpPoolInfo(cpAddress, tokens[1], globalQuota, address(0), address(0)); + address feeRateImplAddr = FeeRateModel(_DEFAULT_MT_FEE_RATE_MODEL_).feeRateImpl(); + IFeeRateImpl(feeRateImplAddr).addCpPoolInfo(cpAddress, tokens[1], globalQuota, address(0), address(0)); } _REGISTRY_[tokens[0]][tokens[1]].push(cpAddress); diff --git a/contracts/SmartRoute/intf/IDODOV2.sol b/contracts/SmartRoute/intf/IDODOV2.sol index 9c9c688..a307616 100644 --- a/contracts/SmartRoute/intf/IDODOV2.sol +++ b/contracts/SmartRoute/intf/IDODOV2.sol @@ -90,7 +90,8 @@ interface IDODOV2 { address[] memory tokens, uint256[] memory timeLine, uint256[] memory valueList, - bool[] memory switches + bool[] memory switches, + int globalQuota ) external; function bid(address to) external; diff --git a/contracts/lib/FeeRateModel.sol b/contracts/lib/FeeRateModel.sol index 551a5c1..e64387d 100644 --- a/contracts/lib/FeeRateModel.sol +++ b/contracts/lib/FeeRateModel.sol @@ -12,7 +12,6 @@ import {InitializableOwnable} from "../lib/InitializableOwnable.sol"; interface IFeeRateImpl { function getFeeRate(address pool, address trader) external view returns (uint256); - function addCpPoolInfo(address cpPool, address quoteToken, int globalQuota, address feeAddr, address quotaAddr) external; } interface IFeeRateModel { @@ -31,8 +30,4 @@ contract FeeRateModel is InitializableOwnable { return 0; return IFeeRateImpl(feeRateImpl).getFeeRate(msg.sender,trader); } - - function addCpPoolInfo(address cpPool, address quoteToken, int globalQuota, address feeAddr, address quotaAddr) external { - IFeeRateImpl(feeRateImpl).addCpPoolInfo(cpPool, quoteToken, globalQuota, feeAddr, quotaAddr); - } }