Skip to content

[flashloan] AaveFlashLoan PoolDataProvider address hardcoded — should be in config/default.toml #143

@obchain

Description

@obchain

Refs #39

File: crates/charon-flashloan/src/aave.rs — hardcoded PoolDataProvider constant

Problem

All protocol addresses in this project live in config/default.toml and are loaded at runtime via Config. This ensures addresses can be updated without a recompile, and the config file serves as the single source of truth for all on-chain addresses. The BSC Aave V3 PoolDataProvider (0x41393e5e337606dc3821075Af65AeE84D7688CBD) is hardcoded as a constant inside the adapter, breaking this invariant.

config/default.toml already has [flashloan.aave_v3_bsc] with a pool field. A data_provider field belongs alongside it.

Fix

  1. Add to FlashLoanConfig in crates/charon-core/src/config.rs:
    pub data_provider: Address,

  2. Add to config/default.toml under [flashloan.aave_v3_bsc]:
    data_provider = "0x41393e5e337606dc3821075Af65AeE84D7688CBD"

  3. Pass data_provider into AaveFlashLoan::connect() from the caller that reads Config. Remove the hardcoded constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polishtype:choreMaintenance, config, tooling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions