-
Notifications
You must be signed in to change notification settings - Fork 33
Issue 183: security: Create a Whitelist registry specifically for Flash Loan borrowers #110
Copy link
Copy link
Open
Labels
Description
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
- Add an
approved_flash_borrowers: Map<Address, bool>to the contract's instance storage. - Create an Admin-only
set_flash_borrower_status(borrower_address, is_approved)function. - At the top of the
flash_loanexecution flow, check if the caller's address is mapped totrue. - If the caller is not on the whitelist, panic immediately with
Error::UnauthorizedBorrower.
Reactions are currently unavailable