Skip to content

[contracts] Foundry workspace + CharonLiquidator.sol skeleton #12

@obchain

Description

@obchain

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

  • forge build in contracts/ succeeds
  • Directory layout follows Foundry conventions (src/, test/, script/, lib/)
  • CharonLiquidator inherits IFlashLoanSimpleReceiver from Aave V3
  • Contract compiles but reverts in callbacks (until issue for full wiring lands)
  • Remappings resolved (@openzeppelin/, @aave-v3/, etc.)

References

  • PRD section 5b (Solidity Liquidator Contract)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions