PR: #37 feat(contracts): full Aave + Venus + PancakeSwap liquidation flow
Commit: 54fe2bb
File: contracts/ (test/ directory absent entirely)
Problem: PR #37 introduces complete on-chain liquidation path — flash-loan callback, Venus liquidateBorrow, vToken redeem, PancakeSwap swap, profit sweep — but ships zero Forge tests. PRD acceptance requires fork-test coverage of full flow before contract reviewable for production. Three p0 bugs (evm_version, pragma, cold wallet) and two p1 bugs (vBNB path, fee tier) in this PR would have been caught by one fork test replaying a real BSC liquidation.
Impact: No regression barrier. Future PRs can silently break liquidation callback, change profit accounting, or introduce new collateral paths without any test failure. Reviewers / auditors must manually trace logic without runnable reference.
Fix: Add contracts/test/CharonLiquidator.t.sol with Forge fork tests targeting BSC mainnet (rpc_endpoints.bnb already wired in foundry.toml). Minimum coverage:
- Happy path: BNB flash-loan, USDT debt liquidation, USDT collateral swap.
- vBNB collateral path: verify WBNB wrap and correct colBal after fix.
- Wrong fee tier: assert revert when fee=3000 passed for BTCB pair.
- Profit routing: assert COLD_WALLET (not owner) receives profit after fix.
- Access control: executeOperation reverts when called by non-Aave address.
PR: #37 feat(contracts): full Aave + Venus + PancakeSwap liquidation flow
Commit: 54fe2bb
File: contracts/ (test/ directory absent entirely)
Problem: PR #37 introduces complete on-chain liquidation path — flash-loan callback, Venus liquidateBorrow, vToken redeem, PancakeSwap swap, profit sweep — but ships zero Forge tests. PRD acceptance requires fork-test coverage of full flow before contract reviewable for production. Three p0 bugs (evm_version, pragma, cold wallet) and two p1 bugs (vBNB path, fee tier) in this PR would have been caught by one fork test replaying a real BSC liquidation.
Impact: No regression barrier. Future PRs can silently break liquidation callback, change profit accounting, or introduce new collateral paths without any test failure. Reviewers / auditors must manually trace logic without runnable reference.
Fix: Add
contracts/test/CharonLiquidator.t.solwith Forge fork tests targeting BSC mainnet (rpc_endpoints.bnb already wired in foundry.toml). Minimum coverage: