dodo-start && cpV2 ing

This commit is contained in:
owen05
2021-12-02 16:15:22 +08:00
parent 63c1d9c70c
commit 4471274053
13 changed files with 555 additions and 111 deletions

View File

@@ -50,7 +50,7 @@ contract DPPStorage is InitializableOwnable, ReentrancyGuard {
// ============ Helper Functions ============
function getPMMState() public view returns (PMMPricing.PMMState memory state) {
(state.i,,,) = IOracle(_I_).getPrice(address(_BASE_TOKEN_));
state.i = IOracle(_I_).prices(address(_BASE_TOKEN_));
state.K = _K_;
state.B = _BASE_RESERVE_;
state.Q = _QUOTE_RESERVE_;

View File

@@ -39,9 +39,8 @@ contract DPPTrader is DPPVault {
event RChange(PMMPricing.RState newRState);
modifier isOraclePriceValid() {
(, bool isValid, bool isStale,) = IOracle(_I_).getPrice(address(_BASE_TOKEN_));
require(isValid, "ORACLE_PRICE_INVALID");
require(!isStale, "ORACLE_PRICE_STALE");
bool isFeasible = IOracle(_I_).isFeasible(address(_BASE_TOKEN_));
require(isFeasible, "ORACLE_PRICE_INVALID");
_;
}