add dvm && dpp admin control
This commit is contained in:
@@ -15,7 +15,6 @@ import {IERC20} from "../../intf/IERC20.sol";
|
||||
import {DPPTrader} from "./DPPTrader.sol";
|
||||
|
||||
contract DPP is DPPTrader {
|
||||
|
||||
constructor() public {
|
||||
_FACTORY_ = msg.sender;
|
||||
}
|
||||
@@ -34,6 +33,7 @@ contract DPP is DPPTrader {
|
||||
) external {
|
||||
require(msg.sender == _FACTORY_, 'INIT FORBIDDEN');
|
||||
initOwner(owner);
|
||||
_ADMIN_ = owner;
|
||||
_MAINTAINER_ = maintainer;
|
||||
_BASE_TOKEN_ = IERC20(baseTokenAddress);
|
||||
_QUOTE_TOKEN_ = IERC20(quoteTokenAddress);
|
||||
|
||||
58
contracts/DODOPrivatePool/impl/DPPAdmin.sol
Normal file
58
contracts/DODOPrivatePool/impl/DPPAdmin.sol
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
|
||||
Copyright 2020 DODO ZOO.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {IDPP} from "../intf/IDPP.sol";
|
||||
import {InitializableOwnable} from "../../lib/InitializableOwnable.sol";
|
||||
|
||||
contract DPPAdmin is InitializableOwnable {
|
||||
|
||||
address public dpp;
|
||||
|
||||
function init(address owner, address _dpp) external {
|
||||
initOwner(owner);
|
||||
dpp = _dpp;
|
||||
}
|
||||
|
||||
function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
|
||||
IDPP(dpp).setLpFeeRateModel(newLpFeeRateModel);
|
||||
}
|
||||
|
||||
function setMtFeeRateModel(address newMtFeeRateModel) external onlyOwner {
|
||||
IDPP(dpp).setMtFeeRateModel(newMtFeeRateModel);
|
||||
}
|
||||
|
||||
function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
|
||||
IDPP(dpp).setTradePermissionManager(newTradePermissionManager);
|
||||
}
|
||||
|
||||
function setMaintainer(address newMaintainer) external onlyOwner {
|
||||
IDPP(dpp).setMaintainer(newMaintainer);
|
||||
}
|
||||
|
||||
function setGasPriceSource(address newGasPriceLimitSource) external onlyOwner {
|
||||
IDPP(dpp).setGasPriceSource(newGasPriceLimitSource);
|
||||
}
|
||||
|
||||
function setISource(address newISource) external onlyOwner {
|
||||
IDPP(dpp).setISource(newISource);
|
||||
}
|
||||
|
||||
function setKSource(address newKSource) external onlyOwner {
|
||||
IDPP(dpp).setKSource(newKSource);
|
||||
}
|
||||
|
||||
function setBuy(bool open) external onlyOwner {
|
||||
IDPP(dpp).setBuy(open);
|
||||
}
|
||||
|
||||
function setSell(bool open) external onlyOwner {
|
||||
IDPP(dpp).setSell(open);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ contract DPPStorage is InitializableOwnable, ReentrancyGuard {
|
||||
using SafeMath for uint256;
|
||||
|
||||
address public _FACTORY_;
|
||||
address public _ADMIN_;
|
||||
|
||||
// ============ Variables for Control ============
|
||||
|
||||
|
||||
Reference in New Issue
Block a user