Skip to content

Commit

Permalink
fix: Update setPoolSwapTokenAccumulation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefSnoopy committed Nov 28, 2024
1 parent cb8c575 commit 54b2237
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libraries/MixedQuoterRecorder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ library MixedQuoterRecorder {
{
uint256 token0Slot = uint256(keccak256(abi.encode(poolHash, SWAP_TOKEN0_ACCUMULATION)));
uint256 token1Slot = uint256(keccak256(abi.encode(poolHash, SWAP_TOKEN1_ACCUMULATION)));
(uint256 currentAmount0, uint256 currentAmount1) = getPoolSwapTokenAccumulation(poolHash);
uint256 amount0;
uint256 amount1;
if (isZeroForOne) {
amount0 = currentAmount0 + amountIn;
amount1 = currentAmount1 + amountOut;
amount0 = amountIn;
amount1 = amountOut;
} else {
amount0 = currentAmount0 + amountOut;
amount1 = currentAmount1 + amountIn;
amount0 = amountOut;
amount1 = amountIn;
}
assembly ("memory-safe") {
tstore(token0Slot, amount0)
Expand Down

0 comments on commit 54b2237

Please sign in to comment.