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

@@ -10,6 +10,7 @@ pragma experimental ABIEncoderV2;
import {Storage} from "./Storage.sol";
/**
* @title Admin
* @author DODO Breeder
@@ -92,4 +93,30 @@ contract Admin is Storage {
function enableBaseDeposit() external onlyOwner notClosed {
_DEPOSIT_BASE_ALLOWED_ = true;
}
// ============ Advanced Control Functions ============
function disableBuying() external onlySupervisorOrOwner {
_BUYING_ALLOWED_ = false;
}
function enableBuying() external onlyOwner notClosed {
_BUYING_ALLOWED_ = true;
}
function disableSelling() external onlySupervisorOrOwner {
_SELLING_ALLOWED_ = false;
}
function enableSelling() external onlyOwner notClosed {
_SELLING_ALLOWED_ = true;
}
function setBaseBalanceLimit(uint256 newBaseBalanceLimit) external onlyOwner notClosed {
_BASE_BALANCE_LIMIT_ = newBaseBalanceLimit;
}
function setQuoteBalanceLimit(uint256 newQuoteBalanceLimit) external onlyOwner notClosed {
_QUOTE_BALANCE_LIMIT_ = newQuoteBalanceLimit;
}
}