creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/proposals/20240417/SparkEthereum_20240417.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport { SparkPayloadEthereum, Ethereum } from 'src/SparkPayloadEthereum.sol';\n\nimport { Gnosis } from 'spark-address-registry/src/Gnosis.sol';\n\nimport { IACLManager }            from 'sparklend-v1-core/contracts/interfaces/IACLManager.sol';\nimport { IPoolAddressesProvider } from 'sparklend-v1-core/contracts/interfaces/IPoolAddressesProvider.sol';\n\nimport { ISparkLendFreezerMom } from 'sparklend-freezer/interfaces/ISparkLendFreezerMom.sol';\n\nimport { XChainForwarders } from 'xchain-helpers/XChainForwarders.sol';\n\n/**\n * @title  April 17, 2024 Spark Ethereum Proposal\n * @notice Upgrade Pool Implementation to SparkLend V1.0.0, activate Freezer Mom /w multi-sig, trigger Gnosis Payload.\n * @author Phoenix Labs\n * Forum:  https://forum.makerdao.com/t/apr-4-2024-proposed-changes-to-sparklend-for-upcoming-spell/24033\n *         https://forum.makerdao.com/t/sparklend-external-security-access-multisig-for-freezer-mom/24070\n * Votes:  https://vote.makerdao.com/polling/QmZND8WW#poll-detail\n *         https://vote.makerdao.com/polling/QmVXriiT#poll-detail\n */\ncontract SparkEthereum_20240417 is SparkPayloadEthereum {\n\n    address public constant POOL_IMPLEMENTATION_NEW = 0x5aE329203E00f76891094DcfedD5Aca082a50e1b;\n    address public constant FREEZER_MOM_NEW         = 0x237e3985dD7E373F2ec878EC1Ac48A228Cf2e7a3;\n    address public constant FREEZER_MULTISIG        = 0x44efFc473e81632B12486866AA1678edbb7BEeC3;\n    \n    address public constant GNOSIS_PAYLOAD = 0xa2915822472377C7EF913D5E4D149891FEe4999e;\n\n    function _postExecute()\n        internal override\n    {\n        // Update Pool Implementation\n        IPoolAddressesProvider(Ethereum.POOL_ADDRESSES_PROVIDER).setPoolImpl(POOL_IMPLEMENTATION_NEW);\n\n        // De-auth the old Freezer Mom\n        IACLManager(Ethereum.ACL_MANAGER).removeEmergencyAdmin(Ethereum.FREEZER_MOM);\n        IACLManager(Ethereum.ACL_MANAGER).removeRiskAdmin(Ethereum.FREEZER_MOM);\n\n        // Activate the Freezer Mom\n        ISparkLendFreezerMom(FREEZER_MOM_NEW).setAuthority(Ethereum.CHIEF);\n        ISparkLendFreezerMom(FREEZER_MOM_NEW).rely(FREEZER_MULTISIG);\n        IACLManager(Ethereum.ACL_MANAGER).addEmergencyAdmin(FREEZER_MOM_NEW);\n        IACLManager(Ethereum.ACL_MANAGER).addRiskAdmin(FREEZER_MOM_NEW);\n\n        // Trigger Gnosis Payload\n        XChainForwarders.sendMessageGnosis(\n            Gnosis.AMB_EXECUTOR,\n            encodePayloadQueue(GNOSIS_PAYLOAD),\n            4_000_000\n        );\n    }\n\n}\n"
      },
      "src/SparkPayloadEthereum.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport './AaveV3PayloadBase.sol';\n\nimport { Ethereum } from 'spark-address-registry/src/Ethereum.sol';\n\nimport { IL2BridgeExecutor } from 'spark-gov-relay/interfaces/IL2BridgeExecutor.sol';\n\n/**\n * @dev Base smart contract for Ethereum.\n * @author Phoenix Labs\n */\nabstract contract SparkPayloadEthereum is\n    AaveV3PayloadBase(IEngine(Ethereum.CONFIG_ENGINE))\n{\n    function getPoolContext() public pure override returns (IEngine.PoolContext memory) {\n        return IEngine.PoolContext({networkName: 'Ethereum', networkAbbreviation: 'Eth'});\n    }\n    function encodePayloadQueue(address _payload) internal pure returns (bytes memory) {\n        address[] memory targets        = new address[](1);\n        uint256[] memory values         = new uint256[](1);\n        string[] memory signatures      = new string[](1);\n        bytes[] memory calldatas        = new bytes[](1);\n        bool[] memory withDelegatecalls = new bool[](1);\n\n        targets[0]           = _payload;\n        values[0]            = 0;\n        signatures[0]        = 'execute()';\n        calldatas[0]         = '';\n        withDelegatecalls[0] = true;\n\n        return abi.encodeCall(IL2BridgeExecutor.queue, (\n            targets,\n            values,\n            signatures,\n            calldatas,\n            withDelegatecalls\n        ));\n    }\n}\n"
      },
      "lib/spark-address-registry/src/Gnosis.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-or-later\npragma solidity ^0.8.13;\n\nlibrary Gnosis {\n\n    /******************************************************************************************************************/\n    /*** Token Addresses                                                                                            ***/\n    /******************************************************************************************************************/\n\n    address internal constant GNO    = 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb;\n    address internal constant WETH   = 0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1;\n    address internal constant WSTETH = 0x6C76971f98945AE98dD7d4DFcA8711ebea946eA6;\n    address internal constant WXDAI  = 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Core Protocol Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant AAVE_ORACLE                      = 0x8105f69D9C41644c6A0803fDA7D03Aa70996cFD9;\n    address internal constant ACL_MANAGER                      = 0x86C71796CcDB31c3997F8Ec5C2E3dB3e9e40b985;\n    address internal constant EMISSION_MANAGER                 = 0x4d988568b5f0462B08d1F40bA1F5f17ad2D24F76;\n    address internal constant INCENTIVES                       = 0x98e6BcBA7d5daFbfa4a92dAF08d3d7512820c30C;\n    address internal constant POOL                             = 0x2Dae5307c5E3FD1CF5A72Cb6F698f915860607e0;\n    address internal constant POOL_ADDRESSES_PROVIDER          = 0xA98DaCB3fC964A6A0d2ce3B77294241585EAbA6d;\n    address internal constant POOL_ADDRESSES_PROVIDER_REGISTRY = 0x49d24798d3b84965F0d1fc8684EF6565115e70c1;\n    address internal constant POOL_CONFIGURATOR                = 0x2Fc8823E1b967D474b47Ae0aD041c2ED562ab588;\n    address internal constant TREASURY                         = 0xb9E6DBFa4De19CCed908BcbFe1d015190678AB5f;\n    address internal constant TREASURY_CONTROLLER              = 0x8220096398c3Dc2644026E8864f5D80Ef613B437;\n    address internal constant WETH_GATEWAY                     = 0xBD7D6a9ad7865463DE44B05F04559f65e3B11704;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Reserve Token Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant GNO_ATOKEN            = 0x5671b0B8aC13DC7813D36B99C21c53F6cd376a14;\n    address internal constant GNO_STABLE_DEBT_TOKEN = 0x2f589BADbE2024a94f144ef24344aF91dE21a33c;\n    address internal constant GNO_DEBT_TOKEN        = 0xd4bAbF714964E399f95A7bb94B3DeaF22d9F575d;\n\n    address internal constant WETH_ATOKEN            = 0x629D562E92fED431122e865Cc650Bc6bdE6B96b0;\n    address internal constant WETH_STABLE_DEBT_TOKEN = 0xe21Bf3FB5A2b5Bf7BAE8c6F1696c4B097F5D2f93;\n    address internal constant WETH_DEBT_TOKEN        = 0x0aD6cCf9a2e81d4d48aB7db791e9da492967eb84;\n\n    address internal constant WSTETH_ATOKEN            = 0x9Ee4271E17E3a427678344fd2eE64663Cb78B4be;\n    address internal constant WSTETH_STABLE_DEBT_TOKEN = 0x0F0e336Ab69D9516A9acF448bC59eA0CE79E4a42;\n    address internal constant WSTETH_DEBT_TOKEN        = 0x3294dA2E28b29D1c08D556e2B86879d221256d31;\n\n    address internal constant WXDAI_ATOKEN            = 0xC9Fe2D32E96Bb364c7d29f3663ed3b27E30767bB;\n    address internal constant WXDAI_STABLE_DEBT_TOKEN = 0xab1B62A1346Acf534b581684940E2FD781F2EA22;\n    address internal constant WXDAI_DEBT_TOKEN        = 0x868ADfDf12A86422524EaB6978beAE08A0008F37;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Implementation Addresses                                                                       ***/\n    /******************************************************************************************************************/\n\n    address internal constant A_TOKEN_IMPL             = 0x856900aa78e856a5df1a2665eE3a66b2487cD68f;\n    address internal constant INCENTIVES_IMPL          = 0x764b4AB9bCA18eB633d92368F725765Ebb8f047C;\n    address internal constant POOL_CONFIGURATOR_IMPL   = 0x6175ddEc3B9b38c88157C10A01ed4A3fa8639cC6;\n    address internal constant POOL_IMPL                = 0xa8fC41696F2a230b03F77d258Db39069e9e55F56;\n    address internal constant STABLE_DEBT_TOKEN_IMPL   = 0x4370D3b6C9588E02ce9D22e684387859c7Ff5b34;\n    address internal constant TREASURY_IMPL            = 0x571501be53711c372cE69De51865dD34B87698D5;\n    address internal constant VARIABLE_DEBT_TOKEN_IMPL = 0x0ee554F6A1f7a4Cb4f82D4C124DdC2AD3E37fde1;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Config Engine Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant PROXY_ADMIN               = 0xf76B8262dfd60fb7432C6b55E91f42b6da953647;\n    address internal constant CONFIG_ENGINE             = 0x36eddc380C7f370e5f05Da5Bd7F970a27f063e39;\n    address internal constant RATES_FACTORY             = 0xe04ba71E46fCd7DBB9334D8FBa13d476f38EB0f8;\n    address internal constant TRANSPARENT_PROXY_FACTORY = 0x91277b74a9d1Cc30fA0ff4927C287fe55E307D78;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Data Provider Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant PROTOCOL_DATA_PROVIDER     = 0x2a002054A06546bB5a264D57A81347e23Af91D18;\n    address internal constant UI_INCENTIVE_DATA_PROVIDER = 0xA7F8A757C4f7696c015B595F51B2901AC0121B18;\n    address internal constant UI_POOL_DATA_PROVIDER      = 0xF028c2F4b19898718fD0F77b9b881CbfdAa5e8Bb;\n    address internal constant WALLET_BALANCE_PROVIDER    = 0xd2AeF86F51F92E8e49F42454c287AE4879D1BeDc;\n\n    /******************************************************************************************************************/\n    /*** Bridging Addresses                                                                                         ***/\n    /******************************************************************************************************************/\n\n    address constant AMB_EXECUTOR = 0xc4218C1127cB24a0D6c1e7D25dc34e10f2625f5A;\n    address constant L1_AMB       = 0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e;\n    address constant L2_AMB       = 0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59;\n\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IACLManager.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IACLManager\n * @author Aave\n * @notice Defines the basic interface for the ACL Manager\n */\ninterface IACLManager {\n  /**\n   * @notice Returns the contract address of the PoolAddressesProvider\n   * @return The address of the PoolAddressesProvider\n   */\n  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n  /**\n   * @notice Returns the identifier of the PoolAdmin role\n   * @return The id of the PoolAdmin role\n   */\n  function POOL_ADMIN_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Returns the identifier of the EmergencyAdmin role\n   * @return The id of the EmergencyAdmin role\n   */\n  function EMERGENCY_ADMIN_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Returns the identifier of the RiskAdmin role\n   * @return The id of the RiskAdmin role\n   */\n  function RISK_ADMIN_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Returns the identifier of the FlashBorrower role\n   * @return The id of the FlashBorrower role\n   */\n  function FLASH_BORROWER_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Returns the identifier of the Bridge role\n   * @return The id of the Bridge role\n   */\n  function BRIDGE_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Returns the identifier of the AssetListingAdmin role\n   * @return The id of the AssetListingAdmin role\n   */\n  function ASSET_LISTING_ADMIN_ROLE() external view returns (bytes32);\n\n  /**\n   * @notice Set the role as admin of a specific role.\n   * @dev By default the admin role for all roles is `DEFAULT_ADMIN_ROLE`.\n   * @param role The role to be managed by the admin role\n   * @param adminRole The admin role\n   */\n  function setRoleAdmin(bytes32 role, bytes32 adminRole) external;\n\n  /**\n   * @notice Adds a new admin as PoolAdmin\n   * @param admin The address of the new admin\n   */\n  function addPoolAdmin(address admin) external;\n\n  /**\n   * @notice Removes an admin as PoolAdmin\n   * @param admin The address of the admin to remove\n   */\n  function removePoolAdmin(address admin) external;\n\n  /**\n   * @notice Returns true if the address is PoolAdmin, false otherwise\n   * @param admin The address to check\n   * @return True if the given address is PoolAdmin, false otherwise\n   */\n  function isPoolAdmin(address admin) external view returns (bool);\n\n  /**\n   * @notice Adds a new admin as EmergencyAdmin\n   * @param admin The address of the new admin\n   */\n  function addEmergencyAdmin(address admin) external;\n\n  /**\n   * @notice Removes an admin as EmergencyAdmin\n   * @param admin The address of the admin to remove\n   */\n  function removeEmergencyAdmin(address admin) external;\n\n  /**\n   * @notice Returns true if the address is EmergencyAdmin, false otherwise\n   * @param admin The address to check\n   * @return True if the given address is EmergencyAdmin, false otherwise\n   */\n  function isEmergencyAdmin(address admin) external view returns (bool);\n\n  /**\n   * @notice Adds a new admin as RiskAdmin\n   * @param admin The address of the new admin\n   */\n  function addRiskAdmin(address admin) external;\n\n  /**\n   * @notice Removes an admin as RiskAdmin\n   * @param admin The address of the admin to remove\n   */\n  function removeRiskAdmin(address admin) external;\n\n  /**\n   * @notice Returns true if the address is RiskAdmin, false otherwise\n   * @param admin The address to check\n   * @return True if the given address is RiskAdmin, false otherwise\n   */\n  function isRiskAdmin(address admin) external view returns (bool);\n\n  /**\n   * @notice Adds a new address as FlashBorrower\n   * @param borrower The address of the new FlashBorrower\n   */\n  function addFlashBorrower(address borrower) external;\n\n  /**\n   * @notice Removes an address as FlashBorrower\n   * @param borrower The address of the FlashBorrower to remove\n   */\n  function removeFlashBorrower(address borrower) external;\n\n  /**\n   * @notice Returns true if the address is FlashBorrower, false otherwise\n   * @param borrower The address to check\n   * @return True if the given address is FlashBorrower, false otherwise\n   */\n  function isFlashBorrower(address borrower) external view returns (bool);\n\n  /**\n   * @notice Adds a new address as Bridge\n   * @param bridge The address of the new Bridge\n   */\n  function addBridge(address bridge) external;\n\n  /**\n   * @notice Removes an address as Bridge\n   * @param bridge The address of the bridge to remove\n   */\n  function removeBridge(address bridge) external;\n\n  /**\n   * @notice Returns true if the address is Bridge, false otherwise\n   * @param bridge The address to check\n   * @return True if the given address is Bridge, false otherwise\n   */\n  function isBridge(address bridge) external view returns (bool);\n\n  /**\n   * @notice Adds a new admin as AssetListingAdmin\n   * @param admin The address of the new admin\n   */\n  function addAssetListingAdmin(address admin) external;\n\n  /**\n   * @notice Removes an admin as AssetListingAdmin\n   * @param admin The address of the admin to remove\n   */\n  function removeAssetListingAdmin(address admin) external;\n\n  /**\n   * @notice Returns true if the address is AssetListingAdmin, false otherwise\n   * @param admin The address to check\n   * @return True if the given address is AssetListingAdmin, false otherwise\n   */\n  function isAssetListingAdmin(address admin) external view returns (bool);\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IPoolAddressesProvider.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\n/**\n * @title IPoolAddressesProvider\n * @author Aave\n * @notice Defines the basic interface for a Pool Addresses Provider.\n */\ninterface IPoolAddressesProvider {\n  /**\n   * @dev Emitted when the market identifier is updated.\n   * @param oldMarketId The old id of the market\n   * @param newMarketId The new id of the market\n   */\n  event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);\n\n  /**\n   * @dev Emitted when the pool is updated.\n   * @param oldAddress The old address of the Pool\n   * @param newAddress The new address of the Pool\n   */\n  event PoolUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the pool configurator is updated.\n   * @param oldAddress The old address of the PoolConfigurator\n   * @param newAddress The new address of the PoolConfigurator\n   */\n  event PoolConfiguratorUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the price oracle is updated.\n   * @param oldAddress The old address of the PriceOracle\n   * @param newAddress The new address of the PriceOracle\n   */\n  event PriceOracleUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the ACL manager is updated.\n   * @param oldAddress The old address of the ACLManager\n   * @param newAddress The new address of the ACLManager\n   */\n  event ACLManagerUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the ACL admin is updated.\n   * @param oldAddress The old address of the ACLAdmin\n   * @param newAddress The new address of the ACLAdmin\n   */\n  event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the price oracle sentinel is updated.\n   * @param oldAddress The old address of the PriceOracleSentinel\n   * @param newAddress The new address of the PriceOracleSentinel\n   */\n  event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the pool data provider is updated.\n   * @param oldAddress The old address of the PoolDataProvider\n   * @param newAddress The new address of the PoolDataProvider\n   */\n  event PoolDataProviderUpdated(address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when a new proxy is created.\n   * @param id The identifier of the proxy\n   * @param proxyAddress The address of the created proxy contract\n   * @param implementationAddress The address of the implementation contract\n   */\n  event ProxyCreated(\n    bytes32 indexed id,\n    address indexed proxyAddress,\n    address indexed implementationAddress\n  );\n\n  /**\n   * @dev Emitted when a new non-proxied contract address is registered.\n   * @param id The identifier of the contract\n   * @param oldAddress The address of the old contract\n   * @param newAddress The address of the new contract\n   */\n  event AddressSet(bytes32 indexed id, address indexed oldAddress, address indexed newAddress);\n\n  /**\n   * @dev Emitted when the implementation of the proxy registered with id is updated\n   * @param id The identifier of the contract\n   * @param proxyAddress The address of the proxy contract\n   * @param oldImplementationAddress The address of the old implementation contract\n   * @param newImplementationAddress The address of the new implementation contract\n   */\n  event AddressSetAsProxy(\n    bytes32 indexed id,\n    address indexed proxyAddress,\n    address oldImplementationAddress,\n    address indexed newImplementationAddress\n  );\n\n  /**\n   * @notice Returns the id of the Aave market to which this contract points to.\n   * @return The market id\n   */\n  function getMarketId() external view returns (string memory);\n\n  /**\n   * @notice Associates an id with a specific PoolAddressesProvider.\n   * @dev This can be used to create an onchain registry of PoolAddressesProviders to\n   * identify and validate multiple Aave markets.\n   * @param newMarketId The market id\n   */\n  function setMarketId(string calldata newMarketId) external;\n\n  /**\n   * @notice Returns an address by its identifier.\n   * @dev The returned address might be an EOA or a contract, potentially proxied\n   * @dev It returns ZERO if there is no registered address with the given id\n   * @param id The id\n   * @return The address of the registered for the specified id\n   */\n  function getAddress(bytes32 id) external view returns (address);\n\n  /**\n   * @notice General function to update the implementation of a proxy registered with\n   * certain `id`. If there is no proxy registered, it will instantiate one and\n   * set as implementation the `newImplementationAddress`.\n   * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit\n   * setter function, in order to avoid unexpected consequences\n   * @param id The id\n   * @param newImplementationAddress The address of the new implementation\n   */\n  function setAddressAsProxy(bytes32 id, address newImplementationAddress) external;\n\n  /**\n   * @notice Sets an address for an id replacing the address saved in the addresses map.\n   * @dev IMPORTANT Use this function carefully, as it will do a hard replacement\n   * @param id The id\n   * @param newAddress The address to set\n   */\n  function setAddress(bytes32 id, address newAddress) external;\n\n  /**\n   * @notice Returns the address of the Pool proxy.\n   * @return The Pool proxy address\n   */\n  function getPool() external view returns (address);\n\n  /**\n   * @notice Updates the implementation of the Pool, or creates a proxy\n   * setting the new `pool` implementation when the function is called for the first time.\n   * @param newPoolImpl The new Pool implementation\n   */\n  function setPoolImpl(address newPoolImpl) external;\n\n  /**\n   * @notice Returns the address of the PoolConfigurator proxy.\n   * @return The PoolConfigurator proxy address\n   */\n  function getPoolConfigurator() external view returns (address);\n\n  /**\n   * @notice Updates the implementation of the PoolConfigurator, or creates a proxy\n   * setting the new `PoolConfigurator` implementation when the function is called for the first time.\n   * @param newPoolConfiguratorImpl The new PoolConfigurator implementation\n   */\n  function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;\n\n  /**\n   * @notice Returns the address of the price oracle.\n   * @return The address of the PriceOracle\n   */\n  function getPriceOracle() external view returns (address);\n\n  /**\n   * @notice Updates the address of the price oracle.\n   * @param newPriceOracle The address of the new PriceOracle\n   */\n  function setPriceOracle(address newPriceOracle) external;\n\n  /**\n   * @notice Returns the address of the ACL manager.\n   * @return The address of the ACLManager\n   */\n  function getACLManager() external view returns (address);\n\n  /**\n   * @notice Updates the address of the ACL manager.\n   * @param newAclManager The address of the new ACLManager\n   */\n  function setACLManager(address newAclManager) external;\n\n  /**\n   * @notice Returns the address of the ACL admin.\n   * @return The address of the ACL admin\n   */\n  function getACLAdmin() external view returns (address);\n\n  /**\n   * @notice Updates the address of the ACL admin.\n   * @param newAclAdmin The address of the new ACL admin\n   */\n  function setACLAdmin(address newAclAdmin) external;\n\n  /**\n   * @notice Returns the address of the price oracle sentinel.\n   * @return The address of the PriceOracleSentinel\n   */\n  function getPriceOracleSentinel() external view returns (address);\n\n  /**\n   * @notice Updates the address of the price oracle sentinel.\n   * @param newPriceOracleSentinel The address of the new PriceOracleSentinel\n   */\n  function setPriceOracleSentinel(address newPriceOracleSentinel) external;\n\n  /**\n   * @notice Returns the address of the data provider.\n   * @return The address of the DataProvider\n   */\n  function getPoolDataProvider() external view returns (address);\n\n  /**\n   * @notice Updates the address of the data provider.\n   * @param newDataProvider The address of the new DataProvider\n   */\n  function setPoolDataProvider(address newDataProvider) external;\n}\n"
      },
      "lib/sparklend-freezer/src/interfaces/ISparkLendFreezerMom.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-or-later\npragma solidity >=0.8.0;\n\ninterface ISparkLendFreezerMom {\n\n    /**********************************************************************************************/\n    /*** Events                                                                                 ***/\n    /**********************************************************************************************/\n\n    /**\n     *  @dev   Event to log the freezing of a given market in SparkLend.\n     *  @dev   NOTE: This event will fire even if the market is already frozen.\n     *  @param reserve The address of the market reserve.\n     *  @param freeze  A boolean indicating whether the market is frozen or unfrozen.\n     */\n    event FreezeMarket(address indexed reserve, bool freeze);\n\n    /**\n     *  @dev   Event to log the pausing of a given market in SparkLend.\n     *  @dev   NOTE: This event will fire even if the market is already paused.\n     *  @param reserve The address of the market reserve.\n     *  @param pause   A boolean indicating whether the market is paused or unpaused.\n     */\n    event PauseMarket(address indexed reserve, bool pause);\n\n    /**\n     *  @dev   Event to log the setting of a new owner.\n     *  @param oldOwner The address of the previous owner.\n     *  @param newOwner The address of the new owner.\n     */\n    event SetOwner(address indexed oldOwner, address indexed newOwner);\n\n    /**\n     *  @dev   Event to log the setting of a new authority.\n     *  @param oldAuthority The address of the previous authority.\n     *  @param newAuthority The address of the new authority.\n     */\n    event SetAuthority(address indexed oldAuthority, address indexed newAuthority);\n\n    /**\n     *  @dev   Authorize a contract to trigger this mom.\n     *  @param usr The address to authorize.\n     */\n    event Rely(address indexed usr);\n\n    /**\n     *  @dev   Deauthorize a contract to trigger this mom.\n     *  @param usr The address to deauthorize.\n     */\n    event Deny(address indexed usr);\n\n    /**********************************************************************************************/\n    /*** Storage Variables                                                                      ***/\n    /**********************************************************************************************/\n\n    /**\n     *  @dev    Returns the address of the pool configurator.\n     *  @return The address of the pool configurator.\n     */\n    function poolConfigurator() external view returns (address);\n\n    /**\n     *  @dev    Returns the address of the pool.\n     *  @return The address of the pool.\n     */\n    function pool() external view returns (address);\n\n    /**\n     *  @dev    Returns the address of the authority.\n     *  @return The address of the authority.\n     */\n    function authority() external view returns (address);\n\n    /**\n     *  @dev    Returns the address of the owner.\n     *  @return The address of the owner.\n     */\n    function owner() external view returns (address);\n\n    /**\n     *  @dev    Returns if an address is authorized to trigger this mom (or not).\n     *  @return 1 if authorized, 0 if not.\n     */\n    function wards(address usr) external view returns (uint256);\n\n    /**********************************************************************************************/\n    /*** Owner Functions                                                                        ***/\n    /**********************************************************************************************/\n\n    /**\n     * @dev   Function to set a new authority, permissioned to owner.\n     * @param authority The address of the new authority.\n     */\n    function setAuthority(address authority) external;\n\n    /**\n     * @dev   Function to set a new owner, permissioned to owner.\n     * @param owner The address of the new owner.\n     */\n    function setOwner(address owner) external;\n\n    /**\n     *  @dev   Authorize a contract to trigger this mom.\n     *  @param usr The address to authorize.\n     */\n    function rely(address usr) external;\n\n    /**\n     *  @dev   Deauthorize a contract to trigger this mom.\n     *  @param usr The address to deauthorize.\n     */\n    function deny(address usr) external;\n\n    /**********************************************************************************************/\n    /*** Auth Functions                                                                         ***/\n    /**********************************************************************************************/\n\n    /**\n     *  @dev   Function to freeze a specified market. Permissioned using the isAuthorized function\n     *         which allows the owner, a ward, the freezer contract itself, or the `hat` in the\n     *         Chief to call the function. Note that the `authority` in this contract is assumed to\n     *         be the Chief in the MakerDAO protocol.\n     *  @param reserve The address of the market to freeze.\n     *  @param freeze  A boolean indicating whether to freeze or unfreeze the market.\n     */\n    function freezeMarket(address reserve, bool freeze) external;\n\n    /**\n     *  @dev   Function to freeze all markets. Permissioned using the isAuthorized function\n     *         which allows the owner, a ward, the freezer contract itself, or the `hat` in the\n     *         Chief to call the function. Note that the `authority` in this contract is assumed to\n     *         be the Chief in the MakerDAO protocol.\n     *  @param freeze A boolean indicating whether to freeze or unfreeze the market.\n     */\n    function freezeAllMarkets(bool freeze) external;\n\n    /**\n     *  @dev   Function to pause a specified market. Permissioned using the isAuthorized function\n     *         which allows the owner, a ward, the freezer contract itself, or the `hat` in the\n     *         Chief to call the function. Note that the `authority` in this contract is assumed to\n     *         be the Chief in the MakerDAO protocol.\n     *  @param reserve The address of the market to pause.\n     *  @param pause   A boolean indicating whether to pause or unpause the market.\n     */\n    function pauseMarket(address reserve, bool pause) external;\n\n    /**\n     *  @dev   Function to pause all markets. Permissioned using the isAuthorized function\n     *         which allows the owner, a ward, the freezer contract itself, or the `hat` in the\n     *         Chief to call the function. Note that the `authority` in this contract is assumed to\n     *         be the Chief in the MakerDAO protocol.\n     *  @param pause A boolean indicating whether to pause or unpause the market.\n     */\n    function pauseAllMarkets(bool pause) external;\n\n}\n"
      },
      "lib/xchain-helpers/src/XChainForwarders.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-or-later\npragma solidity ^0.8.0;\n\ninterface ICrossDomainOptimism {\n    function sendMessage(address _target, bytes calldata _message, uint32 _gasLimit) external;\n}\n\ninterface ICrossDomainArbitrum {\n    function createRetryableTicket(\n        address to,\n        uint256 l2CallValue,\n        uint256 maxSubmissionCost,\n        address excessFeeRefundAddress,\n        address callValueRefundAddress,\n        uint256 gasLimit,\n        uint256 maxFeePerGas,\n        bytes calldata data\n    ) external payable returns (uint256);\n    function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee) external view returns (uint256);\n}\n\ninterface ICrossDomainGnosis {\n    function requireToPassMessage(address _contract, bytes memory _data, uint256 _gas) external returns (bytes32);\n}\n\ninterface ICrossDomainZkEVM {\n    function bridgeMessage(\n        uint32 destinationNetwork,\n        address destinationAddress,\n        bool forceUpdateGlobalExitRoot,\n        bytes calldata metadata\n    ) external payable;\n}\n\n/**\n * @title XChainForwarders\n * @notice Helper functions to abstract over L1 -> L2 message passing.\n * @dev General structure is sendMessageXXX(target, message, gasLimit) where XXX is the remote domain name (IE OptimismMainnet, ArbitrumOne, Base, etc).\n */\nlibrary XChainForwarders {\n\n    /// ================================ Optimism Style ================================\n\n    function sendMessageOptimism(\n        address l1CrossDomain,\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        ICrossDomainOptimism(l1CrossDomain).sendMessage(\n            target,\n            message,\n            uint32(gasLimit)\n        );\n    }\n\n    function sendMessageOptimismMainnet(\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        sendMessageOptimism(\n            0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1,\n            target,\n            message,\n            uint32(gasLimit)\n        );\n    }\n\n    function sendMessageBase(\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        sendMessageOptimism(\n            0x866E82a600A1414e583f7F13623F1aC5d58b0Afa,\n            target,\n            message,\n            uint32(gasLimit)\n        );\n    }\n\n    /// ================================ Arbitrum Style ================================\n\n    function sendMessageArbitrum(\n        address l1CrossDomain,\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        // These constants are reasonable estimates based on current market conditions\n        // They can be updated as needed\n        uint256 maxFeePerGas = 1 gwei;\n        uint256 baseFeeMargin = 10 gwei;\n\n        uint256 maxSubmission = ICrossDomainArbitrum(l1CrossDomain).calculateRetryableSubmissionFee(message.length, block.basefee + baseFeeMargin);\n        uint256 maxRedemption = gasLimit * maxFeePerGas;\n        ICrossDomainArbitrum(l1CrossDomain).createRetryableTicket{value: maxSubmission + maxRedemption}(\n            target,\n            0, // we always assume that l2CallValue = 0\n            maxSubmission,\n            address(0), // burn the excess gas\n            address(0), // burn the excess gas\n            gasLimit,\n            maxFeePerGas,\n            message\n        );\n    }\n\n    function sendMessageArbitrumOne(\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        sendMessageArbitrum(\n            0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f,\n            target,\n            message,\n            gasLimit\n        );\n    }\n\n    function sendMessageArbitrumNova(\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        sendMessageArbitrum(\n            0xc4448b71118c9071Bcb9734A0EAc55D18A153949,\n            target,\n            message,\n            gasLimit\n        );\n    }\n\n    /// ================================ Gnosis ================================\n\n    function sendMessageGnosis(\n        address l1CrossDomain,\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        ICrossDomainGnosis(l1CrossDomain).requireToPassMessage(\n            target,\n            message,\n            gasLimit\n        );\n    }\n\n    function sendMessageGnosis(\n        address target,\n        bytes memory message,\n        uint256 gasLimit\n    ) internal {\n        sendMessageGnosis(\n            0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e,\n            target,\n            message,\n            gasLimit\n        );\n    }\n\n    /// ================================ zkEVM ================================\n\n    function sendMessageZkEVM(\n        address l1CrossDomain,\n        uint32 destinationNetworkId,\n        address destinationAddress,\n        bool forceUpdateGlobalExitRoot,\n        bytes memory metadata\n    ) internal {\n        ICrossDomainZkEVM(l1CrossDomain).bridgeMessage(\n            destinationNetworkId,\n            destinationAddress,\n            forceUpdateGlobalExitRoot,\n            metadata\n        );\n    }\n\n    function sendMessageZkEVM(\n        address destinationAddress,\n        bytes memory metadata\n    ) internal {\n        sendMessageZkEVM(\n            0x2a3DD3EB832aF982ec71669E178424b10Dca2EDe,\n            1,\n            destinationAddress,\n            true,\n            metadata\n        );\n    }\n\n}\n"
      },
      "src/AaveV3PayloadBase.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {Address} from './libraries/Address.sol';\nimport {IAaveV3ConfigEngine as IEngine} from './interfaces/IAaveV3ConfigEngine.sol';\nimport {IV3RateStrategyFactory as Rates} from './interfaces/IV3RateStrategyFactory.sol';\n\nlibrary EngineFlags {\n  /// @dev magic value to be used as flag to keep unchanged any current configuration\n  /// Strongly assumes that the value `type(uint256).max - 42` will never be used, which seems reasonable\n  uint256 internal constant KEEP_CURRENT = type(uint256).max - 42;\n\n  /// @dev value to be used as flag for bool value true\n  uint256 internal constant ENABLED = 1;\n\n  /// @dev value to be used as flag for bool value false\n  uint256 internal constant DISABLED = 0;\n\n  /// @dev converts flag ENABLED DISABLED to bool\n  function toBool(uint256 flag) internal pure returns (bool) {\n    require(flag == 0 || flag == 1, 'INVALID_CONVERSION_TO_BOOL');\n    return flag == 1;\n  }\n\n  /// @dev converts bool to ENABLED DISABLED flags\n  function fromBool(bool isTrue) internal pure returns (uint256) {\n    return isTrue ? ENABLED : DISABLED;\n  }\n}\n\n\n/**\n * @dev Base smart contract for an Aave v3.0.1 configs update.\n * - Assumes this contract has the right permissions\n * - Connected to a IAaveV3ConfigEngine engine contact, which abstract the complexities of\n *   interaction with the Aave protocol.\n * - At the moment covering:\n *   - Listings of new assets on the pool.\n *   - Updates of caps (supply cap, borrow cap).\n *   - Updates of price feeds\n *   - Updates of interest rate strategies.\n *   - Updates of borrow parameters (flashloanable, stableRateModeEnabled, borrowableInIsolation, withSiloedBorrowing, reserveFactor)\n *   - Updates of collateral parameters (ltv, liq threshold, liq bonus, liq protocol fee, debt ceiling)\n * @author BGD Labs\n */\nabstract contract AaveV3PayloadBase {\n  using Address for address;\n\n  IEngine public immutable LISTING_ENGINE;\n\n  constructor(IEngine engine) {\n    LISTING_ENGINE = engine;\n  }\n\n  /// @dev to be overriden on the child if any extra logic is needed pre-listing\n  function _preExecute() internal virtual {}\n\n  /// @dev to be overriden on the child if any extra logic is needed post-listing\n  function _postExecute() internal virtual {}\n\n  function execute() external {\n    _preExecute();\n\n    IEngine.Listing[] memory listings = newListings();\n    IEngine.ListingWithCustomImpl[] memory listingsCustom = newListingsCustom();\n    IEngine.CapsUpdate[] memory caps = capsUpdates();\n    IEngine.CollateralUpdate[] memory collaterals = collateralsUpdates();\n    IEngine.BorrowUpdate[] memory borrows = borrowsUpdates();\n    IEngine.PriceFeedUpdate[] memory priceFeeds = priceFeedsUpdates();\n    IEngine.RateStrategyUpdate[] memory rates = rateStrategiesUpdates();\n\n    if (listings.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.listAssets.selector, getPoolContext(), listings)\n      );\n    }\n\n    if (listingsCustom.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(\n          LISTING_ENGINE.listAssetsCustom.selector,\n          getPoolContext(),\n          listingsCustom\n        )\n      );\n    }\n\n    if (borrows.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.updateBorrowSide.selector, borrows)\n      );\n    }\n\n    if (collaterals.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.updateCollateralSide.selector, collaterals)\n      );\n    }\n\n    if (rates.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.updateRateStrategies.selector, rates)\n      );\n    }\n\n    if (priceFeeds.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.updatePriceFeeds.selector, priceFeeds)\n      );\n    }\n\n    if (caps.length != 0) {\n      address(LISTING_ENGINE).functionDelegateCall(\n        abi.encodeWithSelector(LISTING_ENGINE.updateCaps.selector, caps)\n      );\n    }\n\n    _postExecute();\n  }\n\n  /** @dev Converts basis points to RAY units\n   * e.g. 10_00 (10.00%) will return 100000000000000000000000000\n   */\n  function _bpsToRay(uint256 amount) internal pure returns (uint256) {\n    return (amount * 1e27) / 10_000;\n  }\n\n  /// @dev to be defined in the child with a list of new assets to list\n  function newListings() public view virtual returns (IEngine.Listing[] memory) {}\n\n  /// @dev to be defined in the child with a list of new assets to list (with custom a/v/s tokens implementations)\n  function newListingsCustom()\n    public\n    view\n    virtual\n    returns (IEngine.ListingWithCustomImpl[] memory)\n  {}\n\n  /// @dev to be defined in the child with a list of caps to update\n  function capsUpdates() public view virtual returns (IEngine.CapsUpdate[] memory) {}\n\n  /// @dev to be defined in the child with a list of collaterals' params to update\n  function collateralsUpdates() public view virtual returns (IEngine.CollateralUpdate[] memory) {}\n\n  /// @dev to be defined in the child with a list of borrows' params to update\n  function borrowsUpdates() public view virtual returns (IEngine.BorrowUpdate[] memory) {}\n\n  /// @dev to be defined in the child with a list of priceFeeds to update\n  function priceFeedsUpdates() public view virtual returns (IEngine.PriceFeedUpdate[] memory) {}\n\n  /// @dev to be defined in the child with a list of set of parameters of rate strategies\n  function rateStrategiesUpdates()\n    public\n    view\n    virtual\n    returns (IEngine.RateStrategyUpdate[] memory)\n  {}\n\n  /// @dev the lack of support for immutable strings kinds of forces for this\n  /// Besides that, it can actually be useful being able to change the naming, but remote\n  function getPoolContext() public view virtual returns (IEngine.PoolContext memory);\n}\n"
      },
      "lib/spark-address-registry/src/Ethereum.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-or-later\npragma solidity ^0.8.13;\n\nlibrary Ethereum {\n\n    /******************************************************************************************************************/\n    /*** Token Addresses                                                                                            ***/\n    /******************************************************************************************************************/\n\n    address internal constant DAI    = 0x6B175474E89094C44Da98b954EedeAC495271d0F;\n    address internal constant GNO    = 0x6810e776880C02933D47DB1b9fc05908e5386b96;\n    address internal constant MKR    = 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2;\n    address internal constant RETH   = 0xae78736Cd615f374D3085123A210448E74Fc6393;\n    address internal constant SDAI   = 0x83F20F44975D03b1b09e64809B757c47f942BEeA;\n    address internal constant SUSDE  = 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497;\n    address internal constant USDC   = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\n    address internal constant USDE   = 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3;\n    address internal constant USDT   = 0xdAC17F958D2ee523a2206206994597C13D831ec7;\n    address internal constant WBTC   = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;\n    address internal constant WETH   = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n    address internal constant WSTETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n\n    /******************************************************************************************************************/\n    /*** MakerDAO Addresses                                                                                         ***/\n    /******************************************************************************************************************/\n\n    address internal constant PAUSE_PROXY = 0xBE8E3e3618f7474F8cB1d074A26afFef007E98FB;\n    address internal constant POT         = 0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7;\n    address internal constant VAT         = 0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B;\n    address internal constant CHIEF       = 0x0a3f6849f78076aefaDf113F5BED87720274dDC0;\n\n    /******************************************************************************************************************/\n    /*** SparkDAO Addresses                                                                                         ***/\n    /******************************************************************************************************************/\n\n    address internal constant SPARK_PROXY = 0x3300f198988e4C9C63F75dF86De36421f06af8c4;\n\n    /******************************************************************************************************************/\n    /*** Morpho Addresses                                                                                           ***/\n    /******************************************************************************************************************/\n\n    address internal constant MORPHO_DEFAULT_IRM  = 0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC;\n    address internal constant MORPHO_SUSDE_ORACLE = 0x5D916980D5Ae1737a8330Bf24dF812b2911Aae25;\n    address internal constant MORPHO_USDE_ORACLE  = 0xaE4750d0813B5E37A51f7629beedd72AF1f9cA35;\n    address internal constant MORPHO_VAULT_DAI_1  = 0x73e65DBD630f90604062f6E02fAb9138e713edD9;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Core Protocol Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant AAVE_ORACLE                      = 0x8105f69D9C41644c6A0803fDA7D03Aa70996cFD9;\n    address internal constant ACL_MANAGER                      = 0xdA135Cd78A086025BcdC87B038a1C462032b510C;\n    address internal constant DAI_TREASURY                     = 0x856900aa78e856a5df1a2665eE3a66b2487cD68f;\n    address internal constant EMISSION_MANAGER                 = 0xf09e48dd4CA8e76F63a57ADd428bB06fee7932a4;\n    address internal constant INCENTIVES                       = 0x4370D3b6C9588E02ce9D22e684387859c7Ff5b34;\n    address internal constant POOL                             = 0xC13e21B648A5Ee794902342038FF3aDAB66BE987;\n    address internal constant POOL_ADDRESSES_PROVIDER          = 0x02C3eA4e34C0cBd694D2adFa2c690EECbC1793eE;\n    address internal constant POOL_ADDRESSES_PROVIDER_REGISTRY = 0x03cFa0C4622FF84E50E75062683F44c9587e6Cc1;\n    address internal constant POOL_CONFIGURATOR                = 0x542DBa469bdE58FAeE189ffB60C6b49CE60E0738;\n    address internal constant TREASURY                         = 0xb137E7d16564c81ae2b0C8ee6B55De81dd46ECe5;\n    address internal constant TREASURY_CONTROLLER              = 0x92eF091C5a1E01b3CE1ba0D0150C84412d818F7a;\n    address internal constant WETH_GATEWAY                     = 0xBD7D6a9ad7865463DE44B05F04559f65e3B11704;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Reserve Token Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant DAI_ATOKEN            = 0x4DEDf26112B3Ec8eC46e7E31EA5e123490B05B8B;\n    address internal constant DAI_STABLE_DEBT_TOKEN = 0xfe2B7a7F4cC0Fb76f7Fc1C6518D586F1e4559176;\n    address internal constant DAI_DEBT_TOKEN        = 0xf705d2B7e92B3F38e6ae7afaDAA2fEE110fE5914;\n\n    address internal constant GNO_ATOKEN            = 0x7b481aCC9fDADDc9af2cBEA1Ff2342CB1733E50F;\n    address internal constant GNO_STABLE_DEBT_TOKEN = 0xbf13910620722D4D4F8A03962894EB3335Bf4FaE;\n    address internal constant GNO_DEBT_TOKEN        = 0x57a2957651DA467fCD4104D749f2F3684784c25a;\n\n    address internal constant RETH_ATOKEN            = 0x9985dF20D7e9103ECBCeb16a84956434B6f06ae8;\n    address internal constant RETH_STABLE_DEBT_TOKEN = 0xa9a4037295Ea3a168DC3F65fE69FdA524d52b3e1;\n    address internal constant RETH_DEBT_TOKEN        = 0xBa2C8F2eA5B56690bFb8b709438F049e5Dd76B96;\n\n    address internal constant SDAI_ATOKEN            = 0x78f897F0fE2d3B5690EbAe7f19862DEacedF10a7;\n    address internal constant SDAI_STABLE_DEBT_TOKEN = 0xEc6C6aBEd4DC03299EFf82Ac8A0A83643d3cB335;\n    address internal constant SDAI_DEBT_TOKEN        = 0xaBc57081C04D921388240393ec4088Aa47c6832B;\n\n    address internal constant USDC_ATOKEN            = 0x377C3bd93f2a2984E1E7bE6A5C22c525eD4A4815;\n    address internal constant USDC_STABLE_DEBT_TOKEN = 0x887Ac022983Ff083AEb623923789052A955C6798;\n    address internal constant USDC_DEBT_TOKEN        = 0x7B70D04099CB9cfb1Db7B6820baDAfB4C5C70A67;\n\n    address internal constant USDT_ATOKEN            = 0xe7dF13b8e3d6740fe17CBE928C7334243d86c92f;\n    address internal constant USDT_STABLE_DEBT_TOKEN = 0x0Dae62F953Ceb2E969fB4dE85f3F9074fa920776;\n    address internal constant USDT_DEBT_TOKEN        = 0x529b6158d1D2992E3129F7C69E81a7c677dc3B12;\n\n    address internal constant WBTC_ATOKEN            = 0x4197ba364AE6698015AE5c1468f54087602715b2;\n    address internal constant WBTC_STABLE_DEBT_TOKEN = 0x4b29e6cBeE62935CfC92efcB3839eD2c2F35C1d9;\n    address internal constant WBTC_DEBT_TOKEN        = 0xf6fEe3A8aC8040C3d6d81d9A4a168516Ec9B51D2;\n\n    address internal constant WETH_ATOKEN            = 0x59cD1C87501baa753d0B5B5Ab5D8416A45cD71DB;\n    address internal constant WETH_STABLE_DEBT_TOKEN = 0x3c6b93D38ffA15ea995D1BC950d5D0Fa6b22bD05;\n    address internal constant WETH_DEBT_TOKEN        = 0x2e7576042566f8D6990e07A1B61Ad1efd86Ae70d;\n\n    address internal constant WSTETH_ATOKEN            = 0x12B54025C112Aa61fAce2CDB7118740875A566E9;\n    address internal constant WSTETH_STABLE_DEBT_TOKEN = 0x9832D969a0c8662D98fFf334A4ba7FeE62b109C2;\n    address internal constant WSTETH_DEBT_TOKEN        = 0xd5c3E3B566a42A6110513Ac7670C1a86D76E13E6;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Auxiliary Protocol Addresses                                                                   ***/\n    /******************************************************************************************************************/\n\n    address internal constant CAP_AUTOMATOR      = 0x2276f52afba7Cf2525fd0a050DF464AC8532d0ef;\n    address internal constant FREEZER_MOM        = 0xFA36c12Bc307b40c701D65d8FE8F88cCEdE2277a;\n    address internal constant KILL_SWITCH_ORACLE = 0x909A86f78e1cdEd68F9c2Fe2c9CD922c401abe82;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Emergency Spells                                                                               ***/\n    /******************************************************************************************************************/\n\n    address internal constant SPELL_FREEZE_ALL = 0xA67d62f75F8D11395eE120CA8390Ab3bF01f0b8A;\n    address internal constant SPELL_FREEZE_DAI = 0x0F9149c4d6018A5999AdA5b592E372845cfeC725;\n    address internal constant SPELL_PAUSE_ALL  = 0x216738c7B1E83cC1A1FFcD3433226B0a3B174484;\n    address internal constant SPELL_PAUSE_DAI  = 0x1B94E2F3818E1D657bE2A62D37560514b52DB17F;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Implementation Addresses                                                                       ***/\n    /******************************************************************************************************************/\n\n    address internal constant A_TOKEN_IMPL             = 0x6175ddEc3B9b38c88157C10A01ed4A3fa8639cC6;\n    address internal constant DAI_TREASURY_IMPL        = 0xF1E57711Eb5F897b415de1aEFCB64d9BAe58D312;\n    address internal constant INCENTIVES_IMPL          = 0x0ee554F6A1f7a4Cb4f82D4C124DdC2AD3E37fde1;\n    address internal constant POOL_CONFIGURATOR_IMPL   = 0xF7b656C95420194b79687fc86D965FB51DA4799F;\n    address internal constant POOL_IMPL                = 0xB40f6d584081ac2b0FD84C846dBa3C1417889304;\n    address internal constant STABLE_DEBT_TOKEN_IMPL   = 0x026a5B6114431d8F3eF2fA0E1B2EDdDccA9c540E;\n    address internal constant TREASURY_IMPL            = 0xF1E57711Eb5F897b415de1aEFCB64d9BAe58D312;\n    address internal constant VARIABLE_DEBT_TOKEN_IMPL = 0x86C71796CcDB31c3997F8Ec5C2E3dB3e9e40b985;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Config Engine Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant CONFIG_ENGINE             = 0x3254F7cd0565aA67eEdC86c2fB608BE48d5cCd78;\n    address internal constant PROXY_ADMIN               = 0x883A82BDd3d07ae6ACfD151020faD350df25087e;\n    address internal constant RATES_FACTORY             = 0xfE57e187EF6285e90d7049e6a21571aa47cF11a2;\n    address internal constant TRANSPARENT_PROXY_FACTORY = 0x777803CbDD89D5D5Bc1DdD2151B51b0B07F6bf37;\n\n    /******************************************************************************************************************/\n    /*** SparkLend - Data Provider Addresses                                                                        ***/\n    /******************************************************************************************************************/\n\n    address internal constant PROTOCOL_DATA_PROVIDER     = 0xFc21d6d146E6086B8359705C8b28512a983db0cb;\n    address internal constant UI_INCENTIVE_DATA_PROVIDER = 0xA7F8A757C4f7696c015B595F51B2901AC0121B18;\n    address internal constant UI_POOL_DATA_PROVIDER      = 0xF028c2F4b19898718fD0F77b9b881CbfdAa5e8Bb;\n    address internal constant WALLET_BALANCE_PROVIDER    = 0xd2AeF86F51F92E8e49F42454c287AE4879D1BeDc;\n\n}\n"
      },
      "lib/spark-gov-relay/src/interfaces/IL2BridgeExecutor.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\nimport { IExecutorBase } from './IExecutorBase.sol';\n\n/**\n * @title IL2BridgeExecutorBase\n * @author Aave\n * @notice Defines the basic interface for the L2BridgeExecutor abstract contract\n */\ninterface IL2BridgeExecutor is IExecutorBase {\n    error UnauthorizedEthereumExecutor();\n\n    /**\n     * @dev Emitted when the Ethereum Governance Executor is updated\n     * @param oldEthereumGovernanceExecutor The address of the old EthereumGovernanceExecutor\n     * @param newEthereumGovernanceExecutor The address of the new EthereumGovernanceExecutor\n     **/\n    event EthereumGovernanceExecutorUpdate(\n        address oldEthereumGovernanceExecutor,\n        address newEthereumGovernanceExecutor\n    );\n\n    /**\n     * @notice Queue an ActionsSet\n     * @dev If a signature is empty, calldata is used for the execution, calldata is appended to signature otherwise\n     * @param targets Array of targets to be called by the actions set\n     * @param values Array of values to pass in each call by the actions set\n     * @param signatures Array of function signatures to encode in each call by the actions (can be empty)\n     * @param calldatas Array of calldata to pass in each call by the actions set\n     * @param withDelegatecalls Array of whether to delegatecall for each call of the actions set\n     **/\n    function queue(\n        address[] memory targets,\n        uint256[] memory values,\n        string[] memory signatures,\n        bytes[] memory calldatas,\n        bool[] memory withDelegatecalls\n    ) external;\n\n    /**\n     * @notice Update the address of the Ethereum Governance Executor\n     * @param ethereumGovernanceExecutor The address of the new EthereumGovernanceExecutor\n     **/\n    function updateEthereumGovernanceExecutor(address ethereumGovernanceExecutor) external;\n\n    /**\n     * @notice Returns the address of the Ethereum Governance Executor\n     * @return The address of the EthereumGovernanceExecutor\n     **/\n    function getEthereumGovernanceExecutor() external view returns (address);\n}\n"
      },
      "src/libraries/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\n// From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/8b778fa20d6d76340c5fac1ed66c80273f05b95a\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n  /**\n   * @dev Returns true if `account` is a contract.\n   *\n   * [IMPORTANT]\n   * ====\n   * It is unsafe to assume that an address for which this function returns\n   * false is an externally-owned account (EOA) and not a contract.\n   *\n   * Among others, `isContract` will return false for the following\n   * types of addresses:\n   *\n   *  - an externally-owned account\n   *  - a contract in construction\n   *  - an address where a contract will be created\n   *  - an address where a contract lived, but was destroyed\n   * ====\n   *\n   * [IMPORTANT]\n   * ====\n   * You shouldn't rely on `isContract` to protect against flash loan attacks!\n   *\n   * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n   * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n   * constructor.\n   * ====\n   */\n  function isContract(address account) internal view returns (bool) {\n    // This method relies on extcodesize/address.code.length, which returns 0\n    // for contracts in construction, since the code is only stored at the end\n    // of the constructor execution.\n\n    return account.code.length > 0;\n  }\n\n  /**\n   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n   * `recipient`, forwarding all available gas and reverting on errors.\n   *\n   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n   * of certain opcodes, possibly making contracts go over the 2300 gas limit\n   * imposed by `transfer`, making them unable to receive funds via\n   * `transfer`. {sendValue} removes this limitation.\n   *\n   * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n   *\n   * IMPORTANT: because control is transferred to `recipient`, care must be\n   * taken to not create reentrancy vulnerabilities. Consider using\n   * {ReentrancyGuard} or the\n   * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n   */\n  function sendValue(address payable recipient, uint256 amount) internal {\n    require(address(this).balance >= amount, 'Address: insufficient balance');\n\n    (bool success, ) = recipient.call{value: amount}('');\n    require(success, 'Address: unable to send value, recipient may have reverted');\n  }\n\n  /**\n   * @dev Performs a Solidity function call using a low level `call`. A\n   * plain `call` is an unsafe replacement for a function call: use this\n   * function instead.\n   *\n   * If `target` reverts with a revert reason, it is bubbled up by this\n   * function (like regular Solidity function calls).\n   *\n   * Returns the raw returned data. To convert to the expected return value,\n   * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n   *\n   * Requirements:\n   *\n   * - `target` must be a contract.\n   * - calling `target` with `data` must not revert.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n    return functionCallWithValue(target, data, 0, 'Address: low-level call failed');\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n   * `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    return functionCallWithValue(target, data, 0, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but also transferring `value` wei to `target`.\n   *\n   * Requirements:\n   *\n   * - the calling contract must have an ETH balance of at least `value`.\n   * - the called Solidity function must be `payable`.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value\n  ) internal returns (bytes memory) {\n    return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n   * with `errorMessage` as a fallback revert reason when `target` reverts.\n   *\n   * _Available since v3.1._\n   */\n  function functionCallWithValue(\n    address target,\n    bytes memory data,\n    uint256 value,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    require(address(this).balance >= value, 'Address: insufficient balance for call');\n    (bool success, bytes memory returndata) = target.call{value: value}(data);\n    return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(address target, bytes memory data)\n    internal\n    view\n    returns (bytes memory)\n  {\n    return functionStaticCall(target, data, 'Address: low-level static call failed');\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a static call.\n   *\n   * _Available since v3.3._\n   */\n  function functionStaticCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.staticcall(data);\n    return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n    return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n  }\n\n  /**\n   * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n   * but performing a delegate call.\n   *\n   * _Available since v3.4._\n   */\n  function functionDelegateCall(\n    address target,\n    bytes memory data,\n    string memory errorMessage\n  ) internal returns (bytes memory) {\n    (bool success, bytes memory returndata) = target.delegatecall(data);\n    return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n  }\n\n  /**\n   * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n   * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n   *\n   * _Available since v4.8._\n   */\n  function verifyCallResultFromTarget(\n    address target,\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal view returns (bytes memory) {\n    if (success) {\n      if (returndata.length == 0) {\n        // only check isContract if the call was successful and the return data is empty\n        // otherwise we already know that it was a contract\n        require(isContract(target), 'Address: call to non-contract');\n      }\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  /**\n   * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n   * revert reason or using the provided one.\n   *\n   * _Available since v4.3._\n   */\n  function verifyCallResult(\n    bool success,\n    bytes memory returndata,\n    string memory errorMessage\n  ) internal pure returns (bytes memory) {\n    if (success) {\n      return returndata;\n    } else {\n      _revert(returndata, errorMessage);\n    }\n  }\n\n  function _revert(bytes memory returndata, string memory errorMessage) private pure {\n    // Look for revert reason and bubble it up if present\n    if (returndata.length > 0) {\n      // The easiest way to bubble the revert reason is using memory via assembly\n      /// @solidity memory-safe-assembly\n      assembly {\n        let returndata_size := mload(returndata)\n        revert(add(32, returndata), returndata_size)\n      }\n    } else {\n      revert(errorMessage);\n    }\n  }\n}\n"
      },
      "src/interfaces/IAaveV3ConfigEngine.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {IPool} from 'sparklend-v1-core/contracts/interfaces/IPool.sol';\nimport {IPoolConfigurator} from 'sparklend-v1-core/contracts/interfaces/IPoolConfigurator.sol';\nimport {IAaveOracle} from 'sparklend-v1-core/contracts/interfaces/IAaveOracle.sol';\nimport {IV3RateStrategyFactory} from './IV3RateStrategyFactory.sol';\n\n/// @dev Examples here assume the usage of the `AaveV3PayloadBase` base contracts\n/// contained in this same repository\ninterface IAaveV3ConfigEngine {\n  /**\n   * @dev Required for naming of a/v/s tokens\n   * Example (mock):\n   * PoolContext({\n   *   networkName: 'Polygon',\n   *   networkAbbreviation: 'Pol'\n   * })\n   */\n  struct PoolContext {\n    string networkName;\n    string networkAbbreviation;\n  }\n\n  /**\n   * @dev Example (mock):\n   * Listing({\n   *   asset: 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9,\n   *   assetSymbol: 'AAVE',\n   *   priceFeed: 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9,\n   *   rateStrategyParams: Rates.RateStrategyParams({\n   *     optimalUsageRatio: _bpsToRay(80_00),\n   *     baseVariableBorrowRate: _bpsToRay(25), // 0.25%\n   *     variableRateSlope1: _bpsToRay(3_00),\n   *     variableRateSlope2: _bpsToRay(75_00),\n   *     stableRateSlope1: _bpsToRay(3_00),\n   *     stableRateSlope2: _bpsToRay(75_00),\n   *     baseStableRateOffset: _bpsToRay(2_00),\n   *     stableRateExcessOffset: _bpsToRay(3_00),\n   *     optimalStableToTotalDebtRatio: _bpsToRay(30_00)\n   *   }),\n   *   enabledToBorrow: EngineFlags.ENABLED,\n   *   flashloanable: EngineFlags.ENABLED,\n   *   stableRateModeEnabled: EngineFlags.DISABLED,\n   *   borrowableInIsolation: EngineFlags.ENABLED,\n   *   withSiloedBorrowing:, EngineFlags.DISABLED,\n   *   ltv: 70_50, // 70.5%\n   *   liqThreshold: 76_00, // 76%\n   *   liqBonus: 5_00, // 5%\n   *   reserveFactor: 10_00, // 10%\n   *   supplyCap: 100_000, // 100k AAVE\n   *   borrowCap: 60_000, // 60k AAVE\n   *   debtCeiling: 100_000, // 100k USD\n   *   liqProtocolFee: 10_00, // 10%\n   *   eModeCategory: 0, // No category\n   * }\n   */\n  struct Listing {\n    address asset;\n    string assetSymbol;\n    address priceFeed;\n    IV3RateStrategyFactory.RateStrategyParams rateStrategyParams; // Mandatory, no matter if enabled for borrowing or not\n    uint256 enabledToBorrow;\n    uint256 stableRateModeEnabled; // Only considered is enabledToBorrow == EngineFlags.ENABLED (true)\n    uint256 borrowableInIsolation; // Only considered is enabledToBorrow == EngineFlags.ENABLED (true)\n    uint256 withSiloedBorrowing; // Only considered if enabledToBorrow == EngineFlags.ENABLED (true)\n    uint256 flashloanable; // Independent from enabled to borrow: an asset can be flashloanble and not enabled to borrow\n    uint256 ltv; // Only considered if liqThreshold > 0\n    uint256 liqThreshold; // If `0`, the asset will not be enabled as collateral\n    uint256 liqBonus; // Only considered if liqThreshold > 0\n    uint256 reserveFactor; // Only considered if enabledToBorrow == EngineFlags.ENABLED (true)\n    uint256 supplyCap; // If passing any value distinct to EngineFlags.KEEP_CURRENT, always configured\n    uint256 borrowCap; // If passing any value distinct to EngineFlags.KEEP_CURRENT, always configured\n    uint256 debtCeiling; // Only considered if liqThreshold > 0\n    uint256 liqProtocolFee; // Only considered if liqThreshold > 0\n    uint8 eModeCategory; // If `O`, no eMode category will be set\n  }\n\n  struct TokenImplementations {\n    address aToken;\n    address vToken;\n    address sToken;\n  }\n\n  struct ListingWithCustomImpl {\n    Listing base;\n    TokenImplementations implementations;\n  }\n\n  /**\n   * @dev Example (mock):\n   * CapsUpdate({\n   *   asset: AaveV3EthereumAssets.AAVE_UNDERLYING,\n   *   supplyCap: 1_000_000,\n   *   borrowCap: EngineFlags.KEEP_CURRENT\n   * }\n   */\n  struct CapsUpdate {\n    address asset;\n    uint256 supplyCap; // Pass any value, of EngineFlags.KEEP_CURRENT to keep it as it is\n    uint256 borrowCap; // Pass any value, of EngineFlags.KEEP_CURRENT to keep it as it is\n  }\n\n  /**\n   * @dev Example (mock):\n   * PriceFeedUpdate({\n   *   asset: AaveV3EthereumAssets.AAVE_UNDERLYING,\n   *   priceFeed: 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9\n   * })\n   */\n  struct PriceFeedUpdate {\n    address asset;\n    address priceFeed;\n  }\n\n  /**\n   * @dev Example (mock):\n   * CollateralUpdate({\n   *   asset: AaveV3EthereumAssets.AAVE_UNDERLYING,\n   *   ltv: 60_00,\n   *   liqThreshold: 70_00,\n   *   liqBonus: EngineFlags.KEEP_CURRENT,\n   *   debtCeiling: EngineFlags.KEEP_CURRENT,\n   *   liqProtocolFee: 7_00,\n   *   eModeCategory: EngineFlags.KEEP_CURRENT\n   * })\n   */\n  struct CollateralUpdate {\n    address asset;\n    uint256 ltv;\n    uint256 liqThreshold;\n    uint256 liqBonus;\n    uint256 debtCeiling;\n    uint256 liqProtocolFee;\n    uint256 eModeCategory;\n  }\n\n  /**\n   * @dev Example (mock):\n   * BorrowUpdate({\n   *   asset: AaveV3EthereumAssets.AAVE_UNDERLYING,\n   *   enabledToBorrow: EngineFlags.ENABLED,\n   *   flashloanable: EngineFlags.KEEP_CURRENT,\n   *   stableRateModeEnabled: EngineFlags.KEEP_CURRENT,\n   *   borrowableInIsolation: EngineFlags.KEEP_CURRENT,\n   *   withSiloedBorrowing: EngineFlags.KEEP_CURRENT,\n   *   reserveFactor: 15_00, // 15%\n   * })\n   */\n  struct BorrowUpdate {\n    address asset;\n    uint256 enabledToBorrow;\n    uint256 flashloanable;\n    uint256 stableRateModeEnabled;\n    uint256 borrowableInIsolation;\n    uint256 withSiloedBorrowing;\n    uint256 reserveFactor;\n  }\n\n  /**\n   * @dev Example (mock):\n   * RateStrategyUpdate({\n   *   asset: AaveV3OptimismAssets.USDT_UNDERLYING,\n   *   params: Rates.RateStrategyParams({\n   *     optimalUsageRatio: _bpsToRay(80_00),\n   *     baseVariableBorrowRate: EngineFlags.KEEP_CURRENT,\n   *     variableRateSlope1: EngineFlags.KEEP_CURRENT,\n   *     variableRateSlope2: _bpsToRay(75_00),\n   *     stableRateSlope1: EngineFlags.KEEP_CURRENT,\n   *     stableRateSlope2: _bpsToRay(75_00),\n   *     baseStableRateOffset: EngineFlags.KEEP_CURRENT,\n   *     stableRateExcessOffset: EngineFlags.KEEP_CURRENT,\n   *     optimalStableToTotalDebtRatio: EngineFlags.KEEP_CURRENT\n   *   })\n   * })\n   */\n  struct RateStrategyUpdate {\n    address asset;\n    IV3RateStrategyFactory.RateStrategyParams params;\n  }\n\n  /**\n   * @notice Performs full listing of the assets, in the Aave pool configured in this engine instance\n   * @param context `PoolContext` struct, effectively meta-data for naming of a/v/s tokens.\n   *   More information on the documentation of the struct.\n   * @param listings `Listing[]` list of declarative configs for every aspect of the asset listings.\n   *   More information on the documentation of the struct.\n   */\n  function listAssets(PoolContext memory context, Listing[] memory listings) external;\n\n  /**\n   * @notice Performs full listings of assets, in the Aave pool configured in this engine instance\n   * @dev This function allows more customization, especifically enables to set custom implementations\n   *   for a/v/s tokens.\n   *   IMPORTANT. Use it only if understanding the internals of the Aave v3 protocol\n   * @param context `PoolContext` struct, effectively meta-data for naming of a/v/s tokens.\n   *   More information on the documentation of the struct.\n   * @param listings `ListingWithCustomImpl[]` list of declarative configs for every aspect of the asset listings.\n   */\n  function listAssetsCustom(\n    PoolContext memory context,\n    ListingWithCustomImpl[] memory listings\n  ) external;\n\n  /**\n   * @notice Performs an update of the caps (supply, borrow) of the assets, in the Aave pool configured in this engine instance\n   * @param updates `CapsUpdate[]` list of declarative updates containing the new caps\n   *   More information on the documentation of the struct.\n   */\n  function updateCaps(CapsUpdate[] memory updates) external;\n\n  /**\n   * @notice Performs an update on the rate strategy params of the assets, in the Aave pool configured in this engine instance\n   * @dev The engine itself manages if a new rate strategy needs to be deployed or if an existing one can be re-used\n   * @param updates `RateStrategyUpdate[]` list of declarative updates containing the new rate strategy params\n   *   More information on the documentation of the struct.\n   */\n  function updateRateStrategies(RateStrategyUpdate[] memory updates) external;\n\n  /**\n   * @notice Performs an update of the collateral-related params of the assets, in the Aave pool configured in this engine instance\n   * @param updates `CollateralUpdate[]` list of declarative updates containing the new parameters\n   *   More information on the documentation of the struct.\n   */\n  function updateCollateralSide(CollateralUpdate[] memory updates) external;\n\n  /**\n   * @notice Performs an update of the price feed of the assets, in the Aave pool configured in this engine instance\n   * @param updates `PriceFeedUpdate[]` list of declarative updates containing the new parameters\n   *   More information on the documentation of the struct.\n   */\n  function updatePriceFeeds(PriceFeedUpdate[] memory updates) external;\n\n  /**\n   * @notice Performs an update of the borrow-related params of the assets, in the Aave pool configured in this engine instance\n   * @param updates `BorrowUpdate[]` list of declarative updates containing the new parameters\n   *   More information on the documentation of the struct.\n   */\n  function updateBorrowSide(BorrowUpdate[] memory updates) external;\n\n  function RATE_STRATEGIES_FACTORY() external view returns (IV3RateStrategyFactory);\n\n  function POOL() external view returns (IPool);\n\n  function POOL_CONFIGURATOR() external view returns (IPoolConfigurator);\n\n  function ORACLE() external view returns (IAaveOracle);\n\n  function ATOKEN_IMPL() external view returns (address);\n\n  function VTOKEN_IMPL() external view returns (address);\n\n  function STOKEN_IMPL() external view returns (address);\n\n  function REWARDS_CONTROLLER() external view returns (address);\n\n  function COLLECTOR() external view returns (address);\n}\n"
      },
      "src/interfaces/IV3RateStrategyFactory.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from 'sparklend-v1-core/contracts/interfaces/IPoolAddressesProvider.sol';\nimport {IDefaultInterestRateStrategy} from 'sparklend-v1-core/contracts/interfaces/IDefaultInterestRateStrategy.sol';\n\ninterface IV3RateStrategyFactory {\n  event RateStrategyCreated(\n    address indexed strategy,\n    bytes32 indexed hashedParam,\n    RateStrategyParams params\n  );\n\n  /// @dev same parameters and the ones received on the constructor of DefaultReserveInterestRateStrategy\n  /// in practise defining the strategy itself\n  struct RateStrategyParams {\n    uint256 optimalUsageRatio;\n    uint256 baseVariableBorrowRate;\n    uint256 variableRateSlope1;\n    uint256 variableRateSlope2;\n    uint256 stableRateSlope1;\n    uint256 stableRateSlope2;\n    uint256 baseStableRateOffset;\n    uint256 stableRateExcessOffset;\n    uint256 optimalStableToTotalDebtRatio;\n  }\n\n  /**\n   * @notice Create new rate strategies from a list of parameters\n   * @dev If a strategy with exactly the same `RateStrategyParams` already exists, no creation happens but\n   *  its address is returned\n   * @param params `RateStrategyParams[]` list of parameters for multiple strategies\n   * @return address[] list of strategies\n   */\n  function createStrategies(RateStrategyParams[] memory params) external returns (address[] memory);\n\n  /**\n   * @notice Returns the identifier of a rate strategy from its parameters\n   * @param params `RateStrategyParams` the parameters of the rate strategy\n   * @return bytes32 the keccak256 hash generated from the `RateStrategyParams` parameters\n   *   to be used as identifier of the rate strategy on the factory\n   */\n  function strategyHashFromParams(RateStrategyParams memory params) external pure returns (bytes32);\n\n  /**\n   * @notice Returns all the strategies registered in the factory\n   * @return address[] list of strategies\n   */\n  function getAllStrategies() external view returns (address[] memory);\n\n  /**\n   * @notice Returns the a strategy added, given its parameters.\n   * @dev Only if the strategy is registered in the factory.\n   * @param params `RateStrategyParams` the parameters of the rate strategy\n   * @return address the address of the strategy\n   */\n  function getStrategyByParams(RateStrategyParams memory params) external view returns (address);\n\n  /**\n   * @notice From an asset in the Aave v3 pool, returns exclusively its parameters\n   * @param asset The address of the asset\n   * @return RateStrategyParams The parameters or the strategy, or empty RateStrategyParams struct\n   */\n  function getStrategyDataOfAsset(address asset) external view returns (RateStrategyParams memory);\n\n  /**\n   * @notice From a rate strategy address, returns its parameters\n   * @param strategy The address of the rate strategy\n   * @return RateStrategyParams Struct with the parameters of the strategy\n   */\n  function getStrategyData(\n    IDefaultInterestRateStrategy strategy\n  ) external view returns (RateStrategyParams memory);\n\n  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n}\n"
      },
      "lib/spark-gov-relay/src/interfaces/IExecutorBase.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.10;\n\n/**\n * @title IExecutorBase\n * @author Aave\n * @notice Defines the basic interface for the ExecutorBase abstract contract\n */\ninterface IExecutorBase {\n    error InvalidInitParams();\n    error NotGuardian();\n    error OnlyCallableByThis();\n    error MinimumDelayTooLong();\n    error MaximumDelayTooShort();\n    error GracePeriodTooShort();\n    error DelayShorterThanMin();\n    error DelayLongerThanMax();\n    error OnlyQueuedActions();\n    error TimelockNotFinished();\n    error InvalidActionsSetId();\n    error EmptyTargets();\n    error InconsistentParamsLength();\n    error DuplicateAction();\n    error InsufficientBalance();\n    error FailedActionExecution();\n\n    /**\n     * @notice This enum contains all possible actions set states\n     */\n    enum ActionsSetState {\n        Queued,\n        Executed,\n        Canceled,\n        Expired\n    }\n\n    /**\n     * @notice This struct contains the data needed to execute a specified set of actions\n     * @param targets Array of targets to call\n     * @param values Array of values to pass in each call\n     * @param signatures Array of function signatures to encode in each call (can be empty)\n     * @param calldatas Array of calldatas to pass in each call, appended to the signature at the same array index if not empty\n     * @param withDelegateCalls Array of whether to delegatecall for each call\n     * @param executionTime Timestamp starting from which the actions set can be executed\n     * @param executed True if the actions set has been executed, false otherwise\n     * @param canceled True if the actions set has been canceled, false otherwise\n     */\n    struct ActionsSet {\n        address[] targets;\n        uint256[] values;\n        string[] signatures;\n        bytes[] calldatas;\n        bool[] withDelegatecalls;\n        uint256 executionTime;\n        bool executed;\n        bool canceled;\n    }\n\n    /**\n     * @dev Emitted when an ActionsSet is queued\n     * @param id Id of the ActionsSet\n     * @param targets Array of targets to be called by the actions set\n     * @param values Array of values to pass in each call by the actions set\n     * @param signatures Array of function signatures to encode in each call by the actions set\n     * @param calldatas Array of calldata to pass in each call by the actions set\n     * @param withDelegatecalls Array of whether to delegatecall for each call of the actions set\n     * @param executionTime The timestamp at which this actions set can be executed\n     **/\n    event ActionsSetQueued(\n        uint256 indexed id,\n        address[] targets,\n        uint256[] values,\n        string[] signatures,\n        bytes[] calldatas,\n        bool[] withDelegatecalls,\n        uint256 executionTime\n    );\n\n    /**\n     * @dev Emitted when an ActionsSet is successfully executed\n     * @param id Id of the ActionsSet\n     * @param initiatorExecution The address that triggered the ActionsSet execution\n     * @param returnedData The returned data from the ActionsSet execution\n     **/\n    event ActionsSetExecuted(\n        uint256 indexed id,\n        address indexed initiatorExecution,\n        bytes[] returnedData\n    );\n\n    /**\n     * @dev Emitted when an ActionsSet is cancelled by the guardian\n     * @param id Id of the ActionsSet\n     **/\n    event ActionsSetCanceled(uint256 indexed id);\n\n    /**\n     * @dev Emitted when a new guardian is set\n     * @param oldGuardian The address of the old guardian\n     * @param newGuardian The address of the new guardian\n     **/\n    event GuardianUpdate(address oldGuardian, address newGuardian);\n\n    /**\n     * @dev Emitted when the delay (between queueing and execution) is updated\n     * @param oldDelay The value of the old delay\n     * @param newDelay The value of the new delay\n     **/\n    event DelayUpdate(uint256 oldDelay, uint256 newDelay);\n\n    /**\n     * @dev Emitted when the grace period (between executionTime and expiration) is updated\n     * @param oldGracePeriod The value of the old grace period\n     * @param newGracePeriod The value of the new grace period\n     **/\n    event GracePeriodUpdate(uint256 oldGracePeriod, uint256 newGracePeriod);\n\n    /**\n     * @dev Emitted when the minimum delay (lower bound of delay) is updated\n     * @param oldMinimumDelay The value of the old minimum delay\n     * @param newMinimumDelay The value of the new minimum delay\n     **/\n    event MinimumDelayUpdate(uint256 oldMinimumDelay, uint256 newMinimumDelay);\n\n    /**\n     * @dev Emitted when the maximum delay (upper bound of delay)is updated\n     * @param oldMaximumDelay The value of the old maximum delay\n     * @param newMaximumDelay The value of the new maximum delay\n     **/\n    event MaximumDelayUpdate(uint256 oldMaximumDelay, uint256 newMaximumDelay);\n\n    /**\n     * @notice Execute the ActionsSet\n     * @param actionsSetId The id of the ActionsSet to execute\n     **/\n    function execute(uint256 actionsSetId) external payable;\n\n    /**\n     * @notice Cancel the ActionsSet\n     * @param actionsSetId The id of the ActionsSet to cancel\n     **/\n    function cancel(uint256 actionsSetId) external;\n\n    /**\n     * @notice Update guardian\n     * @param guardian The address of the new guardian\n     **/\n    function updateGuardian(address guardian) external;\n\n    /**\n     * @notice Update the delay, time between queueing and execution of ActionsSet\n     * @dev It does not affect to actions set that are already queued\n     * @param delay The value of the delay (in seconds)\n     **/\n    function updateDelay(uint256 delay) external;\n\n    /**\n     * @notice Update the grace period, the period after the execution time during which an actions set can be executed\n     * @param gracePeriod The value of the grace period (in seconds)\n     **/\n    function updateGracePeriod(uint256 gracePeriod) external;\n\n    /**\n     * @notice Update the minimum allowed delay\n     * @param minimumDelay The value of the minimum delay (in seconds)\n     **/\n    function updateMinimumDelay(uint256 minimumDelay) external;\n\n    /**\n     * @notice Update the maximum allowed delay\n     * @param maximumDelay The maximum delay (in seconds)\n     **/\n    function updateMaximumDelay(uint256 maximumDelay) external;\n\n    /**\n     * @notice Allows to delegatecall a given target with an specific amount of value\n     * @dev This function is external so it allows to specify a defined msg.value for the delegate call, reducing\n     * the risk that a delegatecall gets executed with more value than intended\n     * @return True if the delegate call was successful, false otherwise\n     * @return The bytes returned by the delegate call\n     **/\n    function executeDelegateCall(address target, bytes calldata data)\n        external\n        payable\n        returns (bool, bytes memory);\n\n    /**\n     * @notice Allows to receive funds into the executor\n     * @dev Useful for actionsSet that needs funds to gets executed\n     */\n    function receiveFunds() external payable;\n\n    /**\n     * @notice Returns the delay (between queuing and execution)\n     * @return The value of the delay (in seconds)\n     **/\n    function getDelay() external view returns (uint256);\n\n    /**\n     * @notice Returns the grace period\n     * @return The value of the grace period (in seconds)\n     **/\n    function getGracePeriod() external view returns (uint256);\n\n    /**\n     * @notice Returns the minimum delay\n     * @return The value of the minimum delay (in seconds)\n     **/\n    function getMinimumDelay() external view returns (uint256);\n\n    /**\n     * @notice Returns the maximum delay\n     * @return The value of the maximum delay (in seconds)\n     **/\n    function getMaximumDelay() external view returns (uint256);\n\n    /**\n     * @notice Returns the address of the guardian\n     * @return The address of the guardian\n     **/\n    function getGuardian() external view returns (address);\n\n    /**\n     * @notice Returns the total number of actions sets of the executor\n     * @return The number of actions sets\n     **/\n    function getActionsSetCount() external view returns (uint256);\n\n    /**\n     * @notice Returns the data of an actions set\n     * @param actionsSetId The id of the ActionsSet\n     * @return The data of the ActionsSet\n     **/\n    function getActionsSetById(uint256 actionsSetId) external view returns (ActionsSet memory);\n\n    /**\n     * @notice Returns the current state of an actions set\n     * @param actionsSetId The id of the ActionsSet\n     * @return The current state of theI ActionsSet\n     **/\n    function getCurrentState(uint256 actionsSetId) external view returns (ActionsSetState);\n\n    /**\n     * @notice Returns whether an actions set (by actionHash) is queued\n     * @dev actionHash = keccak256(abi.encode(target, value, signature, data, executionTime, withDelegatecall))\n     * @param actionHash hash of the action to be checked\n     * @return True if the underlying action of actionHash is queued, false otherwise\n     **/\n    function isActionQueued(bytes32 actionHash) external view returns (bool);\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IPool.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\nimport {DataTypes} from '../protocol/libraries/types/DataTypes.sol';\n\n/**\n * @title IPool\n * @author Aave\n * @notice Defines the basic interface for an Aave Pool.\n */\ninterface IPool {\n  /**\n   * @dev Emitted on mintUnbacked()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address initiating the supply\n   * @param onBehalfOf The beneficiary of the supplied assets, receiving the aTokens\n   * @param amount The amount of supplied assets\n   * @param referralCode The referral code used\n   */\n  event MintUnbacked(\n    address indexed reserve,\n    address user,\n    address indexed onBehalfOf,\n    uint256 amount,\n    uint16 indexed referralCode\n  );\n\n  /**\n   * @dev Emitted on backUnbacked()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param backer The address paying for the backing\n   * @param amount The amount added as backing\n   * @param fee The amount paid in fees\n   */\n  event BackUnbacked(address indexed reserve, address indexed backer, uint256 amount, uint256 fee);\n\n  /**\n   * @dev Emitted on supply()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address initiating the supply\n   * @param onBehalfOf The beneficiary of the supply, receiving the aTokens\n   * @param amount The amount supplied\n   * @param referralCode The referral code used\n   */\n  event Supply(\n    address indexed reserve,\n    address user,\n    address indexed onBehalfOf,\n    uint256 amount,\n    uint16 indexed referralCode\n  );\n\n  /**\n   * @dev Emitted on withdraw()\n   * @param reserve The address of the underlying asset being withdrawn\n   * @param user The address initiating the withdrawal, owner of aTokens\n   * @param to The address that will receive the underlying\n   * @param amount The amount to be withdrawn\n   */\n  event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);\n\n  /**\n   * @dev Emitted on borrow() and flashLoan() when debt needs to be opened\n   * @param reserve The address of the underlying asset being borrowed\n   * @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just\n   * initiator of the transaction on flashLoan()\n   * @param onBehalfOf The address that will be getting the debt\n   * @param amount The amount borrowed out\n   * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable\n   * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray\n   * @param referralCode The referral code used\n   */\n  event Borrow(\n    address indexed reserve,\n    address user,\n    address indexed onBehalfOf,\n    uint256 amount,\n    DataTypes.InterestRateMode interestRateMode,\n    uint256 borrowRate,\n    uint16 indexed referralCode\n  );\n\n  /**\n   * @dev Emitted on repay()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The beneficiary of the repayment, getting his debt reduced\n   * @param repayer The address of the user initiating the repay(), providing the funds\n   * @param amount The amount repaid\n   * @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly\n   */\n  event Repay(\n    address indexed reserve,\n    address indexed user,\n    address indexed repayer,\n    uint256 amount,\n    bool useATokens\n  );\n\n  /**\n   * @dev Emitted on swapBorrowRateMode()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address of the user swapping his rate mode\n   * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable\n   */\n  event SwapBorrowRateMode(\n    address indexed reserve,\n    address indexed user,\n    DataTypes.InterestRateMode interestRateMode\n  );\n\n  /**\n   * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets\n   * @param asset The address of the underlying asset of the reserve\n   * @param totalDebt The total isolation mode debt for the reserve\n   */\n  event IsolationModeTotalDebtUpdated(address indexed asset, uint256 totalDebt);\n\n  /**\n   * @dev Emitted when the user selects a certain asset category for eMode\n   * @param user The address of the user\n   * @param categoryId The category id\n   */\n  event UserEModeSet(address indexed user, uint8 categoryId);\n\n  /**\n   * @dev Emitted on setUserUseReserveAsCollateral()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address of the user enabling the usage as collateral\n   */\n  event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);\n\n  /**\n   * @dev Emitted on setUserUseReserveAsCollateral()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address of the user enabling the usage as collateral\n   */\n  event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);\n\n  /**\n   * @dev Emitted on rebalanceStableBorrowRate()\n   * @param reserve The address of the underlying asset of the reserve\n   * @param user The address of the user for which the rebalance has been executed\n   */\n  event RebalanceStableBorrowRate(address indexed reserve, address indexed user);\n\n  /**\n   * @dev Emitted on flashLoan()\n   * @param target The address of the flash loan receiver contract\n   * @param initiator The address initiating the flash loan\n   * @param asset The address of the asset being flash borrowed\n   * @param amount The amount flash borrowed\n   * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt\n   * @param premium The fee flash borrowed\n   * @param referralCode The referral code used\n   */\n  event FlashLoan(\n    address indexed target,\n    address initiator,\n    address indexed asset,\n    uint256 amount,\n    DataTypes.InterestRateMode interestRateMode,\n    uint256 premium,\n    uint16 indexed referralCode\n  );\n\n  /**\n   * @dev Emitted when a borrower is liquidated.\n   * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation\n   * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation\n   * @param user The address of the borrower getting liquidated\n   * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover\n   * @param liquidatedCollateralAmount The amount of collateral received by the liquidator\n   * @param liquidator The address of the liquidator\n   * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants\n   * to receive the underlying collateral asset directly\n   */\n  event LiquidationCall(\n    address indexed collateralAsset,\n    address indexed debtAsset,\n    address indexed user,\n    uint256 debtToCover,\n    uint256 liquidatedCollateralAmount,\n    address liquidator,\n    bool receiveAToken\n  );\n\n  /**\n   * @dev Emitted when the state of a reserve is updated.\n   * @param reserve The address of the underlying asset of the reserve\n   * @param liquidityRate The next liquidity rate\n   * @param stableBorrowRate The next stable borrow rate\n   * @param variableBorrowRate The next variable borrow rate\n   * @param liquidityIndex The next liquidity index\n   * @param variableBorrowIndex The next variable borrow index\n   */\n  event ReserveDataUpdated(\n    address indexed reserve,\n    uint256 liquidityRate,\n    uint256 stableBorrowRate,\n    uint256 variableBorrowRate,\n    uint256 liquidityIndex,\n    uint256 variableBorrowIndex\n  );\n\n  /**\n   * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest.\n   * @param reserve The address of the reserve\n   * @param amountMinted The amount minted to the treasury\n   */\n  event MintedToTreasury(address indexed reserve, uint256 amountMinted);\n\n  /**\n   * @notice Mints an `amount` of aTokens to the `onBehalfOf`\n   * @param asset The address of the underlying asset to mint\n   * @param amount The amount to mint\n   * @param onBehalfOf The address that will receive the aTokens\n   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   */\n  function mintUnbacked(\n    address asset,\n    uint256 amount,\n    address onBehalfOf,\n    uint16 referralCode\n  ) external;\n\n  /**\n   * @notice Back the current unbacked underlying with `amount` and pay `fee`.\n   * @param asset The address of the underlying asset to back\n   * @param amount The amount to back\n   * @param fee The amount paid in fees\n   * @return The backed amount\n   */\n  function backUnbacked(address asset, uint256 amount, uint256 fee) external returns (uint256);\n\n  /**\n   * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.\n   * - E.g. User supplies 100 USDC and gets in return 100 aUSDC\n   * @param asset The address of the underlying asset to supply\n   * @param amount The amount to be supplied\n   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n   *   is a different wallet\n   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   */\n  function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;\n\n  /**\n   * @notice Supply with transfer approval of asset to be supplied done via permit function\n   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713\n   * @param asset The address of the underlying asset to supply\n   * @param amount The amount to be supplied\n   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n   *   is a different wallet\n   * @param deadline The deadline timestamp that the permit is valid\n   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   * @param permitV The V parameter of ERC712 permit sig\n   * @param permitR The R parameter of ERC712 permit sig\n   * @param permitS The S parameter of ERC712 permit sig\n   */\n  function supplyWithPermit(\n    address asset,\n    uint256 amount,\n    address onBehalfOf,\n    uint16 referralCode,\n    uint256 deadline,\n    uint8 permitV,\n    bytes32 permitR,\n    bytes32 permitS\n  ) external;\n\n  /**\n   * @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned\n   * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC\n   * @param asset The address of the underlying asset to withdraw\n   * @param amount The underlying amount to be withdrawn\n   *   - Send the value type(uint256).max in order to withdraw the whole aToken balance\n   * @param to The address that will receive the underlying, same as msg.sender if the user\n   *   wants to receive it on his own wallet, or a different address if the beneficiary is a\n   *   different wallet\n   * @return The final amount withdrawn\n   */\n  function withdraw(address asset, uint256 amount, address to) external returns (uint256);\n\n  /**\n   * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower\n   * already supplied enough collateral, or he was given enough allowance by a credit delegator on the\n   * corresponding debt token (StableDebtToken or VariableDebtToken)\n   * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet\n   *   and 100 stable/variable debt tokens, depending on the `interestRateMode`\n   * @param asset The address of the underlying asset to borrow\n   * @param amount The amount to be borrowed\n   * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable\n   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself\n   * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator\n   * if he has been given credit delegation allowance\n   */\n  function borrow(\n    address asset,\n    uint256 amount,\n    uint256 interestRateMode,\n    uint16 referralCode,\n    address onBehalfOf\n  ) external;\n\n  /**\n   * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned\n   * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address\n   * @param asset The address of the borrowed underlying asset previously borrowed\n   * @param amount The amount to repay\n   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n   * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the\n   * user calling the function if he wants to reduce/remove his own debt, or the address of any other\n   * other borrower whose debt should be removed\n   * @return The final amount repaid\n   */\n  function repay(\n    address asset,\n    uint256 amount,\n    uint256 interestRateMode,\n    address onBehalfOf\n  ) external returns (uint256);\n\n  /**\n   * @notice Repay with transfer approval of asset to be repaid done via permit function\n   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713\n   * @param asset The address of the borrowed underlying asset previously borrowed\n   * @param amount The amount to repay\n   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n   * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the\n   * user calling the function if he wants to reduce/remove his own debt, or the address of any other\n   * other borrower whose debt should be removed\n   * @param deadline The deadline timestamp that the permit is valid\n   * @param permitV The V parameter of ERC712 permit sig\n   * @param permitR The R parameter of ERC712 permit sig\n   * @param permitS The S parameter of ERC712 permit sig\n   * @return The final amount repaid\n   */\n  function repayWithPermit(\n    address asset,\n    uint256 amount,\n    uint256 interestRateMode,\n    address onBehalfOf,\n    uint256 deadline,\n    uint8 permitV,\n    bytes32 permitR,\n    bytes32 permitS\n  ) external returns (uint256);\n\n  /**\n   * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the\n   * equivalent debt tokens\n   * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens\n   * @dev  Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken\n   * balance is not enough to cover the whole debt\n   * @param asset The address of the borrowed underlying asset previously borrowed\n   * @param amount The amount to repay\n   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n   * @return The final amount repaid\n   */\n  function repayWithATokens(\n    address asset,\n    uint256 amount,\n    uint256 interestRateMode\n  ) external returns (uint256);\n\n  /**\n   * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa\n   * @param asset The address of the underlying asset borrowed\n   * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable\n   */\n  function swapBorrowRateMode(address asset, uint256 interestRateMode) external;\n\n  /**\n   * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.\n   * - Users can be rebalanced if the following conditions are satisfied:\n   *     1. Usage ratio is above 95%\n   *     2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too\n   *        much has been borrowed at a stable rate and suppliers are not earning enough\n   * @param asset The address of the underlying asset borrowed\n   * @param user The address of the user to be rebalanced\n   */\n  function rebalanceStableBorrowRate(address asset, address user) external;\n\n  /**\n   * @notice Allows suppliers to enable/disable a specific supplied asset as collateral\n   * @param asset The address of the underlying asset supplied\n   * @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise\n   */\n  function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;\n\n  /**\n   * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1\n   * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives\n   *   a proportionally amount of the `collateralAsset` plus a bonus to cover market risk\n   * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation\n   * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation\n   * @param user The address of the borrower getting liquidated\n   * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover\n   * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants\n   * to receive the underlying collateral asset directly\n   */\n  function liquidationCall(\n    address collateralAsset,\n    address debtAsset,\n    address user,\n    uint256 debtToCover,\n    bool receiveAToken\n  ) external;\n\n  /**\n   * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,\n   * as long as the amount taken plus a fee is returned.\n   * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept\n   * into consideration. For further details please visit https://docs.aave.com/developers/\n   * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface\n   * @param assets The addresses of the assets being flash-borrowed\n   * @param amounts The amounts of the assets being flash-borrowed\n   * @param interestRateModes Types of the debt to open if the flash loan is not returned:\n   *   0 -> Don't open any debt, just revert if funds can't be transferred from the receiver\n   *   1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address\n   *   2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address\n   * @param onBehalfOf The address  that will receive the debt in the case of using on `modes` 1 or 2\n   * @param params Variadic packed params to pass to the receiver as extra information\n   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   */\n  function flashLoan(\n    address receiverAddress,\n    address[] calldata assets,\n    uint256[] calldata amounts,\n    uint256[] calldata interestRateModes,\n    address onBehalfOf,\n    bytes calldata params,\n    uint16 referralCode\n  ) external;\n\n  /**\n   * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,\n   * as long as the amount taken plus a fee is returned.\n   * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept\n   * into consideration. For further details please visit https://docs.aave.com/developers/\n   * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface\n   * @param asset The address of the asset being flash-borrowed\n   * @param amount The amount of the asset being flash-borrowed\n   * @param params Variadic packed params to pass to the receiver as extra information\n   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   */\n  function flashLoanSimple(\n    address receiverAddress,\n    address asset,\n    uint256 amount,\n    bytes calldata params,\n    uint16 referralCode\n  ) external;\n\n  /**\n   * @notice Returns the user account data across all the reserves\n   * @param user The address of the user\n   * @return totalCollateralBase The total collateral of the user in the base currency used by the price feed\n   * @return totalDebtBase The total debt of the user in the base currency used by the price feed\n   * @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed\n   * @return currentLiquidationThreshold The liquidation threshold of the user\n   * @return ltv The loan to value of The user\n   * @return healthFactor The current health factor of the user\n   */\n  function getUserAccountData(\n    address user\n  )\n    external\n    view\n    returns (\n      uint256 totalCollateralBase,\n      uint256 totalDebtBase,\n      uint256 availableBorrowsBase,\n      uint256 currentLiquidationThreshold,\n      uint256 ltv,\n      uint256 healthFactor\n    );\n\n  /**\n   * @notice Initializes a reserve, activating it, assigning an aToken and debt tokens and an\n   * interest rate strategy\n   * @dev Only callable by the PoolConfigurator contract\n   * @param asset The address of the underlying asset of the reserve\n   * @param aTokenAddress The address of the aToken that will be assigned to the reserve\n   * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve\n   * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve\n   * @param interestRateStrategyAddress The address of the interest rate strategy contract\n   */\n  function initReserve(\n    address asset,\n    address aTokenAddress,\n    address stableDebtAddress,\n    address variableDebtAddress,\n    address interestRateStrategyAddress\n  ) external;\n\n  /**\n   * @notice Drop a reserve\n   * @dev Only callable by the PoolConfigurator contract\n   * @param asset The address of the underlying asset of the reserve\n   */\n  function dropReserve(address asset) external;\n\n  /**\n   * @notice Updates the address of the interest rate strategy contract\n   * @dev Only callable by the PoolConfigurator contract\n   * @param asset The address of the underlying asset of the reserve\n   * @param rateStrategyAddress The address of the interest rate strategy contract\n   */\n  function setReserveInterestRateStrategyAddress(\n    address asset,\n    address rateStrategyAddress\n  ) external;\n\n  /**\n   * @notice Sets the configuration bitmap of the reserve as a whole\n   * @dev Only callable by the PoolConfigurator contract\n   * @param asset The address of the underlying asset of the reserve\n   * @param configuration The new configuration bitmap\n   */\n  function setConfiguration(\n    address asset,\n    DataTypes.ReserveConfigurationMap calldata configuration\n  ) external;\n\n  /**\n   * @notice Returns the configuration of the reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @return The configuration of the reserve\n   */\n  function getConfiguration(\n    address asset\n  ) external view returns (DataTypes.ReserveConfigurationMap memory);\n\n  /**\n   * @notice Returns the configuration of the user across all the reserves\n   * @param user The user address\n   * @return The configuration of the user\n   */\n  function getUserConfiguration(\n    address user\n  ) external view returns (DataTypes.UserConfigurationMap memory);\n\n  /**\n   * @notice Returns the normalized income of the reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @return The reserve's normalized income\n   */\n  function getReserveNormalizedIncome(address asset) external view returns (uint256);\n\n  /**\n   * @notice Returns the normalized variable debt per unit of asset\n   * @dev WARNING: This function is intended to be used primarily by the protocol itself to get a\n   * \"dynamic\" variable index based on time, current stored index and virtual rate at the current\n   * moment (approx. a borrower would get if opening a position). This means that is always used in\n   * combination with variable debt supply/balances.\n   * If using this function externally, consider that is possible to have an increasing normalized\n   * variable debt that is not equivalent to how the variable debt index would be updated in storage\n   * (e.g. only updates with non-zero variable debt supply)\n   * @param asset The address of the underlying asset of the reserve\n   * @return The reserve normalized variable debt\n   */\n  function getReserveNormalizedVariableDebt(address asset) external view returns (uint256);\n\n  /**\n   * @notice Returns the state and configuration of the reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @return The state and configuration data of the reserve\n   */\n  function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);\n\n  /**\n   * @notice Validates and finalizes an aToken transfer\n   * @dev Only callable by the overlying aToken of the `asset`\n   * @param asset The address of the underlying asset of the aToken\n   * @param from The user from which the aTokens are transferred\n   * @param to The user receiving the aTokens\n   * @param amount The amount being transferred/withdrawn\n   * @param balanceFromBefore The aToken balance of the `from` user before the transfer\n   * @param balanceToBefore The aToken balance of the `to` user before the transfer\n   */\n  function finalizeTransfer(\n    address asset,\n    address from,\n    address to,\n    uint256 amount,\n    uint256 balanceFromBefore,\n    uint256 balanceToBefore\n  ) external;\n\n  /**\n   * @notice Returns the list of the underlying assets of all the initialized reserves\n   * @dev It does not include dropped reserves\n   * @return The addresses of the underlying assets of the initialized reserves\n   */\n  function getReservesList() external view returns (address[] memory);\n\n  /**\n   * @notice Returns the number of initialized reserves\n   * @dev It includes dropped reserves\n   * @return The count\n   */\n  function getReservesCount() external view returns (uint256);\n\n  /**\n   * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct\n   * @param id The id of the reserve as stored in the DataTypes.ReserveData struct\n   * @return The address of the reserve associated with id\n   */\n  function getReserveAddressById(uint16 id) external view returns (address);\n\n  /**\n   * @notice Returns the PoolAddressesProvider connected to this contract\n   * @return The address of the PoolAddressesProvider\n   */\n  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n  /**\n   * @notice Updates the protocol fee on the bridging\n   * @param bridgeProtocolFee The part of the premium sent to the protocol treasury\n   */\n  function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external;\n\n  /**\n   * @notice Updates flash loan premiums. Flash loan premium consists of two parts:\n   * - A part is sent to aToken holders as extra, one time accumulated interest\n   * - A part is collected by the protocol treasury\n   * @dev The total premium is calculated on the total borrowed amount\n   * @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`\n   * @dev Only callable by the PoolConfigurator contract\n   * @param flashLoanPremiumTotal The total premium, expressed in bps\n   * @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps\n   */\n  function updateFlashloanPremiums(\n    uint128 flashLoanPremiumTotal,\n    uint128 flashLoanPremiumToProtocol\n  ) external;\n\n  /**\n   * @notice Configures a new category for the eMode.\n   * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category.\n   * The category 0 is reserved as it's the default for volatile assets\n   * @param id The id of the category\n   * @param config The configuration of the category\n   */\n  function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external;\n\n  /**\n   * @notice Returns the data of an eMode category\n   * @param id The id of the category\n   * @return The configuration data of the category\n   */\n  function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory);\n\n  /**\n   * @notice Allows a user to use the protocol in eMode\n   * @param categoryId The id of the category\n   */\n  function setUserEMode(uint8 categoryId) external;\n\n  /**\n   * @notice Returns the eMode the user is using\n   * @param user The address of the user\n   * @return The eMode id\n   */\n  function getUserEMode(address user) external view returns (uint256);\n\n  /**\n   * @notice Resets the isolation mode total debt of the given asset to zero\n   * @dev It requires the given asset has zero debt ceiling\n   * @param asset The address of the underlying asset to reset the isolationModeTotalDebt\n   */\n  function resetIsolationModeTotalDebt(address asset) external;\n\n  /**\n   * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate\n   * @return The percentage of available liquidity to borrow, expressed in bps\n   */\n  function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256);\n\n  /**\n   * @notice Returns the total fee on flash loans\n   * @return The total fee on flashloans\n   */\n  function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128);\n\n  /**\n   * @notice Returns the part of the bridge fees sent to protocol\n   * @return The bridge fee sent to the protocol treasury\n   */\n  function BRIDGE_PROTOCOL_FEE() external view returns (uint256);\n\n  /**\n   * @notice Returns the part of the flashloan fees sent to protocol\n   * @return The flashloan fee sent to the protocol treasury\n   */\n  function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128);\n\n  /**\n   * @notice Returns the maximum number of reserves supported to be listed in this Pool\n   * @return The maximum number of reserves supported\n   */\n  function MAX_NUMBER_RESERVES() external view returns (uint16);\n\n  /**\n   * @notice Mints the assets accrued through the reserve factor to the treasury in the form of aTokens\n   * @param assets The list of reserves for which the minting needs to be executed\n   */\n  function mintToTreasury(address[] calldata assets) external;\n\n  /**\n   * @notice Rescue and transfer tokens locked in this contract\n   * @param token The address of the token\n   * @param to The address of the recipient\n   * @param amount The amount of token to transfer\n   */\n  function rescueTokens(address token, address to, uint256 amount) external;\n\n  /**\n   * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.\n   * - E.g. User supplies 100 USDC and gets in return 100 aUSDC\n   * @dev Deprecated: Use the `supply` function instead\n   * @param asset The address of the underlying asset to supply\n   * @param amount The amount to be supplied\n   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n   *   is a different wallet\n   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n   *   0 if the action is executed directly by the user, without any middle-man\n   */\n  function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IPoolConfigurator.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {ConfiguratorInputTypes} from '../protocol/libraries/types/ConfiguratorInputTypes.sol';\n\n/**\n * @title IPoolConfigurator\n * @author Aave\n * @notice Defines the basic interface for a Pool configurator.\n */\ninterface IPoolConfigurator {\n  /**\n   * @dev Emitted when a reserve is initialized.\n   * @param asset The address of the underlying asset of the reserve\n   * @param aToken The address of the associated aToken contract\n   * @param stableDebtToken The address of the associated stable rate debt token\n   * @param variableDebtToken The address of the associated variable rate debt token\n   * @param interestRateStrategyAddress The address of the interest rate strategy for the reserve\n   */\n  event ReserveInitialized(\n    address indexed asset,\n    address indexed aToken,\n    address stableDebtToken,\n    address variableDebtToken,\n    address interestRateStrategyAddress\n  );\n\n  /**\n   * @dev Emitted when borrowing is enabled or disabled on a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if borrowing is enabled, false otherwise\n   */\n  event ReserveBorrowing(address indexed asset, bool enabled);\n\n  /**\n   * @dev Emitted when flashloans are enabled or disabled on a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if flashloans are enabled, false otherwise\n   */\n  event ReserveFlashLoaning(address indexed asset, bool enabled);\n\n  /**\n   * @dev Emitted when the collateralization risk parameters for the specified asset are updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param ltv The loan to value of the asset when used as collateral\n   * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized\n   * @param liquidationBonus The bonus liquidators receive to liquidate this asset\n   */\n  event CollateralConfigurationChanged(\n    address indexed asset,\n    uint256 ltv,\n    uint256 liquidationThreshold,\n    uint256 liquidationBonus\n  );\n\n  /**\n   * @dev Emitted when stable rate borrowing is enabled or disabled on a reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if stable rate borrowing is enabled, false otherwise\n   */\n  event ReserveStableRateBorrowing(address indexed asset, bool enabled);\n\n  /**\n   * @dev Emitted when a reserve is activated or deactivated\n   * @param asset The address of the underlying asset of the reserve\n   * @param active True if reserve is active, false otherwise\n   */\n  event ReserveActive(address indexed asset, bool active);\n\n  /**\n   * @dev Emitted when a reserve is frozen or unfrozen\n   * @param asset The address of the underlying asset of the reserve\n   * @param frozen True if reserve is frozen, false otherwise\n   */\n  event ReserveFrozen(address indexed asset, bool frozen);\n\n  /**\n   * @dev Emitted when a reserve is paused or unpaused\n   * @param asset The address of the underlying asset of the reserve\n   * @param paused True if reserve is paused, false otherwise\n   */\n  event ReservePaused(address indexed asset, bool paused);\n\n  /**\n   * @dev Emitted when a reserve is dropped.\n   * @param asset The address of the underlying asset of the reserve\n   */\n  event ReserveDropped(address indexed asset);\n\n  /**\n   * @dev Emitted when a reserve factor is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldReserveFactor The old reserve factor, expressed in bps\n   * @param newReserveFactor The new reserve factor, expressed in bps\n   */\n  event ReserveFactorChanged(\n    address indexed asset,\n    uint256 oldReserveFactor,\n    uint256 newReserveFactor\n  );\n\n  /**\n   * @dev Emitted when the borrow cap of a reserve is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldBorrowCap The old borrow cap\n   * @param newBorrowCap The new borrow cap\n   */\n  event BorrowCapChanged(address indexed asset, uint256 oldBorrowCap, uint256 newBorrowCap);\n\n  /**\n   * @dev Emitted when the supply cap of a reserve is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldSupplyCap The old supply cap\n   * @param newSupplyCap The new supply cap\n   */\n  event SupplyCapChanged(address indexed asset, uint256 oldSupplyCap, uint256 newSupplyCap);\n\n  /**\n   * @dev Emitted when the liquidation protocol fee of a reserve is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldFee The old liquidation protocol fee, expressed in bps\n   * @param newFee The new liquidation protocol fee, expressed in bps\n   */\n  event LiquidationProtocolFeeChanged(address indexed asset, uint256 oldFee, uint256 newFee);\n\n  /**\n   * @dev Emitted when the unbacked mint cap of a reserve is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldUnbackedMintCap The old unbacked mint cap\n   * @param newUnbackedMintCap The new unbacked mint cap\n   */\n  event UnbackedMintCapChanged(\n    address indexed asset,\n    uint256 oldUnbackedMintCap,\n    uint256 newUnbackedMintCap\n  );\n\n  /**\n   * @dev Emitted when the category of an asset in eMode is changed.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldCategoryId The old eMode asset category\n   * @param newCategoryId The new eMode asset category\n   */\n  event EModeAssetCategoryChanged(address indexed asset, uint8 oldCategoryId, uint8 newCategoryId);\n\n  /**\n   * @dev Emitted when a new eMode category is added.\n   * @param categoryId The new eMode category id\n   * @param ltv The ltv for the asset category in eMode\n   * @param liquidationThreshold The liquidationThreshold for the asset category in eMode\n   * @param liquidationBonus The liquidationBonus for the asset category in eMode\n   * @param oracle The optional address of the price oracle specific for this category\n   * @param label A human readable identifier for the category\n   */\n  event EModeCategoryAdded(\n    uint8 indexed categoryId,\n    uint256 ltv,\n    uint256 liquidationThreshold,\n    uint256 liquidationBonus,\n    address oracle,\n    string label\n  );\n\n  /**\n   * @dev Emitted when a reserve interest strategy contract is updated.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldStrategy The address of the old interest strategy contract\n   * @param newStrategy The address of the new interest strategy contract\n   */\n  event ReserveInterestRateStrategyChanged(\n    address indexed asset,\n    address oldStrategy,\n    address newStrategy\n  );\n\n  /**\n   * @dev Emitted when an aToken implementation is upgraded.\n   * @param asset The address of the underlying asset of the reserve\n   * @param proxy The aToken proxy address\n   * @param implementation The new aToken implementation\n   */\n  event ATokenUpgraded(\n    address indexed asset,\n    address indexed proxy,\n    address indexed implementation\n  );\n\n  /**\n   * @dev Emitted when the implementation of a stable debt token is upgraded.\n   * @param asset The address of the underlying asset of the reserve\n   * @param proxy The stable debt token proxy address\n   * @param implementation The new aToken implementation\n   */\n  event StableDebtTokenUpgraded(\n    address indexed asset,\n    address indexed proxy,\n    address indexed implementation\n  );\n\n  /**\n   * @dev Emitted when the implementation of a variable debt token is upgraded.\n   * @param asset The address of the underlying asset of the reserve\n   * @param proxy The variable debt token proxy address\n   * @param implementation The new aToken implementation\n   */\n  event VariableDebtTokenUpgraded(\n    address indexed asset,\n    address indexed proxy,\n    address indexed implementation\n  );\n\n  /**\n   * @dev Emitted when the debt ceiling of an asset is set.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldDebtCeiling The old debt ceiling\n   * @param newDebtCeiling The new debt ceiling\n   */\n  event DebtCeilingChanged(address indexed asset, uint256 oldDebtCeiling, uint256 newDebtCeiling);\n\n  /**\n   * @dev Emitted when the the siloed borrowing state for an asset is changed.\n   * @param asset The address of the underlying asset of the reserve\n   * @param oldState The old siloed borrowing state\n   * @param newState The new siloed borrowing state\n   */\n  event SiloedBorrowingChanged(address indexed asset, bool oldState, bool newState);\n\n  /**\n   * @dev Emitted when the bridge protocol fee is updated.\n   * @param oldBridgeProtocolFee The old protocol fee, expressed in bps\n   * @param newBridgeProtocolFee The new protocol fee, expressed in bps\n   */\n  event BridgeProtocolFeeUpdated(uint256 oldBridgeProtocolFee, uint256 newBridgeProtocolFee);\n\n  /**\n   * @dev Emitted when the total premium on flashloans is updated.\n   * @param oldFlashloanPremiumTotal The old premium, expressed in bps\n   * @param newFlashloanPremiumTotal The new premium, expressed in bps\n   */\n  event FlashloanPremiumTotalUpdated(\n    uint128 oldFlashloanPremiumTotal,\n    uint128 newFlashloanPremiumTotal\n  );\n\n  /**\n   * @dev Emitted when the part of the premium that goes to protocol is updated.\n   * @param oldFlashloanPremiumToProtocol The old premium, expressed in bps\n   * @param newFlashloanPremiumToProtocol The new premium, expressed in bps\n   */\n  event FlashloanPremiumToProtocolUpdated(\n    uint128 oldFlashloanPremiumToProtocol,\n    uint128 newFlashloanPremiumToProtocol\n  );\n\n  /**\n   * @dev Emitted when the reserve is set as borrowable/non borrowable in isolation mode.\n   * @param asset The address of the underlying asset of the reserve\n   * @param borrowable True if the reserve is borrowable in isolation, false otherwise\n   */\n  event BorrowableInIsolationChanged(address asset, bool borrowable);\n\n  /**\n   * @notice Initializes multiple reserves.\n   * @param input The array of initialization parameters\n   */\n  function initReserves(ConfiguratorInputTypes.InitReserveInput[] calldata input) external;\n\n  /**\n   * @dev Updates the aToken implementation for the reserve.\n   * @param input The aToken update parameters\n   */\n  function updateAToken(ConfiguratorInputTypes.UpdateATokenInput calldata input) external;\n\n  /**\n   * @notice Updates the stable debt token implementation for the reserve.\n   * @param input The stableDebtToken update parameters\n   */\n  function updateStableDebtToken(\n    ConfiguratorInputTypes.UpdateDebtTokenInput calldata input\n  ) external;\n\n  /**\n   * @notice Updates the variable debt token implementation for the asset.\n   * @param input The variableDebtToken update parameters\n   */\n  function updateVariableDebtToken(\n    ConfiguratorInputTypes.UpdateDebtTokenInput calldata input\n  ) external;\n\n  /**\n   * @notice Configures borrowing on a reserve.\n   * @dev Can only be disabled (set to false) if stable borrowing is disabled\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if borrowing needs to be enabled, false otherwise\n   */\n  function setReserveBorrowing(address asset, bool enabled) external;\n\n  /**\n   * @notice Configures the reserve collateralization parameters.\n   * @dev All the values are expressed in bps. A value of 10000, results in 100.00%\n   * @dev The `liquidationBonus` is always above 100%. A value of 105% means the liquidator will receive a 5% bonus\n   * @param asset The address of the underlying asset of the reserve\n   * @param ltv The loan to value of the asset when used as collateral\n   * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized\n   * @param liquidationBonus The bonus liquidators receive to liquidate this asset\n   */\n  function configureReserveAsCollateral(\n    address asset,\n    uint256 ltv,\n    uint256 liquidationThreshold,\n    uint256 liquidationBonus\n  ) external;\n\n  /**\n   * @notice Enable or disable stable rate borrowing on a reserve.\n   * @dev Can only be enabled (set to true) if borrowing is enabled\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if stable rate borrowing needs to be enabled, false otherwise\n   */\n  function setReserveStableRateBorrowing(address asset, bool enabled) external;\n\n  /**\n   * @notice Enable or disable flashloans on a reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @param enabled True if flashloans need to be enabled, false otherwise\n   */\n  function setReserveFlashLoaning(address asset, bool enabled) external;\n\n  /**\n   * @notice Activate or deactivate a reserve\n   * @param asset The address of the underlying asset of the reserve\n   * @param active True if the reserve needs to be active, false otherwise\n   */\n  function setReserveActive(address asset, bool active) external;\n\n  /**\n   * @notice Freeze or unfreeze a reserve. A frozen reserve doesn't allow any new supply, borrow\n   * or rate swap but allows repayments, liquidations, rate rebalances and withdrawals.\n   * @param asset The address of the underlying asset of the reserve\n   * @param freeze True if the reserve needs to be frozen, false otherwise\n   */\n  function setReserveFreeze(address asset, bool freeze) external;\n\n  /**\n   * @notice Sets the borrowable in isolation flag for the reserve.\n   * @dev When this flag is set to true, the asset will be borrowable against isolated collaterals and the\n   * borrowed amount will be accumulated in the isolated collateral's total debt exposure\n   * @dev Only assets of the same family (e.g. USD stablecoins) should be borrowable in isolation mode to keep\n   * consistency in the debt ceiling calculations\n   * @param asset The address of the underlying asset of the reserve\n   * @param borrowable True if the asset should be borrowable in isolation, false otherwise\n   */\n  function setBorrowableInIsolation(address asset, bool borrowable) external;\n\n  /**\n   * @notice Pauses a reserve. A paused reserve does not allow any interaction (supply, borrow, repay,\n   * swap interest rate, liquidate, atoken transfers).\n   * @param asset The address of the underlying asset of the reserve\n   * @param paused True if pausing the reserve, false if unpausing\n   */\n  function setReservePause(address asset, bool paused) external;\n\n  /**\n   * @notice Updates the reserve factor of a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newReserveFactor The new reserve factor of the reserve\n   */\n  function setReserveFactor(address asset, uint256 newReserveFactor) external;\n\n  /**\n   * @notice Sets the interest rate strategy of a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newRateStrategyAddress The address of the new interest strategy contract\n   */\n  function setReserveInterestRateStrategyAddress(\n    address asset,\n    address newRateStrategyAddress\n  ) external;\n\n  /**\n   * @notice Pauses or unpauses all the protocol reserves. In the paused state all the protocol interactions\n   * are suspended.\n   * @param paused True if protocol needs to be paused, false otherwise\n   */\n  function setPoolPause(bool paused) external;\n\n  /**\n   * @notice Updates the borrow cap of a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newBorrowCap The new borrow cap of the reserve\n   */\n  function setBorrowCap(address asset, uint256 newBorrowCap) external;\n\n  /**\n   * @notice Updates the supply cap of a reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newSupplyCap The new supply cap of the reserve\n   */\n  function setSupplyCap(address asset, uint256 newSupplyCap) external;\n\n  /**\n   * @notice Updates the liquidation protocol fee of reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newFee The new liquidation protocol fee of the reserve, expressed in bps\n   */\n  function setLiquidationProtocolFee(address asset, uint256 newFee) external;\n\n  /**\n   * @notice Updates the unbacked mint cap of reserve.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newUnbackedMintCap The new unbacked mint cap of the reserve\n   */\n  function setUnbackedMintCap(address asset, uint256 newUnbackedMintCap) external;\n\n  /**\n   * @notice Assign an efficiency mode (eMode) category to asset.\n   * @param asset The address of the underlying asset of the reserve\n   * @param newCategoryId The new category id of the asset\n   */\n  function setAssetEModeCategory(address asset, uint8 newCategoryId) external;\n\n  /**\n   * @notice Adds a new efficiency mode (eMode) category.\n   * @dev If zero is provided as oracle address, the default asset oracles will be used to compute the overall debt and\n   * overcollateralization of the users using this category.\n   * @dev The new ltv and liquidation threshold must be greater than the base\n   * ltvs and liquidation thresholds of all assets within the eMode category\n   * @param categoryId The id of the category to be configured\n   * @param ltv The ltv associated with the category\n   * @param liquidationThreshold The liquidation threshold associated with the category\n   * @param liquidationBonus The liquidation bonus associated with the category\n   * @param oracle The oracle associated with the category\n   * @param label A label identifying the category\n   */\n  function setEModeCategory(\n    uint8 categoryId,\n    uint16 ltv,\n    uint16 liquidationThreshold,\n    uint16 liquidationBonus,\n    address oracle,\n    string calldata label\n  ) external;\n\n  /**\n   * @notice Drops a reserve entirely.\n   * @param asset The address of the reserve to drop\n   */\n  function dropReserve(address asset) external;\n\n  /**\n   * @notice Updates the bridge fee collected by the protocol reserves.\n   * @param newBridgeProtocolFee The part of the fee sent to the protocol treasury, expressed in bps\n   */\n  function updateBridgeProtocolFee(uint256 newBridgeProtocolFee) external;\n\n  /**\n   * @notice Updates the total flash loan premium.\n   * Total flash loan premium consists of two parts:\n   * - A part is sent to aToken holders as extra balance\n   * - A part is collected by the protocol reserves\n   * @dev Expressed in bps\n   * @dev The premium is calculated on the total amount borrowed\n   * @param newFlashloanPremiumTotal The total flashloan premium\n   */\n  function updateFlashloanPremiumTotal(uint128 newFlashloanPremiumTotal) external;\n\n  /**\n   * @notice Updates the flash loan premium collected by protocol reserves\n   * @dev Expressed in bps\n   * @dev The premium to protocol is calculated on the total flashloan premium\n   * @param newFlashloanPremiumToProtocol The part of the flashloan premium sent to the protocol treasury\n   */\n  function updateFlashloanPremiumToProtocol(uint128 newFlashloanPremiumToProtocol) external;\n\n  /**\n   * @notice Sets the debt ceiling for an asset.\n   * @param newDebtCeiling The new debt ceiling\n   */\n  function setDebtCeiling(address asset, uint256 newDebtCeiling) external;\n\n  /**\n   * @notice Sets siloed borrowing for an asset\n   * @param siloed The new siloed borrowing state\n   */\n  function setSiloedBorrowing(address asset, bool siloed) external;\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IAaveOracle.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPriceOracleGetter} from './IPriceOracleGetter.sol';\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IAaveOracle\n * @author Aave\n * @notice Defines the basic interface for the Aave Oracle\n */\ninterface IAaveOracle is IPriceOracleGetter {\n  /**\n   * @dev Emitted after the base currency is set\n   * @param baseCurrency The base currency of used for price quotes\n   * @param baseCurrencyUnit The unit of the base currency\n   */\n  event BaseCurrencySet(address indexed baseCurrency, uint256 baseCurrencyUnit);\n\n  /**\n   * @dev Emitted after the price source of an asset is updated\n   * @param asset The address of the asset\n   * @param source The price source of the asset\n   */\n  event AssetSourceUpdated(address indexed asset, address indexed source);\n\n  /**\n   * @dev Emitted after the address of fallback oracle is updated\n   * @param fallbackOracle The address of the fallback oracle\n   */\n  event FallbackOracleUpdated(address indexed fallbackOracle);\n\n  /**\n   * @notice Returns the PoolAddressesProvider\n   * @return The address of the PoolAddressesProvider contract\n   */\n  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n  /**\n   * @notice Sets or replaces price sources of assets\n   * @param assets The addresses of the assets\n   * @param sources The addresses of the price sources\n   */\n  function setAssetSources(address[] calldata assets, address[] calldata sources) external;\n\n  /**\n   * @notice Sets the fallback oracle\n   * @param fallbackOracle The address of the fallback oracle\n   */\n  function setFallbackOracle(address fallbackOracle) external;\n\n  /**\n   * @notice Returns a list of prices from a list of assets addresses\n   * @param assets The list of assets addresses\n   * @return The prices of the given assets\n   */\n  function getAssetsPrices(address[] calldata assets) external view returns (uint256[] memory);\n\n  /**\n   * @notice Returns the address of the source for an asset address\n   * @param asset The address of the asset\n   * @return The address of the source\n   */\n  function getSourceOfAsset(address asset) external view returns (address);\n\n  /**\n   * @notice Returns the address of the fallback oracle\n   * @return The address of the fallback oracle\n   */\n  function getFallbackOracle() external view returns (address);\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IDefaultInterestRateStrategy.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IReserveInterestRateStrategy} from './IReserveInterestRateStrategy.sol';\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IDefaultInterestRateStrategy\n * @author Aave\n * @notice Defines the basic interface of the DefaultReserveInterestRateStrategy\n */\ninterface IDefaultInterestRateStrategy is IReserveInterestRateStrategy {\n  /**\n   * @notice Returns the usage ratio at which the pool aims to obtain most competitive borrow rates.\n   * @return The optimal usage ratio, expressed in ray.\n   */\n  function OPTIMAL_USAGE_RATIO() external view returns (uint256);\n\n  /**\n   * @notice Returns the optimal stable to total debt ratio of the reserve.\n   * @return The optimal stable to total debt ratio, expressed in ray.\n   */\n  function OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256);\n\n  /**\n   * @notice Returns the excess usage ratio above the optimal.\n   * @dev It's always equal to 1-optimal usage ratio (added as constant for gas optimizations)\n   * @return The max excess usage ratio, expressed in ray.\n   */\n  function MAX_EXCESS_USAGE_RATIO() external view returns (uint256);\n\n  /**\n   * @notice Returns the excess stable debt ratio above the optimal.\n   * @dev It's always equal to 1-optimal stable to total debt ratio (added as constant for gas optimizations)\n   * @return The max excess stable to total debt ratio, expressed in ray.\n   */\n  function MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256);\n\n  /**\n   * @notice Returns the address of the PoolAddressesProvider\n   * @return The address of the PoolAddressesProvider contract\n   */\n  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n  /**\n   * @notice Returns the variable rate slope below optimal usage ratio\n   * @dev It's the variable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO\n   * @return The variable rate slope, expressed in ray\n   */\n  function getVariableRateSlope1() external view returns (uint256);\n\n  /**\n   * @notice Returns the variable rate slope above optimal usage ratio\n   * @dev It's the variable rate when usage ratio > OPTIMAL_USAGE_RATIO\n   * @return The variable rate slope, expressed in ray\n   */\n  function getVariableRateSlope2() external view returns (uint256);\n\n  /**\n   * @notice Returns the stable rate slope below optimal usage ratio\n   * @dev It's the stable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO\n   * @return The stable rate slope, expressed in ray\n   */\n  function getStableRateSlope1() external view returns (uint256);\n\n  /**\n   * @notice Returns the stable rate slope above optimal usage ratio\n   * @dev It's the variable rate when usage ratio > OPTIMAL_USAGE_RATIO\n   * @return The stable rate slope, expressed in ray\n   */\n  function getStableRateSlope2() external view returns (uint256);\n\n  /**\n   * @notice Returns the stable rate excess offset\n   * @dev It's an additional premium applied to the stable when stable debt > OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO\n   * @return The stable rate excess offset, expressed in ray\n   */\n  function getStableRateExcessOffset() external view returns (uint256);\n\n  /**\n   * @notice Returns the base stable borrow rate\n   * @return The base stable borrow rate, expressed in ray\n   */\n  function getBaseStableBorrowRate() external view returns (uint256);\n\n  /**\n   * @notice Returns the base variable borrow rate\n   * @return The base variable borrow rate, expressed in ray\n   */\n  function getBaseVariableBorrowRate() external view returns (uint256);\n\n  /**\n   * @notice Returns the maximum variable borrow rate\n   * @return The maximum variable borrow rate, expressed in ray\n   */\n  function getMaxVariableBorrowRate() external view returns (uint256);\n}\n"
      },
      "lib/sparklend-v1-core/contracts/protocol/libraries/types/DataTypes.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary DataTypes {\n  struct ReserveData {\n    //stores the reserve configuration\n    ReserveConfigurationMap configuration;\n    //the liquidity index. Expressed in ray\n    uint128 liquidityIndex;\n    //the current supply rate. Expressed in ray\n    uint128 currentLiquidityRate;\n    //variable borrow index. Expressed in ray\n    uint128 variableBorrowIndex;\n    //the current variable borrow rate. Expressed in ray\n    uint128 currentVariableBorrowRate;\n    //the current stable borrow rate. Expressed in ray\n    uint128 currentStableBorrowRate;\n    //timestamp of last update\n    uint40 lastUpdateTimestamp;\n    //the id of the reserve. Represents the position in the list of the active reserves\n    uint16 id;\n    //aToken address\n    address aTokenAddress;\n    //stableDebtToken address\n    address stableDebtTokenAddress;\n    //variableDebtToken address\n    address variableDebtTokenAddress;\n    //address of the interest rate strategy\n    address interestRateStrategyAddress;\n    //the current treasury balance, scaled\n    uint128 accruedToTreasury;\n    //the outstanding unbacked aTokens minted through the bridging feature\n    uint128 unbacked;\n    //the outstanding debt borrowed against this asset in isolation mode\n    uint128 isolationModeTotalDebt;\n  }\n\n  struct ReserveConfigurationMap {\n    //bit 0-15: LTV\n    //bit 16-31: Liq. threshold\n    //bit 32-47: Liq. bonus\n    //bit 48-55: Decimals\n    //bit 56: reserve is active\n    //bit 57: reserve is frozen\n    //bit 58: borrowing is enabled\n    //bit 59: stable rate borrowing enabled\n    //bit 60: asset is paused\n    //bit 61: borrowing in isolation mode is enabled\n    //bit 62: siloed borrowing enabled\n    //bit 63: flashloaning enabled\n    //bit 64-79: reserve factor\n    //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap\n    //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap\n    //bit 152-167 liquidation protocol fee\n    //bit 168-175 eMode category\n    //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled\n    //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals\n    //bit 252-255 unused\n\n    uint256 data;\n  }\n\n  struct UserConfigurationMap {\n    /**\n     * @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.\n     * The first bit indicates if an asset is used as collateral by the user, the second whether an\n     * asset is borrowed by the user.\n     */\n    uint256 data;\n  }\n\n  struct EModeCategory {\n    // each eMode category has a custom ltv and liquidation threshold\n    uint16 ltv;\n    uint16 liquidationThreshold;\n    uint16 liquidationBonus;\n    // each eMode category may or may not have a custom oracle to override the individual assets price oracles\n    address priceSource;\n    string label;\n  }\n\n  enum InterestRateMode {NONE, STABLE, VARIABLE}\n\n  struct ReserveCache {\n    uint256 currScaledVariableDebt;\n    uint256 nextScaledVariableDebt;\n    uint256 currPrincipalStableDebt;\n    uint256 currAvgStableBorrowRate;\n    uint256 currTotalStableDebt;\n    uint256 nextAvgStableBorrowRate;\n    uint256 nextTotalStableDebt;\n    uint256 currLiquidityIndex;\n    uint256 nextLiquidityIndex;\n    uint256 currVariableBorrowIndex;\n    uint256 nextVariableBorrowIndex;\n    uint256 currLiquidityRate;\n    uint256 currVariableBorrowRate;\n    uint256 reserveFactor;\n    ReserveConfigurationMap reserveConfiguration;\n    address aTokenAddress;\n    address stableDebtTokenAddress;\n    address variableDebtTokenAddress;\n    uint40 reserveLastUpdateTimestamp;\n    uint40 stableDebtLastUpdateTimestamp;\n  }\n\n  struct ExecuteLiquidationCallParams {\n    uint256 reservesCount;\n    uint256 debtToCover;\n    address collateralAsset;\n    address debtAsset;\n    address user;\n    bool receiveAToken;\n    address priceOracle;\n    uint8 userEModeCategory;\n    address priceOracleSentinel;\n  }\n\n  struct ExecuteSupplyParams {\n    address asset;\n    uint256 amount;\n    address onBehalfOf;\n    uint16 referralCode;\n  }\n\n  struct ExecuteBorrowParams {\n    address asset;\n    address user;\n    address onBehalfOf;\n    uint256 amount;\n    InterestRateMode interestRateMode;\n    uint16 referralCode;\n    bool releaseUnderlying;\n    uint256 maxStableRateBorrowSizePercent;\n    uint256 reservesCount;\n    address oracle;\n    uint8 userEModeCategory;\n    address priceOracleSentinel;\n  }\n\n  struct ExecuteRepayParams {\n    address asset;\n    uint256 amount;\n    InterestRateMode interestRateMode;\n    address onBehalfOf;\n    bool useATokens;\n  }\n\n  struct ExecuteWithdrawParams {\n    address asset;\n    uint256 amount;\n    address to;\n    uint256 reservesCount;\n    address oracle;\n    uint8 userEModeCategory;\n  }\n\n  struct ExecuteSetUserEModeParams {\n    uint256 reservesCount;\n    address oracle;\n    uint8 categoryId;\n  }\n\n  struct FinalizeTransferParams {\n    address asset;\n    address from;\n    address to;\n    uint256 amount;\n    uint256 balanceFromBefore;\n    uint256 balanceToBefore;\n    uint256 reservesCount;\n    address oracle;\n    uint8 fromEModeCategory;\n  }\n\n  struct FlashloanParams {\n    address receiverAddress;\n    address[] assets;\n    uint256[] amounts;\n    uint256[] interestRateModes;\n    address onBehalfOf;\n    bytes params;\n    uint16 referralCode;\n    uint256 flashLoanPremiumToProtocol;\n    uint256 flashLoanPremiumTotal;\n    uint256 maxStableRateBorrowSizePercent;\n    uint256 reservesCount;\n    address addressesProvider;\n    address pool;\n    uint8 userEModeCategory;\n    bool isAuthorizedFlashBorrower;\n  }\n\n  struct FlashloanSimpleParams {\n    address receiverAddress;\n    address asset;\n    uint256 amount;\n    bytes params;\n    uint16 referralCode;\n    uint256 flashLoanPremiumToProtocol;\n    uint256 flashLoanPremiumTotal;\n  }\n\n  struct FlashLoanRepaymentParams {\n    uint256 amount;\n    uint256 totalPremium;\n    uint256 flashLoanPremiumToProtocol;\n    address asset;\n    address receiverAddress;\n    uint16 referralCode;\n  }\n\n  struct CalculateUserAccountDataParams {\n    UserConfigurationMap userConfig;\n    uint256 reservesCount;\n    address user;\n    address oracle;\n    uint8 userEModeCategory;\n  }\n\n  struct ValidateBorrowParams {\n    ReserveCache reserveCache;\n    UserConfigurationMap userConfig;\n    address asset;\n    address userAddress;\n    uint256 amount;\n    InterestRateMode interestRateMode;\n    uint256 maxStableLoanPercent;\n    uint256 reservesCount;\n    address oracle;\n    uint8 userEModeCategory;\n    address priceOracleSentinel;\n    bool isolationModeActive;\n    address isolationModeCollateralAddress;\n    uint256 isolationModeDebtCeiling;\n  }\n\n  struct ValidateLiquidationCallParams {\n    ReserveCache debtReserveCache;\n    uint256 totalDebt;\n    uint256 healthFactor;\n    address priceOracleSentinel;\n  }\n\n  struct CalculateInterestRatesParams {\n    uint256 unbacked;\n    uint256 liquidityAdded;\n    uint256 liquidityTaken;\n    uint256 totalStableDebt;\n    uint256 totalVariableDebt;\n    uint256 averageStableBorrowRate;\n    uint256 reserveFactor;\n    address reserve;\n    address aToken;\n  }\n\n  struct InitReserveParams {\n    address asset;\n    address aTokenAddress;\n    address stableDebtAddress;\n    address variableDebtAddress;\n    address interestRateStrategyAddress;\n    uint16 reservesCount;\n    uint16 maxNumberReserves;\n  }\n}\n"
      },
      "lib/sparklend-v1-core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol": {
        "content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary ConfiguratorInputTypes {\n  struct InitReserveInput {\n    address aTokenImpl;\n    address stableDebtTokenImpl;\n    address variableDebtTokenImpl;\n    uint8 underlyingAssetDecimals;\n    address interestRateStrategyAddress;\n    address underlyingAsset;\n    address treasury;\n    address incentivesController;\n    string aTokenName;\n    string aTokenSymbol;\n    string variableDebtTokenName;\n    string variableDebtTokenSymbol;\n    string stableDebtTokenName;\n    string stableDebtTokenSymbol;\n    bytes params;\n  }\n\n  struct UpdateATokenInput {\n    address asset;\n    address treasury;\n    address incentivesController;\n    string name;\n    string symbol;\n    address implementation;\n    bytes params;\n  }\n\n  struct UpdateDebtTokenInput {\n    address asset;\n    address incentivesController;\n    string name;\n    string symbol;\n    address implementation;\n    bytes params;\n  }\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IPriceOracleGetter.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\n/**\n * @title IPriceOracleGetter\n * @author Aave\n * @notice Interface for the Aave price oracle.\n */\ninterface IPriceOracleGetter {\n  /**\n   * @notice Returns the base currency address\n   * @dev Address 0x0 is reserved for USD as base currency.\n   * @return Returns the base currency address.\n   */\n  function BASE_CURRENCY() external view returns (address);\n\n  /**\n   * @notice Returns the base currency unit\n   * @dev 1 ether for ETH, 1e8 for USD.\n   * @return Returns the base currency unit.\n   */\n  function BASE_CURRENCY_UNIT() external view returns (uint256);\n\n  /**\n   * @notice Returns the asset price in the base currency\n   * @param asset The address of the asset\n   * @return The price of the asset\n   */\n  function getAssetPrice(address asset) external view returns (uint256);\n}\n"
      },
      "lib/sparklend-v1-core/contracts/interfaces/IReserveInterestRateStrategy.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {DataTypes} from '../protocol/libraries/types/DataTypes.sol';\n\n/**\n * @title IReserveInterestRateStrategy\n * @author Aave\n * @notice Interface for the calculation of the interest rates\n */\ninterface IReserveInterestRateStrategy {\n  /**\n   * @notice Calculates the interest rates depending on the reserve's state and configurations\n   * @param params The parameters needed to calculate interest rates\n   * @return liquidityRate The liquidity rate expressed in rays\n   * @return stableBorrowRate The stable borrow rate expressed in rays\n   * @return variableBorrowRate The variable borrow rate expressed in rays\n   */\n  function calculateInterestRates(\n    DataTypes.CalculateInterestRatesParams memory params\n  ) external view returns (uint256, uint256, uint256);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "@openzeppelin/contracts/=lib/metamorpho/lib/openzeppelin-contracts/contracts/",
        "aave-v3-core/=lib/sparklend-kill-switch/lib/aave-v3-core/",
        "aave-v3-periphery/=lib/aave-v3-periphery/contracts/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc20-helpers/=lib/erc20-helpers/src/",
        "erc4626-tests/=lib/metamorpho/lib/erc4626-tests/",
        "forge-std/=lib/forge-std/src/",
        "metamorpho/=lib/metamorpho/src/",
        "morpho-blue/=lib/metamorpho/lib/morpho-blue/",
        "murky/=lib/metamorpho/lib/universal-rewards-distributor/lib/murky/src/",
        "openzeppelin-contracts/=lib/metamorpho/lib/openzeppelin-contracts/",
        "openzeppelin/=lib/metamorpho/lib/universal-rewards-distributor/lib/openzeppelin-contracts/contracts/",
        "spark-address-registry/=lib/spark-address-registry/",
        "spark-gov-relay/=lib/spark-gov-relay/src/",
        "sparklend-cap-automator/=lib/sparklend-cap-automator/src/",
        "sparklend-freezer/=lib/sparklend-freezer/src/",
        "sparklend-kill-switch/=lib/sparklend-kill-switch/src/",
        "sparklend-v1-core/=lib/sparklend-v1-core/",
        "universal-rewards-distributor/=lib/metamorpho/lib/universal-rewards-distributor/src/",
        "xchain-helpers/=lib/xchain-helpers/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": false,
      "libraries": {}
    }
  }}