Skip to content

Commit

Permalink
fix convert fees total shares
Browse files Browse the repository at this point in the history
  • Loading branch information
dglowinski committed Mar 26, 2024
1 parent 7d2408d commit 1b27a93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EVault/modules/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ abstract contract GovernanceModule is IGovernance, Base, BalanceUtils, BorrowUti
Shares governorShares = vaultCache.accumulatedFees.mulDiv(1e4 - protocolFee, 1e4);
Shares protocolShares = vaultCache.accumulatedFees - governorShares;

vaultStorage.accumulatedFees = vaultCache.accumulatedFees = Shares.wrap(0);

// Decrease totalShares because increaseBalance will increase it by that total amount
vaultStorage.totalShares = vaultCache.totalShares = vaultCache.totalShares - vaultCache.accumulatedFees;

vaultStorage.accumulatedFees = vaultCache.accumulatedFees = Shares.wrap(0);

// For the Deposit events in increaseBalance the assets amount is zero - the shares are covered with the accrued interest
if (!governorShares.isZero()) {
increaseBalance(vaultCache, governorReceiver, address(0), governorShares, Assets.wrap(0));
Expand Down

0 comments on commit 1b27a93

Please sign in to comment.