diff --git a/onchain/script/backtesting/EventReplayer.sol b/onchain/script/backtesting/EventReplayer.sol index 016770b..3826a66 100644 --- a/onchain/script/backtesting/EventReplayer.sol +++ b/onchain/script/backtesting/EventReplayer.sol @@ -386,6 +386,11 @@ contract EventReplayer is IUniswapV3MintCallback, IUniswapV3SwapCallback { require(msg.sender == address(pool), "EventReplayer: bad swap callback"); bool zeroForOne = abi.decode(data, (bool)); // Pay the positive delta (the input token the pool is owed). + // No inline mint is needed here: _replaySwap pre-funds address(this) with + // `uint256(amountSpecified) + 1` tokens before calling pool.swap(), so + // address(this) already holds sufficient balance. This differs from + // uniswapV3MintCallback, which mints inline because the required amounts + // are only known when the pool calls back. if (zeroForOne && amount0Delta > 0) { token0.transfer(msg.sender, uint256(amount0Delta)); } else if (!zeroForOne && amount1Delta > 0) {