Context
The on-chain executor. Solidity lives in a dedicated Foundry workspace (contracts/) separate from the Cargo workspace. CharonLiquidator.sol is the single-contract entry point that flash-borrows, liquidates, swaps collateral back, repays, and forwards profit.
Scope
- Create
contracts/ directory with foundry.toml + lib/ for OpenZeppelin, Solmate, Aave-v3, Venus interfaces
contracts/src/CharonLiquidator.sol skeleton with:
onlyOwner gate
executeLiquidation(params, flashSource) entry point
- Empty
receiveFlashLoan / executeOperation callbacks
contracts/src/interfaces/ with Aave V3 Pool, Venus Comptroller, Venus VToken, Uniswap/PancakeSwap V3 Router interfaces
foundry.toml configured for Solidity 0.8.24+, remappings, optimizer on (200 runs)
Acceptance criteria
References
- PRD section 5b (Solidity Liquidator Contract)
Context
The on-chain executor. Solidity lives in a dedicated Foundry workspace (
contracts/) separate from the Cargo workspace.CharonLiquidator.solis the single-contract entry point that flash-borrows, liquidates, swaps collateral back, repays, and forwards profit.Scope
contracts/directory withfoundry.toml+lib/for OpenZeppelin, Solmate, Aave-v3, Venus interfacescontracts/src/CharonLiquidator.solskeleton with:onlyOwnergateexecuteLiquidation(params, flashSource)entry pointreceiveFlashLoan/executeOperationcallbackscontracts/src/interfaces/with Aave V3 Pool, Venus Comptroller, Venus VToken, Uniswap/PancakeSwap V3 Router interfacesfoundry.tomlconfigured for Solidity 0.8.24+, remappings, optimizer on (200 runs)Acceptance criteria
forge buildincontracts/succeedssrc/,test/,script/,lib/)CharonLiquidatorinheritsIFlashLoanSimpleReceiverfrom Aave V3@openzeppelin/,@aave-v3/, etc.)References