Skip to content

Commit 98fbb98

Browse files
razwwclaude
andcommitted
docs: add V2 audit reports and disclose router FoT behavior in comments
Bailsec differential (zero findings), HashDit (1 Low ack'd), CertiK preliminary (8 pending). Router comments address CertiK LDV-06/07/08 disclosure recommendations; pair bytecode and init code hash unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1652013 commit 98fbb98

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

226 KB
Binary file not shown.
2.39 MB
Binary file not shown.
363 KB
Binary file not shown.

contracts/periphery/ListaV2Router02.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ contract ListaV2Router02 is IListaV2Router02 {
3131
}
3232

3333
// **** ADD LIQUIDITY ****
34+
// amounts are quoted from pre-transfer reserves: adding a fee-on-transfer token to a
35+
// non-empty pool over-contributes the paired token by the tax; the excess accrues to
36+
// existing LPs. use a FoT-aware flow off-chain if that loss is unacceptable.
3437
function _addLiquidity(
3538
address tokenA,
3639
address tokenB,
@@ -187,6 +190,8 @@ contract ListaV2Router02 is IListaV2Router02 {
187190
address(this),
188191
deadline
189192
);
193+
// sweeps the router's entire token balance: the post-tax amount received is unknowable
194+
// in advance, and the router is never meant to hold tokens between transactions
190195
TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this)));
191196
IWETH(WETH).withdraw(amountETH);
192197
TransferHelper.safeTransferETH(to, amountETH);
@@ -394,6 +399,7 @@ contract ListaV2Router02 is IListaV2Router02 {
394399
path[0], msg.sender, ListaV2Library.pairFor(factory, path[0], path[1]), amountIn
395400
);
396401
_swapSupportingFeeOnTransferTokens(path, address(this));
402+
// pays out the router's entire WETH balance (router holds no funds between transactions)
397403
uint amountOut = IERC20(WETH).balanceOf(address(this));
398404
require(amountOut >= amountOutMin, 'ListaV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
399405
IWETH(WETH).withdraw(amountOut);

0 commit comments

Comments
 (0)