Skip to content

Commit

Permalink
chore: check for v3 vault
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 15, 2024
1 parent 30ff05d commit 33953b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/AprOracle/AprOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ contract AprOracle is Governance {
if (oracle != address(0)) {
return IOracle(oracle).aprAfterDebtChange(_strategy, _debtChange);
} else {
// This will revert for non v3 vaults.
return getExpectedApr(_strategy, _debtChange);
// If the vault is a v3 vault, we can get default to the expected apr.
try IVault(_strategy).fullProfitUnlockDate() returns (uint256) {
return getExpectedApr(_strategy, _debtChange);
} catch {
// Else just return 0.
return 0;
}
}
}

Expand Down

0 comments on commit 33953b5

Please sign in to comment.