creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/periphery/rewards/EmissionManager.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport {Ownable} from '../../core/dependencies/openzeppelin/contracts/Ownable.sol';\nimport {IEACAggregatorProxy} from '../misc/interfaces/IEACAggregatorProxy.sol';\nimport {IEmissionManager} from './interfaces/IEmissionManager.sol';\nimport {ITransferStrategyBase} from './interfaces/ITransferStrategyBase.sol';\nimport {IRewardsController} from './interfaces/IRewardsController.sol';\nimport {RewardsDataTypes} from './libraries/RewardsDataTypes.sol';\n\n/**\n * @title EmissionManager\n * @author Aave\n * @notice It manages the list of admins of reward emissions and provides functions to control reward emissions.\n */\ncontract EmissionManager is Ownable, IEmissionManager {\n  // reward => emissionAdmin\n  mapping(address => address) internal _emissionAdmins;\n\n  IRewardsController internal _rewardsController;\n\n  /**\n   * @dev Only emission admin of the given reward can call functions marked by this modifier.\n   **/\n  modifier onlyEmissionAdmin(address reward) {\n    require(msg.sender == _emissionAdmins[reward], 'ONLY_EMISSION_ADMIN');\n    _;\n  }\n\n  /**\n   * Constructor.\n   * @param owner The address of the owner\n   */\n  constructor(address owner) {\n    transferOwnership(owner);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external override {\n    for (uint256 i = 0; i < config.length; i++) {\n      require(_emissionAdmins[config[i].reward] == msg.sender, 'ONLY_EMISSION_ADMIN');\n    }\n    _rewardsController.configureAssets(config);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy)\n    external\n    override\n    onlyEmissionAdmin(reward)\n  {\n    _rewardsController.setTransferStrategy(reward, transferStrategy);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle)\n    external\n    override\n    onlyEmissionAdmin(reward)\n  {\n    _rewardsController.setRewardOracle(reward, rewardOracle);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setDistributionEnd(\n    address asset,\n    address reward,\n    uint32 newDistributionEnd\n  ) external override onlyEmissionAdmin(reward) {\n    _rewardsController.setDistributionEnd(asset, reward, newDistributionEnd);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setEmissionPerSecond(\n    address asset,\n    address[] calldata rewards,\n    uint88[] calldata newEmissionsPerSecond\n  ) external override {\n    for (uint256 i = 0; i < rewards.length; i++) {\n      require(_emissionAdmins[rewards[i]] == msg.sender, 'ONLY_EMISSION_ADMIN');\n    }\n    _rewardsController.setEmissionPerSecond(asset, rewards, newEmissionsPerSecond);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setClaimer(address user, address claimer) external override onlyOwner {\n    _rewardsController.setClaimer(user, claimer);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setEmissionAdmin(address reward, address admin) external override onlyOwner {\n    address oldAdmin = _emissionAdmins[reward];\n    _emissionAdmins[reward] = admin;\n    emit EmissionAdminUpdated(reward, oldAdmin, admin);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function setRewardsController(address controller) external override onlyOwner {\n    _rewardsController = IRewardsController(controller);\n  }\n\n  /// @inheritdoc IEmissionManager\n  function getRewardsController() external view override returns (IRewardsController) {\n    return _rewardsController;\n  }\n\n  /// @inheritdoc IEmissionManager\n  function getEmissionAdmin(address reward) external view override returns (address) {\n    return _emissionAdmins[reward];\n  }\n}\n"
      },
      "src/core/dependencies/openzeppelin/contracts/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.10;\n\nimport './Context.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable is Context {\n  address private _owner;\n\n  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n  /**\n   * @dev Initializes the contract setting the deployer as the initial owner.\n   */\n  constructor() {\n    address msgSender = _msgSender();\n    _owner = msgSender;\n    emit OwnershipTransferred(address(0), msgSender);\n  }\n\n  /**\n   * @dev Returns the address of the current owner.\n   */\n  function owner() public view returns (address) {\n    return _owner;\n  }\n\n  /**\n   * @dev Throws if called by any account other than the owner.\n   */\n  modifier onlyOwner() {\n    require(_owner == _msgSender(), 'Ownable: caller is not the owner');\n    _;\n  }\n\n  /**\n   * @dev Leaves the contract without owner. It will not be possible to call\n   * `onlyOwner` functions anymore. Can only be called by the current owner.\n   *\n   * NOTE: Renouncing ownership will leave the contract without an owner,\n   * thereby removing any functionality that is only available to the owner.\n   */\n  function renounceOwnership() public virtual onlyOwner {\n    emit OwnershipTransferred(_owner, address(0));\n    _owner = address(0);\n  }\n\n  /**\n   * @dev Transfers ownership of the contract to a new account (`newOwner`).\n   * Can only be called by the current owner.\n   */\n  function transferOwnership(address newOwner) public virtual onlyOwner {\n    require(newOwner != address(0), 'Ownable: new owner is the zero address');\n    emit OwnershipTransferred(_owner, newOwner);\n    _owner = newOwner;\n  }\n}\n"
      },
      "src/periphery/misc/interfaces/IEACAggregatorProxy.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\ninterface IEACAggregatorProxy {\n  function decimals() external view returns (uint8);\n\n  function latestAnswer() external view returns (int256);\n\n  function latestTimestamp() external view returns (uint256);\n\n  function latestRound() external view returns (uint256);\n\n  function getAnswer(uint256 roundId) external view returns (int256);\n\n  function getTimestamp(uint256 roundId) external view returns (uint256);\n\n  function aggregator() external view returns (address);\n\n  function getSubTokens() external view returns(address[] memory);\n\n  function getTokenType() external view returns(uint256);\n\n  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);\n  event NewRound(uint256 indexed roundId, address indexed startedBy);\n}\n"
      },
      "src/periphery/rewards/interfaces/IEmissionManager.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol';\nimport {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol';\nimport {ITransferStrategyBase} from './ITransferStrategyBase.sol';\nimport {IRewardsController} from './IRewardsController.sol';\n\n/**\n * @title IEmissionManager\n * @author Aave\n * @notice Defines the basic interface for the Emission Manager\n */\ninterface IEmissionManager {\n  /**\n   * @dev Emitted when the admin of a reward emission is updated.\n   * @param reward The address of the rewarding token\n   * @param oldAdmin The address of the old emission admin\n   * @param newAdmin The address of the new emission admin\n   */\n  event EmissionAdminUpdated(\n    address indexed reward,\n    address indexed oldAdmin,\n    address indexed newAdmin\n  );\n\n  /**\n   * @dev Configure assets to incentivize with an emission of rewards per second until the end of distribution.\n   * @dev Only callable by the emission admin of the given rewards\n   * @param config The assets configuration input, the list of structs contains the following fields:\n   *   uint104 emissionPerSecond: The emission per second following rewards unit decimals.\n   *   uint256 totalSupply: The total supply of the asset to incentivize\n   *   uint40 distributionEnd: The end of the distribution of the incentives for an asset\n   *   address asset: The asset address to incentivize\n   *   address reward: The reward token address\n   *   ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic.\n   *   IEACAggregatorProxy rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend.\n   *                                     Must follow Chainlink Aggregator IEACAggregatorProxy interface to be compatible.\n   */\n  function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external;\n\n  /**\n   * @dev Sets a TransferStrategy logic contract that determines the logic of the rewards transfer\n   * @dev Only callable by the emission admin of the given reward\n   * @param reward The address of the reward token\n   * @param transferStrategy The address of the TransferStrategy logic contract\n   */\n  function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external;\n\n  /**\n   * @dev Sets an Aave Oracle contract to enforce rewards with a source of value.\n   * @dev Only callable by the emission admin of the given reward\n   * @notice At the moment of reward configuration, the Incentives Controller performs\n   * a check to see if the reward asset oracle is compatible with IEACAggregator proxy.\n   * This check is enforced for integrators to be able to show incentives at\n   * the current Aave UI without the need to setup an external price registry\n   * @param reward The address of the reward to set the price aggregator\n   * @param rewardOracle The address of price aggregator that follows IEACAggregatorProxy interface\n   */\n  function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external;\n\n  /**\n   * @dev Sets the end date for the distribution\n   * @dev Only callable by the emission admin of the given reward\n   * @param asset The asset to incentivize\n   * @param reward The reward token that incentives the asset\n   * @param newDistributionEnd The end date of the incentivization, in unix time format\n   **/\n  function setDistributionEnd(\n    address asset,\n    address reward,\n    uint32 newDistributionEnd\n  ) external;\n\n  /**\n   * @dev Sets the emission per second of a set of reward distributions\n   * @param asset The asset is being incentivized\n   * @param rewards List of reward addresses are being distributed\n   * @param newEmissionsPerSecond List of new reward emissions per second\n   */\n  function setEmissionPerSecond(\n    address asset,\n    address[] calldata rewards,\n    uint88[] calldata newEmissionsPerSecond\n  ) external;\n\n  /**\n   * @dev Whitelists an address to claim the rewards on behalf of another address\n   * @dev Only callable by the owner of the EmissionManager\n   * @param user The address of the user\n   * @param claimer The address of the claimer\n   */\n  function setClaimer(address user, address claimer) external;\n\n  /**\n   * @dev Updates the admin of the reward emission\n   * @dev Only callable by the owner of the EmissionManager\n   * @param reward The address of the reward token\n   * @param admin The address of the new admin of the emission\n   */\n  function setEmissionAdmin(address reward, address admin) external;\n\n  /**\n   * @dev Updates the address of the rewards controller\n   * @dev Only callable by the owner of the EmissionManager\n   * @param controller the address of the RewardsController contract\n   */\n  function setRewardsController(address controller) external;\n\n  /**\n   * @dev Returns the rewards controller address\n   * @return The address of the RewardsController contract\n   */\n  function getRewardsController() external view returns (IRewardsController);\n\n  /**\n   * @dev Returns the admin of the given reward emission\n   * @param reward The address of the reward token\n   * @return The address of the emission admin\n   */\n  function getEmissionAdmin(address reward) external view returns (address);\n}\n"
      },
      "src/periphery/rewards/interfaces/ITransferStrategyBase.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\ninterface ITransferStrategyBase {\n  event EmergencyWithdrawal(\n    address indexed caller,\n    address indexed token,\n    address indexed to,\n    uint256 amount\n  );\n\n  /**\n   * @dev Perform custom transfer logic via delegate call from source contract to a TransferStrategy implementation\n   * @param to Account to transfer rewards\n   * @param reward Address of the reward token\n   * @param amount Amount to transfer to the \"to\" address parameter\n   * @return Returns true bool if transfer logic succeeds\n   */\n  function performTransfer(\n    address to,\n    address reward,\n    uint256 amount\n  ) external returns (bool);\n\n  /**\n   * @return Returns the address of the Incentives Controller\n   */\n  function getIncentivesController() external view returns (address);\n\n  /**\n   * @return Returns the address of the Rewards admin\n   */\n  function getRewardsAdmin() external view returns (address);\n\n  /**\n   * @dev Perform an emergency token withdrawal only callable by the Rewards admin\n   * @param token Address of the token to withdraw funds from this contract\n   * @param to Address of the recipient of the withdrawal\n   * @param amount Amount of the withdrawal\n   */\n  function emergencyWithdrawal(\n    address token,\n    address to,\n    uint256 amount\n  ) external;\n}\n"
      },
      "src/periphery/rewards/interfaces/IRewardsController.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport {IRewardsDistributor} from './IRewardsDistributor.sol';\nimport {ITransferStrategyBase} from './ITransferStrategyBase.sol';\nimport {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol';\nimport {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol';\n\n/**\n * @title IRewardsController\n * @author Aave\n * @notice Defines the basic interface for a Rewards Controller.\n */\ninterface IRewardsController is IRewardsDistributor {\n  /**\n   * @dev Emitted when a new address is whitelisted as claimer of rewards on behalf of a user\n   * @param user The address of the user\n   * @param claimer The address of the claimer\n   */\n  event ClaimerSet(address indexed user, address indexed claimer);\n\n  /**\n   * @dev Emitted when rewards are claimed\n   * @param user The address of the user rewards has been claimed on behalf of\n   * @param reward The address of the token reward is claimed\n   * @param to The address of the receiver of the rewards\n   * @param claimer The address of the claimer\n   * @param amount The amount of rewards claimed\n   */\n  event RewardsClaimed(\n    address indexed user,\n    address indexed reward,\n    address indexed to,\n    address claimer,\n    uint256 amount\n  );\n\n  /**\n   * @dev Emitted when a transfer strategy is installed for the reward distribution\n   * @param reward The address of the token reward\n   * @param transferStrategy The address of TransferStrategy contract\n   */\n  event TransferStrategyInstalled(address indexed reward, address indexed transferStrategy);\n\n  /**\n   * @dev Emitted when the reward oracle is updated\n   * @param reward The address of the token reward\n   * @param rewardOracle The address of oracle\n   */\n  event RewardOracleUpdated(address indexed reward, address indexed rewardOracle);\n\n  /**\n   * @dev Whitelists an address to claim the rewards on behalf of another address\n   * @param user The address of the user\n   * @param claimer The address of the claimer\n   */\n  function setClaimer(address user, address claimer) external;\n\n  /**\n   * @dev Sets a TransferStrategy logic contract that determines the logic of the rewards transfer\n   * @param reward The address of the reward token\n   * @param transferStrategy The address of the TransferStrategy logic contract\n   */\n  function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external;\n\n  /**\n   * @dev Sets an Aave Oracle contract to enforce rewards with a source of value.\n   * @notice At the moment of reward configuration, the Incentives Controller performs\n   * a check to see if the reward asset oracle is compatible with IEACAggregator proxy.\n   * This check is enforced for integrators to be able to show incentives at\n   * the current Aave UI without the need to setup an external price registry\n   * @param reward The address of the reward to set the price aggregator\n   * @param rewardOracle The address of price aggregator that follows IEACAggregatorProxy interface\n   */\n  function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external;\n\n  /**\n   * @dev Get the price aggregator oracle address\n   * @param reward The address of the reward\n   * @return The price oracle of the reward\n   */\n  function getRewardOracle(address reward) external view returns (address);\n\n  /**\n   * @dev Returns the whitelisted claimer for a certain address (0x0 if not set)\n   * @param user The address of the user\n   * @return The claimer address\n   */\n  function getClaimer(address user) external view returns (address);\n\n  /**\n   * @dev Returns the Transfer Strategy implementation contract address being used for a reward address\n   * @param reward The address of the reward\n   * @return The address of the TransferStrategy contract\n   */\n  function getTransferStrategy(address reward) external view returns (address);\n\n  /**\n   * @dev Configure assets to incentivize with an emission of rewards per second until the end of distribution.\n   * @param config The assets configuration input, the list of structs contains the following fields:\n   *   uint104 emissionPerSecond: The emission per second following rewards unit decimals.\n   *   uint256 totalSupply: The total supply of the asset to incentivize\n   *   uint40 distributionEnd: The end of the distribution of the incentives for an asset\n   *   address asset: The asset address to incentivize\n   *   address reward: The reward token address\n   *   ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic.\n   *   IEACAggregatorProxy rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend.\n   *                                     Must follow Chainlink Aggregator IEACAggregatorProxy interface to be compatible.\n   */\n  function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external;\n\n  /**\n   * @dev Called by the corresponding asset on transfer hook in order to update the rewards distribution.\n   * @dev The units of `totalSupply` and `userBalance` should be the same.\n   * @param user The address of the user whose asset balance has changed\n   * @param totalSupply The total supply of the asset prior to user balance change\n   * @param userBalance The previous user balance prior to balance change\n   **/\n  function handleAction(\n    address user,\n    uint256 totalSupply,\n    uint256 userBalance\n  ) external;\n\n  /**\n   * @dev Claims reward for a user to the desired address, on all the assets of the pool, accumulating the pending rewards\n   * @param assets List of assets to check eligible distributions before claiming rewards\n   * @param amount The amount of rewards to claim\n   * @param to The address that will be receiving the rewards\n   * @param reward The address of the reward token\n   * @return The amount of rewards claimed\n   **/\n  function claimRewards(\n    address[] calldata assets,\n    uint256 amount,\n    address to,\n    address reward\n  ) external returns (uint256);\n\n  /**\n   * @dev Claims reward for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The\n   * caller must be whitelisted via \"allowClaimOnBehalf\" function by the RewardsAdmin role manager\n   * @param assets The list of assets to check eligible distributions before claiming rewards\n   * @param amount The amount of rewards to claim\n   * @param user The address to check and claim rewards\n   * @param to The address that will be receiving the rewards\n   * @param reward The address of the reward token\n   * @return The amount of rewards claimed\n   **/\n  function claimRewardsOnBehalf(\n    address[] calldata assets,\n    uint256 amount,\n    address user,\n    address to,\n    address reward\n  ) external returns (uint256);\n\n  /**\n   * @dev Claims reward for msg.sender, on all the assets of the pool, accumulating the pending rewards\n   * @param assets The list of assets to check eligible distributions before claiming rewards\n   * @param amount The amount of rewards to claim\n   * @param reward The address of the reward token\n   * @return The amount of rewards claimed\n   **/\n  function claimRewardsToSelf(\n    address[] calldata assets,\n    uint256 amount,\n    address reward\n  ) external returns (uint256);\n\n  /**\n   * @dev Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards\n   * @param assets The list of assets to check eligible distributions before claiming rewards\n   * @param to The address that will be receiving the rewards\n   * @return rewardsList List of addresses of the reward tokens\n   * @return claimedAmounts List that contains the claimed amount per reward, following same order as \"rewardList\"\n   **/\n  function claimAllRewards(address[] calldata assets, address to)\n    external\n    returns (address[] memory rewardsList, uint256[] memory claimedAmounts);\n\n  /**\n   * @dev Claims all rewards for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The caller must\n   * be whitelisted via \"allowClaimOnBehalf\" function by the RewardsAdmin role manager\n   * @param assets The list of assets to check eligible distributions before claiming rewards\n   * @param user The address to check and claim rewards\n   * @param to The address that will be receiving the rewards\n   * @return rewardsList List of addresses of the reward tokens\n   * @return claimedAmounts List that contains the claimed amount per reward, following same order as \"rewardsList\"\n   **/\n  function claimAllRewardsOnBehalf(\n    address[] calldata assets,\n    address user,\n    address to\n  ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts);\n\n  /**\n   * @dev Claims all reward for msg.sender, on all the assets of the pool, accumulating the pending rewards\n   * @param assets The list of assets to check eligible distributions before claiming rewards\n   * @return rewardsList List of addresses of the reward tokens\n   * @return claimedAmounts List that contains the claimed amount per reward, following same order as \"rewardsList\"\n   **/\n  function claimAllRewardsToSelf(address[] calldata assets)\n    external\n    returns (address[] memory rewardsList, uint256[] memory claimedAmounts);\n}\n"
      },
      "src/periphery/rewards/libraries/RewardsDataTypes.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol';\nimport {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol';\n\nlibrary RewardsDataTypes {\n  struct RewardsConfigInput {\n    uint88 emissionPerSecond;\n    uint256 totalSupply;\n    uint32 distributionEnd;\n    address asset;\n    address reward;\n    ITransferStrategyBase transferStrategy;\n    IEACAggregatorProxy rewardOracle;\n  }\n\n  struct UserAssetBalance {\n    address asset;\n    uint256 userBalance;\n    uint256 totalSupply;\n  }\n\n  struct UserData {\n    // Liquidity index of the reward distribution for the user\n    uint104 index;\n    // Amount of accrued rewards for the user since last user index update\n    uint128 accrued;\n  }\n\n  struct RewardData {\n    // Liquidity index of the reward distribution\n    uint104 index;\n    // Amount of reward tokens distributed per second\n    uint88 emissionPerSecond;\n    // Timestamp of the last reward index update\n    uint32 lastUpdateTimestamp;\n    // The end of the distribution of rewards (in seconds)\n    uint32 distributionEnd;\n    // Map of user addresses and their rewards data (userAddress => userData)\n    mapping(address => UserData) usersData;\n  }\n\n  struct AssetData {\n    // Map of reward token addresses and their data (rewardTokenAddress => rewardData)\n    mapping(address => RewardData) rewards;\n    // List of reward token addresses for the asset\n    mapping(uint128 => address) availableRewards;\n    // Count of reward tokens for the asset\n    uint128 availableRewardsCount;\n    // Number of decimals of the asset\n    uint8 decimals;\n  }\n}\n"
      },
      "src/core/dependencies/openzeppelin/contracts/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n  function _msgSender() internal view virtual returns (address payable) {\n    return payable(msg.sender);\n  }\n\n  function _msgData() internal view virtual returns (bytes memory) {\n    this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n    return msg.data;\n  }\n}\n"
      },
      "src/periphery/rewards/interfaces/IRewardsDistributor.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\n/**\n * @title IRewardsDistributor\n * @author Aave\n * @notice Defines the basic interface for a Rewards Distributor.\n */\ninterface IRewardsDistributor {\n  /**\n   * @dev Emitted when the configuration of the rewards of an asset is updated.\n   * @param asset The address of the incentivized asset\n   * @param reward The address of the reward token\n   * @param oldEmission The old emissions per second value of the reward distribution\n   * @param newEmission The new emissions per second value of the reward distribution\n   * @param oldDistributionEnd The old end timestamp of the reward distribution\n   * @param newDistributionEnd The new end timestamp of the reward distribution\n   * @param assetIndex The index of the asset distribution\n   */\n  event AssetConfigUpdated(\n    address indexed asset,\n    address indexed reward,\n    uint256 oldEmission,\n    uint256 newEmission,\n    uint256 oldDistributionEnd,\n    uint256 newDistributionEnd,\n    uint256 assetIndex\n  );\n\n  /**\n   * @dev Emitted when rewards of an asset are accrued on behalf of a user.\n   * @param asset The address of the incentivized asset\n   * @param reward The address of the reward token\n   * @param user The address of the user that rewards are accrued on behalf of\n   * @param assetIndex The index of the asset distribution\n   * @param userIndex The index of the asset distribution on behalf of the user\n   * @param rewardsAccrued The amount of rewards accrued\n   */\n  event Accrued(\n    address indexed asset,\n    address indexed reward,\n    address indexed user,\n    uint256 assetIndex,\n    uint256 userIndex,\n    uint256 rewardsAccrued\n  );\n\n  /**\n   * @dev Sets the end date for the distribution\n   * @param asset The asset to incentivize\n   * @param reward The reward token that incentives the asset\n   * @param newDistributionEnd The end date of the incentivization, in unix time format\n   **/\n  function setDistributionEnd(\n    address asset,\n    address reward,\n    uint32 newDistributionEnd\n  ) external;\n\n  /**\n   * @dev Sets the emission per second of a set of reward distributions\n   * @param asset The asset is being incentivized\n   * @param rewards List of reward addresses are being distributed\n   * @param newEmissionsPerSecond List of new reward emissions per second\n   */\n  function setEmissionPerSecond(\n    address asset,\n    address[] calldata rewards,\n    uint88[] calldata newEmissionsPerSecond\n  ) external;\n\n  /**\n   * @dev Gets the end date for the distribution\n   * @param asset The incentivized asset\n   * @param reward The reward token of the incentivized asset\n   * @return The timestamp with the end of the distribution, in unix time format\n   **/\n  function getDistributionEnd(address asset, address reward) external view returns (uint256);\n\n  /**\n   * @dev Returns the index of a user on a reward distribution\n   * @param user Address of the user\n   * @param asset The incentivized asset\n   * @param reward The reward token of the incentivized asset\n   * @return The current user asset index, not including new distributions\n   **/\n  function getUserAssetIndex(\n    address user,\n    address asset,\n    address reward\n  ) external view returns (uint256);\n\n  /**\n   * @dev Returns the configuration of the distribution reward for a certain asset\n   * @param asset The incentivized asset\n   * @param reward The reward token of the incentivized asset\n   * @return The index of the asset distribution\n   * @return The emission per second of the reward distribution\n   * @return The timestamp of the last update of the index\n   * @return The timestamp of the distribution end\n   **/\n  function getRewardsData(address asset, address reward)\n    external\n    view\n    returns (\n      uint256,\n      uint256,\n      uint256,\n      uint256\n    );\n\n  /**\n   * @dev Calculates the next value of an specific distribution index, with validations.\n   * @param asset The incentivized asset\n   * @param reward The reward token of the incentivized asset\n   * @return The old index of the asset distribution\n   * @return The new index of the asset distribution\n   **/\n  function getAssetIndex(address asset, address reward) external view returns (uint256, uint256);\n\n  /**\n   * @dev Returns the list of available reward token addresses of an incentivized asset\n   * @param asset The incentivized asset\n   * @return List of rewards addresses of the input asset\n   **/\n  function getRewardsByAsset(address asset) external view returns (address[] memory);\n\n  /**\n   * @dev Returns the list of available reward addresses\n   * @return List of rewards supported in this contract\n   **/\n  function getRewardsList() external view returns (address[] memory);\n\n  /**\n   * @dev Returns the accrued rewards balance of a user, not including virtually accrued rewards since last distribution.\n   * @param user The address of the user\n   * @param reward The address of the reward token\n   * @return Unclaimed rewards, not including new distributions\n   **/\n  function getUserAccruedRewards(address user, address reward) external view returns (uint256);\n\n  /**\n   * @dev Returns a single rewards balance of a user, including virtually accrued and unrealized claimable rewards.\n   * @param assets List of incentivized assets to check eligible distributions\n   * @param user The address of the user\n   * @param reward The address of the reward token\n   * @return The rewards amount\n   **/\n  function getUserRewards(\n    address[] calldata assets,\n    address user,\n    address reward\n  ) external view returns (uint256);\n\n  /**\n   * @dev Returns a list all rewards of a user, including already accrued and unrealized claimable rewards\n   * @param assets List of incentivized assets to check eligible distributions\n   * @param user The address of the user\n   * @return The list of reward addresses\n   * @return The list of unclaimed amount of rewards\n   **/\n  function getAllUserRewards(address[] calldata assets, address user)\n    external\n    view\n    returns (address[] memory, uint256[] memory);\n\n  /**\n   * @dev Returns the decimals of an asset to calculate the distribution delta\n   * @param asset The address to retrieve decimals\n   * @return The decimals of an underlying asset\n   */\n  function getAssetDecimals(address asset) external view returns (uint8);\n\n  /**\n   * @dev Returns the address of the emission manager\n   * @return The address of the EmissionManager\n   */\n  function EMISSION_MANAGER() external view returns (address);\n\n  /**\n   * @dev Returns the address of the emission manager.\n   * Deprecated: This getter is maintained for compatibility purposes. Use the `EMISSION_MANAGER()` function instead.\n   * @return The address of the EmissionManager\n   */\n  function getEmissionManager() external view returns (address);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "forge-std/=lib/forge-std/src/",
        "test/=test/",
        "@openzeppelin/=lib/openzeppelin-contracts/contracts/",
        "@aave/=node_modules/@aave/",
        "eth-gas-reporter/=node_modules/eth-gas-reporter/",
        "hardhat-deploy/=node_modules/hardhat-deploy/",
        "hardhat/=node_modules/hardhat/",
        "src/=src/",
        "@ensdomains/=node_modules/@ensdomains/",
        "@siddomains/=node_modules/@siddomains/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin/=lib/openzeppelin-contracts/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs"
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "london",
      "libraries": {
        "src/core/protocol/libraries/logic/BorrowLogic.sol": {
          "BorrowLogic": "0xb2a2C005B57Ba13d2f6730ABc05FB1086dE75c94"
        },
        "src/core/protocol/libraries/logic/BridgeLogic.sol": {
          "BridgeLogic": "0xd0209F725637631153F1fCB3a2d869acA9afdF88"
        },
        "src/core/protocol/libraries/logic/ConfiguratorLogic.sol": {
          "ConfiguratorLogic": "0xD74d4495936b066218Eb9bf20995BFF93574bC8D"
        },
        "src/core/protocol/libraries/logic/EModeLogic.sol": {
          "EModeLogic": "0x4e68bCD17c6e47Cd7C80D66770f80161296C4273"
        },
        "src/core/protocol/libraries/logic/FlashLoanLogic.sol": {
          "FlashLoanLogic": "0x9F3de000b98A7227348869D40E6Cf739989b8B4D"
        },
        "src/core/protocol/libraries/logic/LiquidationLogic.sol": {
          "LiquidationLogic": "0xE6F87565576785693Ab8eD298dFAbb99eFBcA163"
        },
        "src/core/protocol/libraries/logic/PoolLogic.sol": {
          "PoolLogic": "0x5d9991711eBC3e8F69B1e2cf99B8Cade98792C2B"
        },
        "src/core/protocol/libraries/logic/SupplyLogic.sol": {
          "SupplyLogic": "0xC981354BDCA1829Ac6D40aDE968898703b2e0Cb1"
        }
      }
    }
  }}