Skip to content

Commit

Permalink
feat: add event to baseStrategy
Browse files Browse the repository at this point in the history
pandadefi committed Jan 12, 2022
1 parent 179bbed commit efb47d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/BaseStrategy.sol
Original file line number Diff line number Diff line change
@@ -263,6 +263,9 @@ abstract contract BaseStrategy {

event UpdatedMetadataURI(string metadataURI);

event SetHealthCheck(address);
event SetDoHealthCheck(bool);

// The minimum number of seconds between harvest calls. See
// `setMinReportDelay()` for more details.
uint256 public minReportDelay;
@@ -364,10 +367,12 @@ abstract contract BaseStrategy {
}

function setHealthCheck(address _healthCheck) external onlyVaultManagers {
emit SetHealthCheck(_healthCheck);
healthCheck = _healthCheck;
}

function setDoHealthCheck(bool _doHealthCheck) external onlyVaultManagers {
emit SetDoHealthCheck(_doHealthCheck);
doHealthCheck = _doHealthCheck;
}

@@ -781,6 +786,7 @@ abstract contract BaseStrategy {
if (doHealthCheck && healthCheck != address(0)) {
require(HealthCheck(healthCheck).check(profit, loss, debtPayment, debtOutstanding, totalDebt), "!healthcheck");
} else {
emit SetDoHealthCheck(true);
doHealthCheck = true;
}

0 comments on commit efb47d8

Please sign in to comment.