diff --git a/src/contracts/AaveStewardInjector.sol b/src/contracts/AaveStewardInjector.sol index 4784d69..9d91672 100644 --- a/src/contracts/AaveStewardInjector.sol +++ b/src/contracts/AaveStewardInjector.sol @@ -45,12 +45,7 @@ contract AaveStewardInjector is Ownable, IAaveStewardInjector { * @param guardian address of the guardian / owner of the stewards injector. * @param whitelistedAsset address of the whitelisted asset for which update can be injected. */ - constructor( - address riskOracle, - address riskSteward, - address guardian, - address whitelistedAsset - ) { + constructor(address riskOracle, address riskSteward, address guardian, address whitelistedAsset) { RISK_ORACLE = riskOracle; RISK_STEWARD = riskSteward; WHITELISTED_ASSET = whitelistedAsset; @@ -62,10 +57,8 @@ contract AaveStewardInjector is Ownable, IAaveStewardInjector { * @dev run off-chain, checks if the latest update from risk oracle should be injected on risk steward */ function checkUpkeep(bytes memory) public view virtual override returns (bool, bytes memory) { - IRiskOracle.RiskParameterUpdate memory updateRiskParams = IRiskOracle(RISK_ORACLE).getLatestUpdateByParameterAndMarket( - WHITELISTED_UPDATE_TYPE, - WHITELISTED_ASSET - ); + IRiskOracle.RiskParameterUpdate memory updateRiskParams = IRiskOracle(RISK_ORACLE) + .getLatestUpdateByParameterAndMarket(WHITELISTED_UPDATE_TYPE, WHITELISTED_ASSET); if (_canUpdateBeInjected(updateRiskParams)) return (true, ''); @@ -77,10 +70,8 @@ contract AaveStewardInjector is Ownable, IAaveStewardInjector { * @dev executes injection of the latest update from the risk oracle into the risk steward. */ function performUpkeep(bytes calldata) external override { - IRiskOracle.RiskParameterUpdate memory updateRiskParams = IRiskOracle(RISK_ORACLE).getLatestUpdateByParameterAndMarket( - WHITELISTED_UPDATE_TYPE, - WHITELISTED_ASSET - ); + IRiskOracle.RiskParameterUpdate memory updateRiskParams = IRiskOracle(RISK_ORACLE) + .getLatestUpdateByParameterAndMarket(WHITELISTED_UPDATE_TYPE, WHITELISTED_ASSET); if (!_canUpdateBeInjected(updateRiskParams)) { revert UpdateCannotBeInjected(); @@ -114,7 +105,9 @@ contract AaveStewardInjector is Ownable, IAaveStewardInjector { * @param updateRiskParams struct containing the risk param update from the risk oralce to check if it can be injected. * @return true if the update could be injected to the risk steward, false otherwise. */ - function _canUpdateBeInjected(IRiskOracle.RiskParameterUpdate memory updateRiskParams) internal view returns (bool) { + function _canUpdateBeInjected( + IRiskOracle.RiskParameterUpdate memory updateRiskParams + ) internal view returns (bool) { return ( !isUpdateIdExecuted(updateRiskParams.updateId) && (updateRiskParams.timestamp + EXPIRATION_PERIOD > block.timestamp) && diff --git a/src/contracts/RiskSteward.sol b/src/contracts/RiskSteward.sol index 0cbd387..e08e54f 100644 --- a/src/contracts/RiskSteward.sol +++ b/src/contracts/RiskSteward.sol @@ -242,7 +242,6 @@ contract RiskSteward is Ownable, IRiskSteward { if (_restrictedAddresses[asset]) revert AssetIsRestricted(); if (collateralUpdates[i].liqProtocolFee != EngineFlags.KEEP_CURRENT) revert ParamChangeNotAllowed(); - if ( collateralUpdates[i].ltv == 0 || collateralUpdates[i].liqThreshold == 0 || diff --git a/tests/EdgeRiskSteward.t.sol b/tests/EdgeRiskSteward.t.sol index 9db83db..a35c5b9 100644 --- a/tests/EdgeRiskSteward.t.sol +++ b/tests/EdgeRiskSteward.t.sol @@ -99,7 +99,9 @@ contract EdgeRiskSteward_Test is RiskSteward_Test { /* ----------------------------- LST Price Cap Tests ----------------------------- */ function test_updateLstPriceCap() public { - IRiskSteward.PriceCapLstUpdate[] memory priceCapUpdates = new IRiskSteward.PriceCapLstUpdate[](1); + IRiskSteward.PriceCapLstUpdate[] memory priceCapUpdates = new IRiskSteward.PriceCapLstUpdate[]( + 1 + ); priceCapUpdates[0] = IRiskSteward.PriceCapLstUpdate({ oracle: AaveV3EthereumAssets.wstETH_ORACLE, priceCapUpdateParams: IPriceCapAdapter.PriceCapUpdateParams({ @@ -117,7 +119,8 @@ contract EdgeRiskSteward_Test is RiskSteward_Test { /* ----------------------------- Stable Price Cap Test ----------------------------- */ function test_updateStablePriceCap() public { - IRiskSteward.PriceCapStableUpdate[] memory priceCapUpdates = new IRiskSteward.PriceCapStableUpdate[](1); + IRiskSteward.PriceCapStableUpdate[] + memory priceCapUpdates = new IRiskSteward.PriceCapStableUpdate[](1); priceCapUpdates[0] = IRiskSteward.PriceCapStableUpdate({ oracle: AaveV3EthereumAssets.USDT_ORACLE, diff --git a/tests/RiskSteward.t.sol b/tests/RiskSteward.t.sol index 3d4ef38..a886ac0 100644 --- a/tests/RiskSteward.t.sol +++ b/tests/RiskSteward.t.sol @@ -685,9 +685,11 @@ contract RiskSteward_Test is Test { vm.warp(block.timestamp + 1 days); - debtCeilingBefore = AaveV3Ethereum.AAVE_PROTOCOL_DATA_PROVIDER.getDebtCeiling( - AaveV3EthereumAssets.UNI_UNDERLYING - ) / 100; + debtCeilingBefore = + AaveV3Ethereum.AAVE_PROTOCOL_DATA_PROVIDER.getDebtCeiling( + AaveV3EthereumAssets.UNI_UNDERLYING + ) / + 100; collateralUpdates[0] = IEngine.CollateralUpdate({ asset: AaveV3EthereumAssets.UNI_UNDERLYING, diff --git a/tests/RiskStewardCapo.t.sol b/tests/RiskStewardCapo.t.sol index 702286d..a5874b1 100644 --- a/tests/RiskStewardCapo.t.sol +++ b/tests/RiskStewardCapo.t.sol @@ -337,7 +337,9 @@ contract RiskSteward_Capo_Test is Test { .getSnapshotTimestamp(); vm.startPrank(riskCouncil); - IRiskSteward.PriceCapLstUpdate[] memory priceCapUpdates = new IRiskSteward.PriceCapLstUpdate[](1); + IRiskSteward.PriceCapLstUpdate[] memory priceCapUpdates = new IRiskSteward.PriceCapLstUpdate[]( + 1 + ); priceCapUpdates[0] = IRiskSteward.PriceCapLstUpdate({ oracle: AaveV3EthereumAssets.wstETH_ORACLE, priceCapUpdateParams: IPriceCapAdapter.PriceCapUpdateParams({ @@ -348,7 +350,9 @@ contract RiskSteward_Capo_Test is Test { }); // if same snapshot timestamp is used reverts - vm.expectRevert(abi.encodeWithSelector(IPriceCapAdapter.InvalidRatioTimestamp.selector, snapshotTsBefore)); + vm.expectRevert( + abi.encodeWithSelector(IPriceCapAdapter.InvalidRatioTimestamp.selector, snapshotTsBefore) + ); steward.updateLstPriceCaps(priceCapUpdates); priceCapUpdates[0] = IRiskSteward.PriceCapLstUpdate({