IVariableDebtToken
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.16;
import {IAddressProvider} from "../interfaces/IAddressProvider.sol";
import {IPoolIncentivesController} from "./IPoolIncentivesController.sol";
import {IScaledBalanceToken} from "./IScaledBalanceToken.sol";
import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import {IERC20MetadataUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
interface IVariableDebtToken is IScaledBalanceToken, IERC20Upgradeable, IERC20MetadataUpgradeable {
/**
* @dev Emitted when a debt token is initialized
* @param underlyingCollateral The address of the underlying collateral
* @param underlyingAsset The address of the underlying asset
* @param pool The address of the associated lend pool
* @param incentivesController The address of the incentives controller
* @param debtTokenDecimals the decimals of the debt token
* @param debtTokenName the name of the debt token
* @param debtTokenSymbol the symbol of the debt token
**/
event Initialized(
address indexed underlyingCollateral,
address indexed underlyingAsset,
address indexed pool,
address incentivesController,
uint8 debtTokenDecimals,
string debtTokenName,
string debtTokenSymbol
);
/**
* @dev Emitted after the mint action
* @param from The address performing the mint
* @param value The amount to be minted
* @param index The last index of the reserve
**/
event Mint(address indexed from, uint256 value, uint256 index);
/**
* @dev Emitted when variable debt is burnt
* @param user The user which debt has been burned
* @param amount The amount of debt being burned
* @param index The index of the user
**/
event Burn(address indexed user, uint256 amount, uint256 index);
function initialize(
address addressProvider,
address underlyingCollateral,
address underlyingAsset,
uint256 underlyingMaxTokenId,
uint256 underlyingMinTokenId,
uint8 debtTokenDecimals,
string memory debtTokenName,
string memory debtTokenSymbol
) external;
function mint(
address user,
address onBehalfOf,
uint256 amount,
uint256 index
) external returns (bool);
function burn(
address user,
uint256 amount,
uint256 index
) external returns (bool);
function getPoolIncentivesController() external view returns (IPoolIncentivesController);
function scaledTotalSupply() external view returns (uint256);
}
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.16;
/**
* @title AddressProvider contract
* @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
* - Acting also as factory of proxies and admin of those, so with right to change its implementations
* - Owned by the FluidNFT Governance
* @author FluidNFT
**/
interface IAddressProvider {
event MarketIdSet(string newMarketId);
event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);
event ExecutionDelegateUpdated(address indexed newAddress);
event ExecutionManagerUpdated(address indexed newAddress);
event LendingUpdated(address indexed newAddress);
event PromissoryNoteUpdated(address indexed newAddress);
event PromissoryNoteBundleUpdated(address indexed newAddress);
event ObligationReceiptUpdated(address indexed newAddress);
event ObligationReceiptBundleUpdated(address indexed newAddress);
event LendingPoolUpdated(address indexed newAddress);
event ConfiguratorUpdated(address indexed newAddress);
event CollateralManagerUpdated(address indexed newAddress);
event PeerAdminUpdated(address indexed newAddress);
event PoolAdminUpdated(address indexed newAddress);
event EmergencyAdminUpdated(address indexed newAddress);
event PriceConsumerUpdated(address indexed newAddress);
event FluidTokenUpdated(address indexed newAddress);
event PoolIncentivesControllerUpdated(address indexed newAddress);
event PeerIncentivesControllerUpdated(address indexed newAddress);
event ReferralManagerUpdated(address indexed newAddress);
event TreasuryUpdated(address indexed newAddress);
event DelegationRegistryUpdated(address indexed newAddress);
event ProxyCreated(bytes32 id, address indexed newAddress);
event FTokenImplUpdated(address indexed newAddress);
event DebtTokenImplUpdated(address indexed newAddress);
event NFTPriceOracleUpdated(address indexed newAddress);
event LendingRateManagerUpdated(address indexed newAddress);
event WETHUpdated(address indexed newAddress);
event WETHGatewayUpdated(address indexed newAddress);
function getMarketId() external view returns (string memory);
function setMarketId(string calldata marketId) external;
function getAddress(bytes32 id) external view returns (address);
function setAddress(bytes32 id, address newAddress) external;
function setAddressAsProxy(
bytes32 id,
address impl
) external;
function getExecutionDelegate() external view returns (address);
function setExecutionDelegate(address executionDelegate) external;
function getExecutionManager() external view returns (address);
function setExecutionManager(address executionManager) external;
function getLending() external view returns (address);
function setLending(address lending) external;
function getPromissoryNote() external view returns (address);
function setPromissoryNote(address promissoryNote) external;
function getPromissoryNoteBundle() external view returns (address);
function setPromissoryNoteBundle(address promissoryNote) external;
function getObligationReceipt() external view returns (address);
function setObligationReceipt(address obligationReceipt) external;
function getObligationReceiptBundle() external view returns (address);
function setObligationReceiptBundle(address obligationReceipt) external;
function getLendingPool() external view returns (address);
function setLendingPool(address pool) external;
function getConfigurator() external view returns (address);
function setConfigurator(address configurator) external;
function setConfiguratorImpl(address configurator) external;
function getCollateralManager() external view returns (address);
function setCollateralManager(address collateralManager) external;
function getPeerAdmin() external view returns (address);
function setPeerAdmin(address admin) external;
function getPoolAdmin() external view returns (address);
function setPoolAdmin(address admin) external;
function getEmergencyAdmin() external view returns (address);
function setEmergencyAdmin(address admin) external;
function getNFTPriceOracle() external view returns (address);
function setNFTPriceOracle(address nftPriceOracle) external;
function getLendingRateManager() external view returns (address);
function setLendingRateManager(address lendingRateManager) external;
function getPriceConsumerV3() external view returns (address);
function setPriceConsumerV3(address priceConsumerV3) external;
function getFluidToken() external view returns (address);
function setFluidToken(address fluidToken) external;
function getPoolIncentivesController() external view returns (address);
function setPoolIncentivesController(address controller) external;
function getPeerIncentivesController() external view returns (address);
function setPeerIncentivesController(address controller) external;
function getReferralManager() external view returns (address);
function setReferralManager(address referralManager) external;
function getTreasury() external view returns (address);
function setTreasury(address treasury) external;
function getDelegationRegistry() external view returns (address);
function setDelegationRegistry(address delegationRegistry) external;
function getFTokenImpl() external view returns (address);
function setFTokenImpl(address fTokenImpl) external;
function getDebtTokenImpl() external view returns (address);
function setDebtTokenImpl(address debtTokenImpl) external;
function getWETH() external view returns (address);
function setWETH(address weth) external;
function getWETHGateway() external view returns (address);
function setWETHGateway(address weth) external;
}
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.16;
pragma abicoder v2;
import { IScaledBalanceToken } from "./IScaledBalanceToken.sol";
interface IPoolIncentivesController {
event RewardsAccrued(address indexed _user, uint256 _amount);
event RewardsClaimed(address indexed _user, uint256 _amount);
/**
* @dev Configure assets for a certain rewards emission
* @param _assets The assets to incentivize
* @param _emissionsPerSecond The emission for each asset
*/
function configureAssets(
IScaledBalanceToken[] calldata _assets,
uint256[] calldata _emissionsPerSecond
) external;
/**
* @dev Called by the corresponding asset on any update that affects the rewards distribution
* @param _user The address of the user
* @param _totalSupply The total supply of the asset in the lending pool
* @param _userBalance The balance of the user of the asset in the lending pool
**/
function handleAction(
address _user,
uint256 _totalSupply,
uint256 _userBalance
) external;
/**
* @dev Returns the total of rewards of an user, already accrued + not yet accrued
* @param _assets The assets to incentivize
* @param _user The address of the user
* @return The rewards
**/
function getRewardsBalance(
IScaledBalanceToken[] calldata _assets,
address _user
) external view returns (uint256);
/**
* @dev Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards
* @param _assets The assets to incentivize
* @param _amount Amount of rewards to claim
* @return Rewards claimed
**/
function claimRewards(
IScaledBalanceToken[] calldata _assets,
uint256 _amount
) external returns (uint256);
/**
* @dev returns the unclaimed rewards of the user
* @param _user the address of the user
* @return the unclaimed user rewards
*/
function getUserUnclaimedRewards(address _user)
external
view
returns (uint256);
}
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.16;
interface IScaledBalanceToken {
/**
* @dev Returns the scaled balance of the user. The scaled balance is the sum of all the
* updated stored balance divided by the reserve's liquidity index at the moment of the update
* @param user The user whose balance is calculated
* @return The scaled balance of the user
**/
function scaledBalanceOf(address user) external view returns (uint256);
/**
* @dev Returns the scaled balance of the user and the scaled total supply.
* @param user The address of the user
* @return The scaled balance of the user
* @return The scaled balance and the scaled total supply
**/
function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256);
/**
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
* @return The scaled total supply
**/
function scaledTotalSupply() external view returns (uint256);
}
Last updated