Description
While flash loans are powerful, allowing completely unknown, anonymous smart contracts to borrow millions of dollars of our liquidity introduces massive surface area for zero-day exploits.
Until TradeFlow is battle-tested, we should restrict flash loan borrowing strictly to verified arbitrage bots and trusted partner protocols.
We need to add a whitelist mapping that the Admin can update, ensuring only approved contract IDs can successfully call the flash_loan function.
This significantly reduces our risk profile for the Wave 3 Mainnet Beta.
Requirements
Description
While flash loans are powerful, allowing completely unknown, anonymous smart contracts to borrow millions of dollars of our liquidity introduces massive surface area for zero-day exploits.
Until TradeFlow is battle-tested, we should restrict flash loan borrowing strictly to verified arbitrage bots and trusted partner protocols.
We need to add a whitelist mapping that the Admin can update, ensuring only approved contract IDs can successfully call the
flash_loanfunction.This significantly reduces our risk profile for the Wave 3 Mainnet Beta.
Requirements
approved_flash_borrowers: Map<Address, bool>to the contract's instance storage.set_flash_borrower_status(borrower_address, is_approved)function.flash_loanexecution flow, check if the caller's address is mapped totrue.Error::UnauthorizedBorrower.