From 6b7546fa166110650a86310357d5a28db187920a Mon Sep 17 00:00:00 2001 From: Haythem Sellami <17862704+haythemsellami@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:22:05 +0300 Subject: [PATCH] add invariant --- test/invariant/EulerAggregationLayerInvariants.t.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/invariant/EulerAggregationLayerInvariants.t.sol b/test/invariant/EulerAggregationLayerInvariants.t.sol index 622bdcac..e907ae24 100644 --- a/test/invariant/EulerAggregationLayerInvariants.t.sol +++ b/test/invariant/EulerAggregationLayerInvariants.t.sol @@ -124,6 +124,13 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase { } } + function invariant_interestLeft() public view { + EulerAggregationVault.AggregationVaultSavingRate memory aggregationVaultSavingRate = + eulerAggregationVault.getAggregationVaultSavingRate(); + uint256 accruedInterest = eulerAggregationVault.interestAccrued(); + assertGe(aggregationVaultSavingRate.interestLeft, accruedInterest); + } + function _deployOtherStrategies() private { eTSTsecond = IEVault( factory.createProxy(address(0), true, abi.encodePacked(address(assetTST), address(oracle), unitOfAccount))