Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not stop refreshing prices for DISABLED collateral #902

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions contracts/plugins/assets/AppreciatingFiatCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ abstract contract AppreciatingFiatCollateral is FiatCollateral {
/// Refresh exchange rates and update default status.
/// @dev Should not need to override: can handle collateral with variable refPerTok()
function refresh() public virtual override {
if (alreadyDefaulted()) {
// continue to update rates
exposedReferencePrice = _underlyingRefPerTok().mul(revenueShowing);
return;
}

CollateralStatus oldStatus = status();

// Check for hard default
Expand Down
5 changes: 0 additions & 5 deletions contracts/plugins/assets/FiatCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ contract FiatCollateral is ICollateral, Asset {
/// Refresh exchange rates and update default status.
/// @dev May need to override: limited to handling collateral with refPerTok() = 1
function refresh() public virtual override(Asset, IAsset) {
if (alreadyDefaulted()) return;
CollateralStatus oldStatus = status();

// Check for soft default + save lotPrice
Expand Down Expand Up @@ -191,10 +190,6 @@ contract FiatCollateral is ICollateral, Asset {
}
}

function alreadyDefaulted() internal view returns (bool) {
return _whenDefault <= block.timestamp;
}

function whenDefault() external view returns (uint256) {
return _whenDefault;
}
Expand Down
6 changes: 0 additions & 6 deletions contracts/plugins/assets/compoundv3/CTokenV3Collateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ contract CTokenV3Collateral is AppreciatingFiatCollateral {
function refresh() public virtual override {
ICusdcV3Wrapper(address(erc20)).accrue();

if (alreadyDefaulted()) {
// continue to update rates
exposedReferencePrice = _underlyingRefPerTok().mul(revenueShowing);
return;
}

CollateralStatus oldStatus = status();

// Check for hard default
Expand Down
6 changes: 0 additions & 6 deletions contracts/plugins/assets/curve/CurveStableCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ contract CurveStableCollateral is AppreciatingFiatCollateral, PoolTokens {
/// Refresh exchange rates and update default status.
/// Have to override to add custom default checks
function refresh() public virtual override {
if (alreadyDefaulted()) {
// continue to update rates
exposedReferencePrice = _underlyingRefPerTok().mul(revenueShowing);
return;
}

CollateralStatus oldStatus = status();

// Check for hard default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ contract StargatePoolFiatCollateral is FiatCollateral {
/// Refresh exchange rates and update default status.
/// @dev Should not need to override: can handle collateral with variable refPerTok()
function refresh() public virtual override {
if (alreadyDefaulted()) return;

CollateralStatus oldStatus = status();

// Check for hard default
Expand Down
6 changes: 0 additions & 6 deletions contracts/plugins/mocks/BadCollateralPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ contract BadCollateralPlugin is ATokenFiatCollateral {
/// Refresh exchange rates and update default status.
/// @dev Should be general enough to not need to be overridden
function refresh() public virtual override {
if (alreadyDefaulted()) {
// continue to update rates
exposedReferencePrice = _underlyingRefPerTok().mul(revenueShowing);
return;
}

CollateralStatus oldStatus = status();

// Check for hard default
Expand Down