Skip to content

Commit

Permalink
fix: cantina 490
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpawlowski committed Jul 4, 2024
1 parent f301947 commit 67533d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/EVault/shared/BalanceUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ abstract contract BalanceUtils is Base {
Shares newFromBalance = origFromBalance.subUnchecked(amount);
user.setBalance(newFromBalance);

if (fromBalanceForwarderEnabled) {
balanceTracker.balanceTrackerHook(from, newFromBalance.toUint(), isControlCollateralInProgress());
}

// update to

user = vaultStorage.users[to];
Expand All @@ -89,11 +93,7 @@ abstract contract BalanceUtils is Base {
Shares newToBalance = origToBalance + amount;
user.setBalance(newToBalance);

if (fromBalanceForwarderEnabled) {
balanceTracker.balanceTrackerHook(from, newFromBalance.toUint(), isControlCollateralInProgress());
}

if (toBalanceForwarderEnabled && from != to) {
if (toBalanceForwarderEnabled) {
balanceTracker.balanceTrackerHook(to, newToBalance.toUint(), false);
}
}
Expand Down

0 comments on commit 67533d4

Please sign in to comment.