creation_sourcecode: {{
    "sources": {
      "src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n  /**\n   * @dev Returns the amount of tokens in existence.\n   */\n  function totalSupply() external view returns (uint256);\n\n  /**\n   * @dev Returns the amount of tokens owned by `account`.\n   */\n  function balanceOf(address account) external view returns (uint256);\n\n  /**\n   * @dev Moves `amount` tokens from the caller's account to `recipient`.\n   *\n   * Returns a boolean value indicating whether the operation succeeded.\n   *\n   * Emits a {Transfer} event.\n   */\n  function transfer(address recipient, uint256 amount) external returns (bool);\n\n  /**\n   * @dev Returns the remaining number of tokens that `spender` will be\n   * allowed to spend on behalf of `owner` through {transferFrom}. This is\n   * zero by default.\n   *\n   * This value changes when {approve} or {transferFrom} are called.\n   */\n  function allowance(address owner, address spender) external view returns (uint256);\n\n  /**\n   * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n   *\n   * Returns a boolean value indicating whether the operation succeeded.\n   *\n   * IMPORTANT: Beware that changing an allowance with this method brings the risk\n   * that someone may use both the old and the new allowance by unfortunate\n   * transaction ordering. One possible solution to mitigate this race\n   * condition is to first reduce the spender's allowance to 0 and set the\n   * desired value afterwards:\n   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n   *\n   * Emits an {Approval} event.\n   */\n  function approve(address spender, uint256 amount) external returns (bool);\n\n  /**\n   * @dev Moves `amount` tokens from `sender` to `recipient` using the\n   * allowance mechanism. `amount` is then deducted from the caller's\n   * allowance.\n   *\n   * Returns a boolean value indicating whether the operation succeeded.\n   *\n   * Emits a {Transfer} event.\n   */\n  function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n  /**\n   * @dev Emitted when `value` tokens are moved from one account (`from`) to\n   * another (`to`).\n   *\n   * Note that `value` may be zero.\n   */\n  event Transfer(address indexed from, address indexed to, uint256 value);\n\n  /**\n   * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n   * a call to {approve}. `value` is the new allowance.\n   */\n  event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
      },
      "src/periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport {IFeeClaimer} from './interfaces/IFeeClaimer.sol';\nimport {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\n\n/**\n * @title AaveParaSwapFeeClaimer\n * @author BGD Labs\n * @dev Helper contract that allows claiming paraswap partner fee to the collector on the respective network.\n */\ncontract AaveParaSwapFeeClaimer {\n  // lowercase for backwards compatibility as originally this was in storage\n  address public immutable aaveCollector;\n  IFeeClaimer public immutable paraswapFeeClaimer;\n\n  constructor(address _aaveCollector, IFeeClaimer _paraswapFeeClaimer) {\n    require(address(_paraswapFeeClaimer) != address(0), 'PARASWAP_FEE_CLAIMER_REQUIRED');\n    require(_aaveCollector != address(0), 'COLLECTOR_REQUIRED');\n    aaveCollector = _aaveCollector;\n    paraswapFeeClaimer = _paraswapFeeClaimer;\n  }\n\n  /**\n   * @dev returns claimable balance for a specified asset\n   * @param asset The asset to fetch claimable balance of\n   */\n  function getClaimable(address asset) external view returns (uint256) {\n    return paraswapFeeClaimer.getBalance(IERC20(asset), address(this));\n  }\n\n  /**\n   * @dev returns claimable balances for specified assets\n   * @param assets The assets to fetch claimable balances of\n   */\n  function batchGetClaimable(address[] memory assets) external view returns (uint256[] memory) {\n    return paraswapFeeClaimer.batchGetBalance(assets, address(this));\n  }\n\n  /**\n   * @dev withdraws a single asset to the collector\n   * @notice will revert when there's nothing to claim\n   * @param asset The asset to claim rewards of\n   */\n  function claimToCollector(IERC20 asset) external {\n    paraswapFeeClaimer.withdrawAllERC20(asset, aaveCollector);\n  }\n\n  /**\n   * @dev withdraws all asset to the collector\n   * @notice will revert when there's nothing to claim on a single supplied asset\n   * @param assets The assets to claim rewards of\n   */\n  function batchClaimToCollector(address[] memory assets) external {\n    paraswapFeeClaimer.batchWithdrawAllERC20(assets, aaveCollector);\n  }\n}\n"
      },
      "src/periphery/contracts/adapters/paraswap/interfaces/IFeeClaimer.sol": {
        "content": "// SPDX-License-Identifier: ISC\npragma solidity ^0.8.0;\n\nimport {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\n\ninterface IFeeClaimer {\n  /**\n   * @notice register partner's, affiliate's and PP's fee\n   * @dev only callable by AugustusSwapper contract\n   * @param _account account address used to withdraw fees\n   * @param _token token address\n   * @param _fee fee amount in token\n   */\n  function registerFee(address _account, IERC20 _token, uint256 _fee) external;\n\n  /**\n   * @notice claim partner share fee in ERC20 token\n   * @dev transfers ERC20 token balance to the caller's account\n   *      the call will fail if withdrawer have zero balance in the contract\n   * @param _token address of the ERC20 token\n   * @param _recipient address\n   * @return true if the withdraw was successfull\n   */\n  function withdrawAllERC20(IERC20 _token, address _recipient) external returns (bool);\n\n  /**\n   * @notice batch claim whole balance of fee share amount\n   * @dev transfers ERC20 token balance to the caller's account\n   *      the call will fail if withdrawer have zero balance in the contract\n   * @param _tokens list of addresses of the ERC20 token\n   * @param _recipient address of recipient\n   * @return true if the withdraw was successfull\n   */\n  function batchWithdrawAllERC20(\n    address[] calldata _tokens,\n    address _recipient\n  ) external returns (bool);\n\n  /**\n   * @notice claim some partner share fee in ERC20 token\n   * @dev transfers ERC20 token amount to the caller's account\n   *      the call will fail if withdrawer have zero balance in the contract\n   * @param _token address of the ERC20 token\n   * @param _recipient address\n   * @return true if the withdraw was successfull\n   */\n  function withdrawSomeERC20(\n    IERC20 _token,\n    uint256 _tokenAmount,\n    address _recipient\n  ) external returns (bool);\n\n  /**\n   * @notice batch claim some amount of fee share in ERC20 token\n   * @dev transfers ERC20 token balance to the caller's account\n   *      the call will fail if withdrawer have zero balance in the contract\n   * @param _tokens address of the ERC20 tokens\n   * @param _tokenAmounts array of amounts\n   * @param _recipient destination account addresses\n   * @return true if the withdraw was successfull\n   */\n  function batchWithdrawSomeERC20(\n    IERC20[] calldata _tokens,\n    uint256[] calldata _tokenAmounts,\n    address _recipient\n  ) external returns (bool);\n\n  /**\n   * @notice compute unallocated fee in token\n   * @param _token address of the ERC20 token\n   * @return amount of unallocated token in fees\n   */\n  function getUnallocatedFees(IERC20 _token) external view returns (uint256);\n\n  /**\n   * @notice returns unclaimed fee amount given the token\n   * @dev retrieves the balance of ERC20 token fee amount for a partner\n   * @param _token address of the ERC20 token\n   * @param _partner account address of the partner\n   * @return amount of balance\n   */\n  function getBalance(IERC20 _token, address _partner) external view returns (uint256);\n\n  /**\n   * @notice returns unclaimed fee amount given the token in batch\n   * @dev retrieves the balance of ERC20 token fee amount for a partner in batch\n   * @param _tokens list of ERC20 token addresses\n   * @param _partner account address of the partner\n   * @return _fees array of the token amount\n   */\n  function batchGetBalance(\n    address[] calldata _tokens,\n    address _partner\n  ) external view returns (uint256[] memory _fees);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "solidity-utils/=lib/solidity-utils/src/",
        "forge-std/=lib/forge-std/src/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "aave-address-book/=lib/aave-address-book/src/",
        "aave-address-book:aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
        "lib/aave-address-book:aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
        "lib/aave-address-book:aave-v3-periphery/=lib/aave-address-book/lib/aave-v3-periphery/",
        "aave-v3-core/=src/core/",
        "aave-v3-periphery/=src/periphery/",
        "@aave/core-v3/=lib/aave-address-book/lib/aave-v3-core/",
        "@aave/periphery-v3/=lib/aave-address-book/lib/aave-v3-periphery/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "none",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": false,
      "libraries": {
        "src/core/contracts/protocol/libraries/logic/BorrowLogic.sol": {
          "BorrowLogic": "0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1"
        },
        "src/core/contracts/protocol/libraries/logic/BridgeLogic.sol": {
          "BridgeLogic": "0xca2385754bCa5d632F5160B560352aBd12029685"
        },
        "src/core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol": {
          "ConfiguratorLogic": "0x6F4964Db83CeCCDc98164796221d5259b922313C"
        },
        "src/core/contracts/protocol/libraries/logic/EModeLogic.sol": {
          "EModeLogic": "0x12959a64470Dd003590Bb1EcFC436dddE7608724"
        },
        "src/core/contracts/protocol/libraries/logic/FlashLoanLogic.sol": {
          "FlashLoanLogic": "0x6DA8d7EF0625e965dafc393793C048096392d4a5"
        },
        "src/core/contracts/protocol/libraries/logic/LiquidationLogic.sol": {
          "LiquidationLogic": "0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e"
        },
        "src/core/contracts/protocol/libraries/logic/PoolLogic.sol": {
          "PoolLogic": "0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975"
        },
        "src/core/contracts/protocol/libraries/logic/SupplyLogic.sol": {
          "SupplyLogic": "0x9336943ecd91C201D9ED5A21562b34Aef710052f"
        }
      }
    },
    "language": "Solidity"
  }}