// SPDX-License-Identifier: MIT // OpenZeppelin Tron Contracts (last updated v5.5.0) (interfaces/ITRC3156FlashLender.sol) pragma solidity >=0.5.0; import {ITRC3156FlashBorrower} from "./ITRC3156FlashBorrower.sol"; /** * @dev Interface of the TRC-3156 FlashLender, as defined in * https://github.com/tronprotocol/tips/blob/master/tip-3156.md[TIP-3156] (the TRON-side analogue * of https://eips.ethereum.org/EIPS/eip-3156[EIP-3156]). */ interface ITRC3156FlashLender { /** * @dev The amount of currency available to be lent. * @param token The loan currency. * @return The amount of `token` that can be borrowed. */ function maxFlashLoan(address token) external view returns (uint256); /** * @dev The fee to be charged for a given loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @return The amount of `token` to be charged for the loan, on top of the returned principal. */ function flashFee(address token, uint256 amount) external view returns (uint256); /** * @dev Initiate a flash loan. * @param receiver The receiver of the tokens in the loan, and the receiver of the callback. * @param token The loan currency. * @param amount The amount of tokens lent. * @param data Arbitrary data structure, intended to contain user-defined parameters. */ function flashLoan( ITRC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data ) external returns (bool); }