Skip to content

Commit

Permalink
fix: properly compute balances
Browse files Browse the repository at this point in the history
  • Loading branch information
guil-lambert committed Nov 21, 2023
1 parent e5306c0 commit 833ed84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/CollateralTracker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1371,10 +1371,10 @@ contract CollateralTracker is ERC20Minimal, Multicall {
uint256 collateralAmount = convertToAssets(balanceOf[user]);

// add/subtract the accumulated premia to the collateral amount
uint256 netBalance;
uint256 netBalance = collateralAmount;
if (premiumAllPositions > 0) {
unchecked {
netBalance = collateralAmount + uint256(uint128(premiumAllPositions));
netBalance += uint256(uint128(premiumAllPositions));
}
}

Expand Down

0 comments on commit 833ed84

Please sign in to comment.