Add buying, selling and capital limit controls

These advanced controls are disabled by default.

Also disable depositing and trading when creating a new DODO.
This commit is contained in:
Michael Zhou
2020-09-08 19:45:17 +08:00
parent 8a5cca991f
commit 30040834f6
9 changed files with 651 additions and 266 deletions

View File

@@ -16,6 +16,7 @@ import {LiquidityProvider} from "./impl/LiquidityProvider.sol";
import {Admin} from "./impl/Admin.sol";
import {DODOLpToken} from "./impl/DODOLpToken.sol";
/**
* @title DODO
* @author DODO Breeder
@@ -48,11 +49,18 @@ contract DODO is Admin, Trader, LiquidityProvider {
_QUOTE_TOKEN_ = quoteToken;
_ORACLE_ = oracle;
_DEPOSIT_BASE_ALLOWED_ = true;
_DEPOSIT_QUOTE_ALLOWED_ = true;
_TRADE_ALLOWED_ = true;
_DEPOSIT_BASE_ALLOWED_ = false;
_DEPOSIT_QUOTE_ALLOWED_ = false;
_TRADE_ALLOWED_ = false;
_GAS_PRICE_LIMIT_ = gasPriceLimit;
// Advanced controls are disabled by default
_BUYING_ALLOWED_ = true;
_SELLING_ALLOWED_ = true;
uint256 MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
_BASE_BALANCE_LIMIT_ = MAX_INT;
_QUOTE_BALANCE_LIMIT_ = MAX_INT;
_LP_FEE_RATE_ = lpFeeRate;
_MT_FEE_RATE_ = mtFeeRate;
_K_ = k;