// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.16;

// import {IAddressProvider} from "./IAddressProvider.sol";
import { IPoolIncentivesController } from "./IPoolIncentivesController.sol";
import { IScaledBalanceToken } from "./IScaledBalanceToken.sol"; 
import { IAddressProvider } from "./IAddressProvider.sol";

import { ConfigTypes } from "../protocol/libraries/types/ConfigTypes.sol";

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { IERC20MetadataUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";

interface IFToken is IScaledBalanceToken, IERC20Upgradeable, IERC20MetadataUpgradeable {
    * @dev Emitted when an fToken is initialized
    * @param underlyingCollateral The address of the underlying collateral
    * @param underlyingAsset The address of the underlying asset
    * @param lendingPool The address of the associated lending pool
    * @param incentivesController The address of the incentives controller for this fToken
    * @param treasury The address of the treasury
    * @param creatorPercentage The address of the creator
    * @param creator The address of the creator
    * @param creator The address of the creator
    event Initialized(
        address indexed underlyingCollateral,
        address indexed underlyingAsset,
        address indexed lendingPool,
        address incentivesController,
        address treasury,
        address creator,
        uint256 creatorPercentage,
        uint256 auctionCallerPercentage,
        uint256 auctionCreatorPercentage

    * @dev Emitted after the mint action
    * @param from The address performing the mint
    * @param value The amount being
    * @param index The new liquidity index of the reserve
    event Mint(address indexed from, uint256 value, uint256 index);

    * @dev Emitted after fTokens are burned
    * @param from The owner of the fTokens, getting them burned
    * @param target The address that will receive the underlying
    * @param value The amount being burned
    * @param index The new liquidity index of the reserve
    event Burn(address indexed from, address indexed target, uint256 value, uint256 index);

    * @dev Emitted during the transfer action
    * @param from The user whose tokens are being transferred
    * @param to The recipient
    * @param value The amount being transferred
    * @param index The new liquidity index of the reserve
    event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index);

    * @dev Emitted when creator address is updated
    * @param creatorAddress is the new address
    event CreatorAddressUpdated(uint256 creatorAddress);

    * @dev Emitted when creator percentage is updated
    * @param creatorPercentage is the new percentage
    event CreatorPecentageUpdated(uint256 creatorPercentage);

    function initialize(
        IAddressProvider addressProvider,
        ConfigTypes.InitReserveInput calldata input
    ) external;

    function mint(
        address user,
        uint256 amount,
        uint256 index
    ) external returns (bool);

    function burn(
        address user,
        address receiverOfUnderlying,
        uint256 amount,
        uint256 index
    ) external;

    function mintVariableDebtRepaymentToStakeholders(uint256 amount, uint256 index) external;

    function mintStableDebtRepaymentToStakeholders(address user, uint256 amount, uint256 index) external;

    function mintAuctionPaymentToStakeholders(
        address user, 
        address caller, 
        address owner,
        uint256 amount, 
        uint256 liquidationFee,
        uint256 index
    ) external;

    // /**
    //  * @dev Invoked to execute actions on the fToken side after a repayment.
    //  * @param user The user executing the repayment
    //  * @param amount The amount getting repaid
    //  **/
    // function handleRepayment(address user, uint256 amount) external;

    // function handleAuctionPayment(address user, address caller, address owner, uint256 amount, uint256 fee) external;

    function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);

    function getReserveNormalizationFactor() external view returns (uint256);

    function getPoolIncentivesController() external view returns (IPoolIncentivesController);

    function exchangeRate() external view returns (uint256);

    function setReserveCreatorAddress(address creator) external;

    function getReserveCreatorAddress() external view returns (address);

    function setReserveCreatorPercentage(uint256 percentage) external;

    function getReserveCreatorPercentage() external view returns (uint256);

    function setAuctionCallerPercentage(uint256 percentage) external;

    function getAuctionCallerPercentage() external view returns (uint256);

    function setAuctionCreatorPercentage(uint256 percentage) external;

    function getAuctionCreatorPercentage() external view returns (uint256);

    function RESERVE_TREASURY_ADDRESS() external view returns (address);

    function UNDERLYING_COLLATERAL_ADDRESS() external view returns (address);

    function UNDERLYING_ASSET_ADDRESS() external view returns (address);

    function UNDERLYING_MAX_TOKEN_ID() external view returns (uint256);

    function UNDERLYING_MIN_TOKEN_ID() external view returns (uint256);

Last updated