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
-
Add to FlashLoanConfig in crates/charon-core/src/config.rs:
pub data_provider: Address,
-
Add to config/default.toml under [flashloan.aave_v3_bsc]:
data_provider = "0x41393e5e337606dc3821075Af65AeE84D7688CBD"
-
Pass data_provider into AaveFlashLoan::connect() from the caller that reads Config. Remove the hardcoded constant.
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
Add to FlashLoanConfig in crates/charon-core/src/config.rs:
pub data_provider: Address,
Add to config/default.toml under [flashloan.aave_v3_bsc]:
data_provider = "0x41393e5e337606dc3821075Af65AeE84D7688CBD"
Pass data_provider into AaveFlashLoan::connect() from the caller that reads Config. Remove the hardcoded constant.