第一次走查

This commit is contained in:
mingda
2020-11-28 17:44:39 +08:00
parent 7fc0ede7ea
commit 13904ae413
27 changed files with 667 additions and 856 deletions

View File

@@ -9,16 +9,20 @@ pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {IDPP} from "../intf/IDPP.sol";
import {IDODOApprove} from '../../intf/IDODOApprove.sol';
import {IDODOApprove} from "../../intf/IDODOApprove.sol";
import {InitializableOwnable} from "../../lib/InitializableOwnable.sol";
contract DPPAdmin is InitializableOwnable {
address public _DPP_;
address public _OPERATOR_;
address public _OPERATOR_;
address public _DODO_APPROVE_;
function init(address owner, address dpp,address operator, address dodoApprove) external {
function init(
address owner,
address dpp,
address operator,
address dodoApprove
) external {
initOwner(owner);
_DPP_ = dpp;
_OPERATOR_ = operator;
@@ -29,33 +33,33 @@ contract DPPAdmin is InitializableOwnable {
_OPERATOR_ = newOperator;
}
function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
IDPP(_DPP_).setLpFeeRateModel(newLpFeeRateModel);
}
// function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
// IDPP(_DPP_).setLpFeeRateModel(newLpFeeRateModel);
// }
function setMtFeeRateModel(address newMtFeeRateModel) external onlyOwner {
IDPP(_DPP_).setMtFeeRateModel(newMtFeeRateModel);
}
// function setMtFeeRateModel(address newMtFeeRateModel) external onlyOwner {
// IDPP(_DPP_).setMtFeeRateModel(newMtFeeRateModel);
// }
function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
IDPP(_DPP_).setTradePermissionManager(newTradePermissionManager);
}
// 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 setGasPriceSource(address newGasPriceLimitSource) external onlyOwner {
// IDPP(_DPP_).setGasPriceSource(newGasPriceLimitSource);
// }
function setISource(address newISource) external onlyOwner {
IDPP(_DPP_).setISource(newISource);
}
// function setISource(address newISource) external onlyOwner {
// IDPP(_DPP_).setISource(newISource);
// }
function setKSource(address newKSource) external onlyOwner {
IDPP(_DPP_).setKSource(newKSource);
}
// function setKSource(address newKSource) external onlyOwner {
// IDPP(_DPP_).setKSource(newKSource);
// }
function setBuy(bool open) external onlyOwner {
IDPP(_DPP_).setBuy(open);
@@ -65,12 +69,16 @@ contract DPPAdmin is InitializableOwnable {
IDPP(_DPP_).setSell(open);
}
function retrieve(address payable to,address token,uint256 amount) external onlyOwner {
IDPP(_DPP_).retrieve(to,token,amount);
function retrieve(
address payable to,
address token,
uint256 amount
) external onlyOwner {
IDPP(_DPP_).retrieve(to, token, amount);
}
function reset(
address assetTo,
address operator,
uint256 newLpFeeRate,
uint256 newMtFeeRate,
uint256 newI,
@@ -78,28 +86,12 @@ contract DPPAdmin is InitializableOwnable {
uint256 baseOutAmount,
uint256 quoteOutAmount
) external {
require(msg.sender == _OWNER_ || (msg.sender == IDODOApprove(_DODO_APPROVE_).getDODOProxy() && assetTo == _OPERATOR_), "RESET FORBIDDEN");
IDPP(_DPP_).reset(
assetTo,
newLpFeeRate,
newMtFeeRate,
newI,
newK,
baseOutAmount,
quoteOutAmount
require(
msg.sender == _OWNER_ ||
(msg.sender == IDODOApprove(_DODO_APPROVE_).getDODOProxy() &&
operator == _OPERATOR_),
"RESET FORBIDDEN"
);
}
function resetETH(
address from,
uint256 newLpFeeRate,
uint256 newMtFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount
) external {
require(msg.sender == _OWNER_ || (msg.sender == IDODOApprove(_DODO_APPROVE_).getDODOProxy() && from == _OPERATOR_), "RESET FORBIDDEN");
IDPP(_DPP_).reset(
msg.sender,
newLpFeeRate,