ebtc-protocol / ebtc

GNU General Public License v3.0
56 stars 25 forks source link

Create setters to set collateral feed source on PriceFeed #771

Closed wtj2021 closed 9 months ago

wtj2021 commented 9 months ago

// setStEthFeedSource.selector contract StEthFeedSourcePermissionlessSetter { PriceFeed public immutable PRICE_FEED;

uint256 depegTimestamp;

function setFeedSource() external {
    if(dynamic -> fixed) {
        PRICE_FEED.setStEthFeedSource(fixed);
    } else if (fixed -> dynamic) {
        // depeg > 20%
        // block.timestamp - depegTimestamp > duration
        PRICE_FEED.setStEthFeedSource(dynamic);
    }
}

}

// setStEthFeedSource.selector contract StEthFeedSourceHyperNativeSetter { PriceFeed public immutable PRICE_FEED;

function setFeedSource(bool _useFixedFeed) external onlyHyperNative {
    PRICE_FEED.setStEthFeedSource(_useFixedFeed);
}

}