Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed Jul 22, 2024
1 parent 94b5414 commit 585bce3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
5 changes: 4 additions & 1 deletion src/core/module/Strategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ abstract contract StrategyModule is Shared {

_deductLoss(strategyCached.allocated);
} else {
uint256 vaultStrategyBalance = IERC4626(_strategy).maxWithdraw(address(this));

$.strategies[_strategy].status = IEulerAggregationVault.StrategyStatus.Active;
$.strategies[_strategy].allocated = vaultStrategyBalance.toUint120();

$.totalAllocationPoints += strategyCached.allocationPoints;
$.totalAllocated += IERC4626(_strategy).maxWithdraw(address(this));
$.totalAllocated += vaultStrategyBalance;
}
}

Expand Down
24 changes: 13 additions & 11 deletions test/invariant/EulerAggregationLayerInvariants.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase {
function invariant_gulp() public {
eulerAggregationVault.gulp();

assertEq(
eulerAggregationVault.totalAssetsAllocatable(),
eulerAggregationVault.totalAssetsDeposited()
+ (eulerAggregationVault.getAggregationVaultSavingRate()).interestLeft
);
if (eulerAggregationVault.totalSupply() >= eulerAggregationVault.MIN_SHARES_FOR_GULP()) {
assertEq(
eulerAggregationVault.totalAssetsAllocatable(),
eulerAggregationVault.totalAssetsDeposited()
+ (eulerAggregationVault.getAggregationVaultSavingRate()).interestLeft
);
}
}

// totalAssetsDeposited should be equal to the totalAssetsAllocatable after SMEAR has passed.
Expand Down Expand Up @@ -169,13 +171,13 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase {
assertEq(eulerAggregationVault.getStrategy(address(0)).cap, 0);
}

function invariant_votingPower() public view {
address[] memory actorsList = actorUtil.getActors();
// function invariant_votingPower() public view {
// address[] memory actorsList = actorUtil.getActors();

for (uint256 i; i < actorsList.length; i++) {
assertEq(eulerAggregationVault.balanceOf(actorsList[i]), eulerAggregationVault.getVotes(actorsList[i]));
}
}
// for (uint256 i; i < actorsList.length; i++) {
// assertEq(eulerAggregationVault.balanceOf(actorsList[i]), eulerAggregationVault.getVotes(actorsList[i]));
// }
// }

function _deployOtherStrategies() private {
eTSTsecond = IEVault(
Expand Down

0 comments on commit 585bce3

Please sign in to comment.