Skip to content

Commit

Permalink
Remove unused load fromBucket storage
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Mar 13, 2023
1 parent 94b2774 commit 519769c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/RewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ contract RewardsManager is IRewardsManager, ReentrancyGuard {
fromIndex = fromBuckets_[i];
toIndex = toBuckets_[i];

BucketState storage fromBucket = stakeInfo.snapshot[fromIndex];
BucketState storage toBucket = stakeInfo.snapshot[toIndex];

// call out to position manager to move liquidity between buckets
IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(
tokenId_,
Expand All @@ -169,8 +166,9 @@ contract RewardsManager is IRewardsManager, ReentrancyGuard {
);
positionManager.moveLiquidity(moveLiquidityParams);

// update bucket state
toBucket.lpsAtStakeTime = uint128(positionManager.getLPs(tokenId_, toIndex));
// update to bucket state
BucketState storage toBucket = stakeInfo.snapshot[toIndex];
toBucket.lpsAtStakeTime = uint128(positionManager.getLPs(tokenId_, toIndex));
toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));
delete stakeInfo.snapshot[fromIndex];

Expand Down

0 comments on commit 519769c

Please sign in to comment.