enable/disable oracle; remove isPriceValid modifier
This commit is contained in:
@@ -38,20 +38,12 @@ contract DPPTrader is DPPVault {
|
||||
|
||||
event RChange(PMMPricing.RState newRState);
|
||||
|
||||
modifier isPriceValid() {
|
||||
if (_IS_ORACLE_ENABLED) {
|
||||
bool isFeasible = IOracle(_I_).isFeasible(address(_BASE_TOKEN_));
|
||||
require(isFeasible, "ORACLE_PRICE_INVALID");
|
||||
}
|
||||
_;
|
||||
}
|
||||
|
||||
// ============ Trade Functions ============
|
||||
|
||||
function sellBase(address to)
|
||||
external
|
||||
preventReentrant
|
||||
isPriceValid
|
||||
returns (uint256 receiveQuoteAmount)
|
||||
{
|
||||
uint256 baseBalance = _BASE_TOKEN_.balanceOf(address(this));
|
||||
@@ -87,7 +79,6 @@ contract DPPTrader is DPPVault {
|
||||
function sellQuote(address to)
|
||||
external
|
||||
preventReentrant
|
||||
isPriceValid
|
||||
returns (uint256 receiveBaseAmount)
|
||||
{
|
||||
uint256 quoteBalance = _QUOTE_TOKEN_.balanceOf(address(this));
|
||||
@@ -128,7 +119,7 @@ contract DPPTrader is DPPVault {
|
||||
uint256 quoteAmount,
|
||||
address _assetTo,
|
||||
bytes calldata data
|
||||
) external isPriceValid preventReentrant {
|
||||
) external preventReentrant {
|
||||
address assetTo = _assetTo;
|
||||
_transferBaseOut(assetTo, baseAmount);
|
||||
_transferQuoteOut(assetTo, quoteAmount);
|
||||
|
||||
Reference in New Issue
Block a user