From 0e29bcc832313939cdfd84166eb362dcd801e792 Mon Sep 17 00:00:00 2001 From: tracy <25892474+traceurl@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:59:56 +0800 Subject: [PATCH] FeeRateDIP3Impl: add whitelist --- contracts/DODOFee/FeeRateDIP3Impl.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contracts/DODOFee/FeeRateDIP3Impl.sol b/contracts/DODOFee/FeeRateDIP3Impl.sol index 1b19e8f..aa286b1 100644 --- a/contracts/DODOFee/FeeRateDIP3Impl.sol +++ b/contracts/DODOFee/FeeRateDIP3Impl.sol @@ -15,6 +15,7 @@ import {SafeMath} from "../lib/SafeMath.sol"; interface ICrowdPooling { function _QUOTE_RESERVE_() external view returns (uint256); function getShares(address user) external view returns (uint256); + function _OWNER_() external returns (address); } interface IFee { @@ -103,6 +104,13 @@ contract FeeRateDIP3Impl is InitializableOwnable { poolHeartBeat = newPoolHeartBeat; } + // ============ Pool Owner Functions ============ + + function setCpPoolQuotaAddr(address cpPool, address quotaAddr) external { + require(msg.sender == ICrowdPooling(cpPool)._OWNER_(), "NOT OWNER OF POOL"); + cpPools[cpPool].quotaAddr = quotaAddr; + } + // ============ View Functions ============ function getFeeRate(address pool, address user) external view returns (uint256) { @@ -209,4 +217,8 @@ contract FeeRateDIP3Impl is InitializableOwnable { function _kjudge(bytes32 _hashPoolVersion) internal pure returns (bool) { return (_hashPoolVersion == keccak256(abi.encodePacked("DVM 1.0.2")) || _hashPoolVersion == keccak256(abi.encodePacked("DSP 1.0.1")) || _hashPoolVersion == keccak256(abi.encodePacked("DPP 1.0.0")) || _hashPoolVersion == keccak256(abi.encodePacked("DPP Advanced 1.0.0"))); } + + function version() virtual external pure returns (string memory) { + return "1.2.0"; + } }