DPP factory and init

This commit is contained in:
owen05
2020-11-22 18:20:09 +08:00
parent 857e4fc01a
commit f2656d6b2a
19 changed files with 376 additions and 109 deletions

View File

@@ -25,10 +25,7 @@ contract DPPTrader is DPPVault {
}
modifier isSellAllow(address trader) {
require(
!_SELLING_CLOSE_ && _TRADE_PERMISSION_.isAllowed(trader),
"TRADER_SELL_NOT_ALLOWED"
);
require(!_SELLING_CLOSE_ && _TRADE_PERMISSION_.isAllowed(trader),"TRADER_SELL_NOT_ALLOWED");
_;
}
@@ -50,7 +47,8 @@ contract DPPTrader is DPPVault {
uint256 mtFee;
uint256 newBaseTarget;
PMMPricing.RState newRState;
(receiveQuoteAmount, mtFee, newRState, newBaseTarget) = querySellBase(tx.origin, baseInput);
//TODO: confirm
(receiveQuoteAmount, mtFee, newRState, newBaseTarget) = querySellBase(to, baseInput);
_transferQuoteOut(to, receiveQuoteAmount);
_transferQuoteOut(_MAINTAINER_, mtFee);
@@ -76,11 +74,9 @@ contract DPPTrader is DPPVault {
uint256 quoteInput = getQuoteInput();
uint256 mtFee;
uint256 newQuoteTarget;
PMMPricing.RState newRState;
(receiveBaseAmount, mtFee, newRState, newQuoteTarget) = querySellQuote(
tx.origin,
quoteInput
);
(receiveBaseAmount, mtFee, newRState, newQuoteTarget) = querySellQuote(to,quoteInput);
_transferBaseOut(to, receiveBaseAmount);
_transferBaseOut(_MAINTAINER_, mtFee);