You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File: contracts/test/CharonLiquidatorFork.t.sol (new file — absence of coverage) Contract: contracts/src/CharonLiquidator.sol, batchExecute()
Problem:
PR #45 added batchExecute to CharonLiquidator. The fork test suite introduced in PR #53 only exercises executeLiquidation. batchExecute runs N flash loan callbacks in sequence, holds the reentrancy guard across all iterations, and calls executeOperation once per item. This is the highest-risk code path in the contract:
Reentrancy guard held across the entire batch means any callback reentrancy behaves differently than in single-liquidation mode.
The 10-item ceiling (MAX_BATCH_SIZE) and its interaction with Aave V3's flashLoanSimple queue is unvalidated.
The unit tests in CharonLiquidator.t.sol cover ownership guard, empty array, and over-limit, but these do not use a real Aave pool. Fork coverage is the only way to validate that batchExecute actually completes multiple flashLoanSimple calls in sequence on the real Aave V3 BSC pool.
PRD clause: CLAUDE.md: 'Every liquidation transaction passes an eth_call simulation gate before broadcast.' The simulation gate validates the full tx including batches; if batches are never fork-tested, simulation gate validity is unknown.
Impact:
batchExecute is the primary production code path for multi-opportunity windows. It has been shipped in PR #45 without any fork-level validation that N sequential flash loans actually complete on BSC Aave V3.
Fix:
Add test_fork_batchExecute_twoMarkets() that calls batchExecute with a 2-item LiquidationParams array, mocking Venus and PCS per item, and asserts:
Both LiquidationExecuted events are emitted.
The reentrancy guard does not block the second callback.
Refs #53
File: contracts/test/CharonLiquidatorFork.t.sol (new file — absence of coverage)
Contract: contracts/src/CharonLiquidator.sol, batchExecute()
Problem:
PR #45 added batchExecute to CharonLiquidator. The fork test suite introduced in PR #53 only exercises executeLiquidation. batchExecute runs N flash loan callbacks in sequence, holds the reentrancy guard across all iterations, and calls executeOperation once per item. This is the highest-risk code path in the contract:
The unit tests in CharonLiquidator.t.sol cover ownership guard, empty array, and over-limit, but these do not use a real Aave pool. Fork coverage is the only way to validate that batchExecute actually completes multiple flashLoanSimple calls in sequence on the real Aave V3 BSC pool.
PRD clause: CLAUDE.md: 'Every liquidation transaction passes an eth_call simulation gate before broadcast.' The simulation gate validates the full tx including batches; if batches are never fork-tested, simulation gate validity is unknown.
Impact:
batchExecute is the primary production code path for multi-opportunity windows. It has been shipped in PR #45 without any fork-level validation that N sequential flash loans actually complete on BSC Aave V3.
Fix:
Add test_fork_batchExecute_twoMarkets() that calls batchExecute with a 2-item LiquidationParams array, mocking Venus and PCS per item, and asserts: