creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\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     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/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.8.0/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(address target, bytes memory data, uint256 value) 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) internal view returns (bytes memory) {\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"
      },
      "contracts/mainnet/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol": {
        "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.12;\n\nimport \"./Proxy.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title BaseUpgradeabilityProxy\n * @dev This contract implements a proxy that allows to change the\n * implementation address to which it will delegate.\n * Such a change is called an implementation upgrade.\n */\ncontract BaseUpgradeabilityProxy is Proxy {\n\t/**\n\t * @dev Emitted when the implementation is upgraded.\n\t * @param implementation Address of the new implementation.\n\t */\n\tevent Upgraded(address indexed implementation);\n\n\t/**\n\t * @dev Storage slot with the address of the current implementation.\n\t * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n\t * validated in the constructor.\n\t */\n\tbytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n\t/**\n\t * @dev Returns the current implementation.\n\t * @return impl Address of the current implementation\n\t */\n\tfunction _implementation() internal view override returns (address impl) {\n\t\tbytes32 slot = IMPLEMENTATION_SLOT;\n\t\t//solium-disable-next-line\n\t\tassembly {\n\t\t\timpl := sload(slot)\n\t\t}\n\t}\n\n\t/**\n\t * @dev Upgrades the proxy to a new implementation.\n\t * @param newImplementation Address of the new implementation.\n\t */\n\tfunction _upgradeTo(address newImplementation) internal {\n\t\t_setImplementation(newImplementation);\n\t\temit Upgraded(newImplementation);\n\t}\n\n\t/**\n\t * @dev Sets the implementation address of the proxy.\n\t * @param newImplementation Address of the new implementation.\n\t */\n\tfunction _setImplementation(address newImplementation) internal {\n\t\trequire(Address.isContract(newImplementation), \"Cannot set a proxy implementation to a non-contract address\");\n\n\t\tbytes32 slot = IMPLEMENTATION_SLOT;\n\n\t\t//solium-disable-next-line\n\t\tassembly {\n\t\t\tsstore(slot, newImplementation)\n\t\t}\n\t}\n}\n"
      },
      "contracts/mainnet/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol": {
        "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.12;\n\nimport \"./BaseUpgradeabilityProxy.sol\";\n\n/**\n * @title InitializableUpgradeabilityProxy\n * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing\n * implementation and init data.\n */\ncontract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {\n\t/**\n\t * @dev Contract initializer.\n\t * @param _logic Address of the initial implementation.\n\t * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.\n\t * It should include the signature and the parameters of the function to be called, as described in\n\t * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\n\t * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\n\t */\n\tfunction initialize(address _logic, bytes memory _data) public payable {\n\t\trequire(_implementation() == address(0));\n\t\tassert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n\t\t_setImplementation(_logic);\n\t\tif (_data.length > 0) {\n\t\t\t(bool success, ) = _logic.delegatecall(_data);\n\t\t\trequire(success);\n\t\t}\n\t}\n}\n"
      },
      "contracts/mainnet/dependencies/openzeppelin/upgradeability/Proxy.sol": {
        "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.12;\n\n/**\n * @title Proxy\n * @dev Implements delegation of calls to other contracts, with proper\n * forwarding of return values and bubbling of failures.\n * It defines a fallback function that delegates all calls to the address\n * returned by the abstract _implementation() internal function.\n */\nabstract contract Proxy {\n\t/**\n\t * @dev Fallback function.\n\t * Implemented entirely in `_fallback`.\n\t */\n\tfallback() external payable {\n\t\t_fallback();\n\t}\n\n\t/**\n\t * @return The Address of the implementation.\n\t */\n\tfunction _implementation() internal view virtual returns (address);\n\n\t/**\n\t * @dev Delegates execution to an implementation contract.\n\t * This is a low level function that doesn't return to its internal call site.\n\t * It will return to the external caller whatever the implementation returns.\n\t * @param implementation Address to delegate.\n\t */\n\tfunction _delegate(address implementation) internal {\n\t\t//solium-disable-next-line\n\t\tassembly {\n\t\t\t// Copy msg.data. We take full control of memory in this inline assembly\n\t\t\t// block because it will not return to Solidity code. We overwrite the\n\t\t\t// Solidity scratch pad at memory position 0.\n\t\t\tcalldatacopy(0, 0, calldatasize())\n\n\t\t\t// Call the implementation.\n\t\t\t// out and outsize are 0 because we don't know the size yet.\n\t\t\tlet result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n\t\t\t// Copy the returned data.\n\t\t\treturndatacopy(0, 0, returndatasize())\n\n\t\t\tswitch result\n\t\t\t// delegatecall returns 0 on error.\n\t\t\tcase 0 {\n\t\t\t\trevert(0, returndatasize())\n\t\t\t}\n\t\t\tdefault {\n\t\t\t\treturn(0, returndatasize())\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @dev Function that is run as the first thing in the fallback function.\n\t * Can be redefined in derived contracts to add functionality.\n\t * Redefinitions must call super._willFallback().\n\t */\n\tfunction _willFallback() internal virtual {}\n\n\t/**\n\t * @dev fallback implementation.\n\t * Extracted to enable manual triggering.\n\t */\n\tfunction _fallback() internal {\n\t\t_willFallback();\n\t\t_delegate(_implementation());\n\t}\n}\n"
      },
      "contracts/mainnet/lending/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity 0.8.12;\n\nimport \"../../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol\";\n\n/**\n * @title BaseImmutableAdminUpgradeabilityProxy\n * @author Aave, inspired by the OpenZeppelin upgradeability proxy pattern\n * @dev This contract combines an upgradeability proxy with an authorization\n * mechanism for administrative tasks. The admin role is stored in an immutable, which\n * helps saving transactions costs\n * All external functions in this contract must be guarded by the\n * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity\n * feature proposal that would enable this to be done automatically.\n */\ncontract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {\n\taddress immutable ADMIN;\n\n\tconstructor(address _admin) {\n\t\tADMIN = _admin;\n\t}\n\n\tmodifier ifAdmin() {\n\t\tif (msg.sender == ADMIN) {\n\t\t\t_;\n\t\t} else {\n\t\t\t_fallback();\n\t\t}\n\t}\n\n\t/**\n\t * @return _address The address of the proxy admin.\n\t */\n\tfunction admin() external ifAdmin returns (address _address) {\n\t\treturn ADMIN;\n\t}\n\n\t/**\n\t * @return _address The address of the implementation.\n\t */\n\tfunction implementation() external ifAdmin returns (address _address) {\n\t\treturn _implementation();\n\t}\n\n\t/**\n\t * @dev Upgrade the backing implementation of the proxy.\n\t * Only the admin can call this function.\n\t * @param newImplementation Address of the new implementation.\n\t */\n\tfunction upgradeTo(address newImplementation) external ifAdmin {\n\t\t_upgradeTo(newImplementation);\n\t}\n\n\t/**\n\t * @dev Upgrade the backing implementation of the proxy and call a function\n\t * on the new implementation.\n\t * This is useful to initialize the proxied contract.\n\t * @param newImplementation Address of the new implementation.\n\t * @param data Data to send as msg.data in the low level call.\n\t * It should include the signature and the parameters of the function to be called, as described in\n\t * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\n\t */\n\tfunction upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n\t\t_upgradeTo(newImplementation);\n\t\t(bool success, ) = newImplementation.delegatecall(data);\n\t\trequire(success);\n\t}\n\n\t/**\n\t * @dev Only fall back when the sender is not the admin.\n\t */\n\tfunction _willFallback() internal virtual override {\n\t\trequire(msg.sender != ADMIN, \"Cannot call fallback function from the proxy admin\");\n\t\tsuper._willFallback();\n\t}\n}\n"
      },
      "contracts/mainnet/lending/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity 0.8.12;\n\nimport \"./BaseImmutableAdminUpgradeabilityProxy.sol\";\nimport \"../../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol\";\n\n/**\n * @title InitializableAdminUpgradeabilityProxy\n * @dev Extends BaseAdminUpgradeabilityProxy with an initializer function\n */\ncontract InitializableImmutableAdminUpgradeabilityProxy is\n\tBaseImmutableAdminUpgradeabilityProxy,\n\tInitializableUpgradeabilityProxy\n{\n\tconstructor(address admin) BaseImmutableAdminUpgradeabilityProxy(admin) {}\n\n\t/**\n\t * @dev Only fall back when the sender is not the admin.\n\t */\n\tfunction _willFallback() internal override(BaseImmutableAdminUpgradeabilityProxy, Proxy) {\n\t\tBaseImmutableAdminUpgradeabilityProxy._willFallback();\n\t}\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 999999,
        "details": {
          "yul": true
        }
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "metadata": {
        "useLiteralContent": true
      },
      "libraries": {}
    }
  }}