{
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "asset",
          "type": "address"
        }
      ],
      "name": "getAssetPrice",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "ast": {
    "absolutePath": "interfaces/IExchange.sol",
    "exportedSymbols": {
      "IExchange": [
        68
      ],
      "IPriceOracle": [
        11
      ]
    },
    "id": 69,
    "license": "Apache-2.0",
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1,
        "literals": [
          "solidity",
          "^",
          "0.8",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "39:23:0"
      },
      {
        "abstract": false,
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": {
          "id": 2,
          "nodeType": "StructuredDocumentation",
          "src": "64:108:0",
          "text": " @title IPriceOracle - Interface for external price oracle to get assets' prices\n @author Ensuro"
        },
        "fullyImplemented": false,
        "id": 11,
        "linearizedBaseContracts": [
          11
        ],
        "name": "IPriceOracle",
        "nameLocation": "183:12:0",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "documentation": {
              "id": 3,
              "nodeType": "StructuredDocumentation",
              "src": "200:145:0",
              "text": " @dev Returns the price of the asset in ETH\n @param asset Address of a ERC20 asset\n @return Price of the asset in ETH (Wad)"
            },
            "functionSelector": "b3596f07",
            "id": 10,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getAssetPrice",
            "nameLocation": "357:13:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 6,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5,
                  "mutability": "mutable",
                  "name": "asset",
                  "nameLocation": "379:5:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 10,
                  "src": "371:13:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 4,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "371:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "370:15:0"
            },
            "returnParameters": {
              "id": 9,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 8,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 10,
                  "src": "409:7:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 7,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "409:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "408:9:0"
            },
            "scope": 11,
            "src": "348:70:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          }
        ],
        "scope": 69,
        "src": "173:247:0",
        "usedErrors": []
      },
      {
        "abstract": false,
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": {
          "id": 12,
          "nodeType": "StructuredDocumentation",
          "src": "422:105:0",
          "text": " @title IExchange - Interface that handles exchange operations between tokens\n @author Ensuro"
        },
        "fullyImplemented": false,
        "id": 68,
        "linearizedBaseContracts": [
          68
        ],
        "name": "IExchange",
        "nameLocation": "538:9:0",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "functionSelector": "248391ff",
            "id": 23,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "convert",
            "nameLocation": "561:7:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 19,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 14,
                  "mutability": "mutable",
                  "name": "assetFrom",
                  "nameLocation": "582:9:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 23,
                  "src": "574:17:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 13,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "574:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 16,
                  "mutability": "mutable",
                  "name": "assetTo",
                  "nameLocation": "605:7:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 23,
                  "src": "597:15:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 15,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "597:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 18,
                  "mutability": "mutable",
                  "name": "amount",
                  "nameLocation": "626:6:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 23,
                  "src": "618:14:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 17,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "618:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "568:68:0"
            },
            "returnParameters": {
              "id": 22,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 21,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 23,
                  "src": "660:7:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "660:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "659:9:0"
            },
            "scope": 68,
            "src": "552:117:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "functionSelector": "53b609b5",
            "id": 34,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getAmountIn",
            "nameLocation": "682:11:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 30,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 25,
                  "mutability": "mutable",
                  "name": "assetIn",
                  "nameLocation": "707:7:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 34,
                  "src": "699:15:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 24,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "699:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 27,
                  "mutability": "mutable",
                  "name": "assetOut",
                  "nameLocation": "728:8:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 34,
                  "src": "720:16:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 26,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "720:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 29,
                  "mutability": "mutable",
                  "name": "amountOut",
                  "nameLocation": "750:9:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 34,
                  "src": "742:17:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 28,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "742:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "693:70:0"
            },
            "returnParameters": {
              "id": 33,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 32,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 34,
                  "src": "787:7:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 31,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "787:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "786:9:0"
            },
            "scope": 68,
            "src": "673:123:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "functionSelector": "725c9c49",
            "id": 39,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getSwapRouter",
            "nameLocation": "809:13:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 35,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "822:2:0"
            },
            "returnParameters": {
              "id": 38,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 37,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 39,
                  "src": "848:7:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 36,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "848:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "847:9:0"
            },
            "scope": 68,
            "src": "800:57:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "functionSelector": "fca513a8",
            "id": 45,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getPriceOracle",
            "nameLocation": "870:14:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 40,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "884:2:0"
            },
            "returnParameters": {
              "id": 44,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 43,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 45,
                  "src": "910:12:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_contract$_IPriceOracle_$11",
                    "typeString": "contract IPriceOracle"
                  },
                  "typeName": {
                    "id": 42,
                    "nodeType": "UserDefinedTypeName",
                    "pathNode": {
                      "id": 41,
                      "name": "IPriceOracle",
                      "nodeType": "IdentifierPath",
                      "referencedDeclaration": 11,
                      "src": "910:12:0"
                    },
                    "referencedDeclaration": 11,
                    "src": "910:12:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_contract$_IPriceOracle_$11",
                      "typeString": "contract IPriceOracle"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "909:14:0"
            },
            "scope": 68,
            "src": "861:63:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "functionSelector": "655450f5",
            "id": 60,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "sell",
            "nameLocation": "937:4:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 56,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 47,
                  "mutability": "mutable",
                  "name": "assetIn",
                  "nameLocation": "955:7:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "947:15:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 46,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "947:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 49,
                  "mutability": "mutable",
                  "name": "assetOut",
                  "nameLocation": "976:8:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "968:16:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 48,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "968:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 51,
                  "mutability": "mutable",
                  "name": "amountInExact",
                  "nameLocation": "998:13:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "990:21:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 50,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "990:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 53,
                  "mutability": "mutable",
                  "name": "outAddr",
                  "nameLocation": "1025:7:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "1017:15:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 52,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1017:7:0",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 55,
                  "mutability": "mutable",
                  "name": "deadline",
                  "nameLocation": "1046:8:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "1038:16:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 54,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1038:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "941:117:0"
            },
            "returnParameters": {
              "id": 59,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 58,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 60,
                  "src": "1082:12:0",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 57,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1082:5:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "1081:14:0"
            },
            "scope": 68,
            "src": "928:168:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          },
          {
            "functionSelector": "e11cfcbc",
            "id": 67,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "decodeSwapOut",
            "nameLocation": "1109:13:0",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 63,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 62,
                  "mutability": "mutable",
                  "name": "responseData",
                  "nameLocation": "1136:12:0",
                  "nodeType": "VariableDeclaration",
                  "scope": 67,
                  "src": "1123:25:0",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 61,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1123:5:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "1122:27:0"
            },
            "returnParameters": {
              "id": 66,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 65,
                  "mutability": "mutable",
                  "name": "",
                  "nameLocation": "-1:-1:-1",
                  "nodeType": "VariableDeclaration",
                  "scope": 67,
                  "src": "1173:7:0",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 64,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1173:7:0",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "1172:9:0"
            },
            "scope": 68,
            "src": "1100:82:0",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "external"
          }
        ],
        "scope": 69,
        "src": "528:656:0",
        "usedErrors": []
      }
    ],
    "src": "39:1146:0"
  },
  "contractName": "IPriceOracle",
  "dependencies": [],
  "offset": [
    173,
    420
  ],
  "sha1": "69b622e6dc4aa1005bfd491f04452cc87aaabf52",
  "source": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @title IPriceOracle - Interface for external price oracle to get assets' prices\n * @author Ensuro\n */\ninterface IPriceOracle {\n  /**\n   * @dev Returns the price of the asset in ETH\n   * @param asset Address of a ERC20 asset\n   * @return Price of the asset in ETH (Wad)\n   */\n  function getAssetPrice(address asset) external view returns (uint256);\n}\n\n/**\n * @title IExchange - Interface that handles exchange operations between tokens\n * @author Ensuro\n */\ninterface IExchange {\n  function convert(\n    address assetFrom,\n    address assetTo,\n    uint256 amount\n  ) external view returns (uint256);\n\n  function getAmountIn(\n    address assetIn,\n    address assetOut,\n    uint256 amountOut\n  ) external view returns (uint256);\n\n  function getSwapRouter() external view returns (address);\n\n  function getPriceOracle() external view returns (IPriceOracle);\n\n  function sell(\n    address assetIn,\n    address assetOut,\n    uint256 amountInExact,\n    address outAddr,\n    uint256 deadline\n  ) external view returns (bytes memory);\n\n  function decodeSwapOut(bytes memory responseData) external view returns (uint256);\n}\n",
  "type": "interface"
}