Refs #42
PR: feat(cli): wire scanner → router → builder → simulator pipeline (feat/17-cli-e2e-pipeline)
Commit: latest on feat/17-cli-e2e-pipeline
File: crates/charon-executor/src/builder.rs, crates/charon-flashloan/ (build_flashloan_calldata)
PRD / invariant violated: Flash-loan atomicity requires the params slot of flashLoanSimple to carry borrower/vtokens/repay amount so executeOperation can decode them.
Problem:
PR #39 finding 3 (filed, open) identified that build_flashloan_calldata encodes params as empty bytes. CharonLiquidator.executeOperation ABI-decodes params to extract borrower address, vToken addresses, and repay amount. With empty params, ABI decode reverts or decoded values are zero/default, causing liquidateBorrow to be called with address(0) borrower and 0 repay amount.
PR #42 runs the full pipeline through the flash-loan router and builder, then pushes the resulting LiquidationOpportunity (with its calldata) to OpportunityQueue. Every entry in the queue has structurally invalid calldata. The queue gives no indication of this — entries are stored and ranked as if valid.
When PR #44 (broadcast) consumes these entries, every flash-loan submission will revert at the executeOperation decode step, burning gas.
Impact: Every liquidation submitted by the bot will revert on-chain. Gas is lost on each attempt. This is a complete functional failure of the liquidation path.
Fix: Resolve PR #39 finding 3 before merging PR #42: build_flashloan_calldata must accept liquidation_params: &[u8] and forward it into the params argument of flashLoanSimple. Do not merge the pipeline PR while the calldata encoding is broken.
Refs #42
PR: feat(cli): wire scanner → router → builder → simulator pipeline (feat/17-cli-e2e-pipeline)
Commit: latest on feat/17-cli-e2e-pipeline
File: crates/charon-executor/src/builder.rs, crates/charon-flashloan/ (build_flashloan_calldata)
PRD / invariant violated: Flash-loan atomicity requires the params slot of flashLoanSimple to carry borrower/vtokens/repay amount so executeOperation can decode them.
Problem:
PR #39 finding 3 (filed, open) identified that build_flashloan_calldata encodes params as empty bytes. CharonLiquidator.executeOperation ABI-decodes params to extract borrower address, vToken addresses, and repay amount. With empty params, ABI decode reverts or decoded values are zero/default, causing liquidateBorrow to be called with address(0) borrower and 0 repay amount.
PR #42 runs the full pipeline through the flash-loan router and builder, then pushes the resulting LiquidationOpportunity (with its calldata) to OpportunityQueue. Every entry in the queue has structurally invalid calldata. The queue gives no indication of this — entries are stored and ranked as if valid.
When PR #44 (broadcast) consumes these entries, every flash-loan submission will revert at the executeOperation decode step, burning gas.
Impact: Every liquidation submitted by the bot will revert on-chain. Gas is lost on each attempt. This is a complete functional failure of the liquidation path.
Fix: Resolve PR #39 finding 3 before merging PR #42: build_flashloan_calldata must accept liquidation_params: &[u8] and forward it into the params argument of flashLoanSimple. Do not merge the pipeline PR while the calldata encoding is broken.