remove operator

This commit is contained in:
mingda
2020-11-26 00:41:38 +08:00
parent d6e16d5c52
commit c6f7ac0431
4 changed files with 10 additions and 15 deletions

View File

@@ -18,7 +18,6 @@ contract DPP is DPPTrader {
function init(
address owner,
address maintainer,
address operator,
address baseTokenAddress,
address quoteTokenAddress,
address lpFeeRateModel,
@@ -31,7 +30,6 @@ contract DPP is DPPTrader {
) external {
initOwner(owner);
_MAINTAINER_ = maintainer;
_OPERATOR_ = operator;
_BASE_TOKEN_ = IERC20(baseTokenAddress);
_QUOTE_TOKEN_ = IERC20(quoteTokenAddress);
_LP_FEE_RATE_MODEL_ = IFeeRateModel(lpFeeRateModel);

View File

@@ -43,7 +43,6 @@ contract DPPStorage is InitializableOwnable, ReentrancyGuard {
// ============ Core Address ============
address public _MAINTAINER_; // collect maintainer fee
address public _OPERATOR_;
IERC20 public _BASE_TOKEN_;
IERC20 public _QUOTE_TOKEN_;

View File

@@ -71,13 +71,7 @@ contract DPPVault is DPPStorage {
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount
) public {
require(
msg.sender == _OWNER_ ||
(msg.sender == ISmartApprove(_DODO_SMART_APPROVE_).getSmartSwap() &&
from == _OPERATOR_),
"RESET FORBIDDEN"
);
) public onlyOwner {
require(newK > 0 && newK <= 10**18, "K OUT OF RANGE!");
if (baseOutAmount > 0) _transferBaseOut(from, baseOutAmount);
if (quoteOutAmount > 0) _transferQuoteOut(from, quoteOutAmount);