UNPKG

@andrekorol/kollateral-contracts

Version:

Kollateral protocol, the flash loan building block

939 lines 33 kB
{ "contractName": "ILiquidityProxy", "abi": [ { "inputs": [ { "internalType": "address", "name": "tokenAddress", "type": "address" } ], "name": "getTotalReserve", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "tokenAddress", "type": "address" } ], "name": "getRepaymentAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } ], "name": "getRepaymentAmount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } ], "name": "borrow", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"borrow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"getRepaymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"getRepaymentAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"getTotalReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/liquidity/ILiquidityProxy.sol\":\"ILiquidityProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/andrekorol/src/kollateral/protocol/contracts/liquidity/ILiquidityProxy.sol\":{\"keccak256\":\"0xd463abb162d0ce2e2d1a5f80b6b1254857e8800b930b4d8d1c3557c444d6363d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://1c65c049566e4b8586ffb7ab62018d49f09d8f915450f6e79a0db84e4500fffb\",\"dweb:/ipfs/QmNSjMiWsY2Tt9eMYyNf3oGTFWDJjnWpgmVWTY6zKBAy3f\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", "source": "/*\n\n Copyright 2020 Kollateral LLC.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\n// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.7.0;\n\ninterface ILiquidityProxy {\n function getTotalReserve(address tokenAddress)\n external\n view\n returns (uint256);\n\n function getRepaymentAddress(address tokenAddress)\n external\n view\n returns (address);\n\n function getRepaymentAmount(address tokenAddress, uint256 tokenAmount)\n external\n view\n returns (uint256);\n\n function borrow(address tokenAddress, uint256 tokenAmount) external;\n}\n", "sourcePath": "/Users/andrekorol/src/kollateral/protocol/contracts/liquidity/ILiquidityProxy.sol", "ast": { "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/liquidity/ILiquidityProxy.sol", "exportedSymbols": { "ILiquidityProxy": [ 2148 ] }, "id": 2149, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 2117, "literals": [ "solidity", "^", "0.7", ".0" ], "nodeType": "PragmaDirective", "src": "640:23:15" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "fullyImplemented": false, "id": 2148, "linearizedBaseContracts": [ 2148 ], "name": "ILiquidityProxy", "nodeType": "ContractDefinition", "nodes": [ { "functionSelector": "c32dc3b6", "id": 2124, "implemented": false, "kind": "function", "modifiers": [], "name": "getTotalReserve", "nodeType": "FunctionDefinition", "parameters": { "id": 2120, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2119, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "scope": 2124, "src": "722:20:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2118, "name": "address", "nodeType": "ElementaryTypeName", "src": "722:7:15", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "721:22:15" }, "returnParameters": { "id": 2123, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2122, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2124, "src": "791:7:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2121, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "791:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "790:9:15" }, "scope": 2148, "src": "697:103:15", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "680c7b94", "id": 2131, "implemented": false, "kind": "function", "modifiers": [], "name": "getRepaymentAddress", "nodeType": "FunctionDefinition", "parameters": { "id": 2127, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2126, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "scope": 2131, "src": "835:20:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2125, "name": "address", "nodeType": "ElementaryTypeName", "src": "835:7:15", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "834:22:15" }, "returnParameters": { "id": 2130, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2129, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2131, "src": "904:7:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2128, "name": "address", "nodeType": "ElementaryTypeName", "src": "904:7:15", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "903:9:15" }, "scope": 2148, "src": "806:107:15", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "aa819057", "id": 2140, "implemented": false, "kind": "function", "modifiers": [], "name": "getRepaymentAmount", "nodeType": "FunctionDefinition", "parameters": { "id": 2136, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2133, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "scope": 2140, "src": "947:20:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2132, "name": "address", "nodeType": "ElementaryTypeName", "src": "947:7:15", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 2135, "mutability": "mutable", "name": "tokenAmount", "nodeType": "VariableDeclaration", "scope": 2140, "src": "969:19:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2134, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "969:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "946:43:15" }, "returnParameters": { "id": 2139, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2138, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 2140, "src": "1037:7:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2137, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1037:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1036:9:15" }, "scope": 2148, "src": "919:127:15", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "4b8a3529", "id": 2147, "implemented": false, "kind": "function", "modifiers": [], "name": "borrow", "nodeType": "FunctionDefinition", "parameters": { "id": 2145, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2142, "mutability": "mutable", "name": "tokenAddress", "nodeType": "VariableDeclaration", "scope": 2147, "src": "1068:20:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2141, "name": "address", "nodeType": "ElementaryTypeName", "src": "1068:7:15", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 2144, "mutability": "mutable", "name": "tokenAmount", "nodeType": "VariableDeclaration", "scope": 2147, "src": "1090:19:15", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2143, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1090:7:15", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1067:43:15" }, "returnParameters": { "id": 2146, "nodeType": "ParameterList", "parameters": [], "src": "1119:0:15" }, "scope": 2148, "src": "1052:68:15", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 2149, "src": "665:457:15" } ], "src": "640:483:15" }, "legacyAST": { "attributes": { "absolutePath": "/Users/andrekorol/src/kollateral/protocol/contracts/liquidity/ILiquidityProxy.sol", "exportedSymbols": { "ILiquidityProxy": [ 2148 ] }, "license": "Apache-2.0" }, "children": [ { "attributes": { "literals": [ "solidity", "^", "0.7", ".0" ] }, "id": 2117, "name": "PragmaDirective", "src": "640:23:15" }, { "attributes": { "abstract": false, "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "interface", "fullyImplemented": false, "linearizedBaseContracts": [ 2148 ], "name": "ILiquidityProxy", "scope": 2149 }, "children": [ { "attributes": { "functionSelector": "c32dc3b6", "implemented": false, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "getTotalReserve", "scope": 2148, "stateMutability": "view", "virtual": false, "visibility": "external" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAddress", "scope": 2124, "stateVariable": false, "storageLocation": "default", "type": "address", "visibility": "internal" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2118, "name": "ElementaryTypeName", "src": "722:7:15" } ], "id": 2119, "name": "VariableDeclaration", "src": "722:20:15" } ], "id": 2120, "name": "ParameterList", "src": "721:22:15" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "", "scope": 2124, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 2121, "name": "ElementaryTypeName", "src": "791:7:15" } ], "id": 2122, "name": "VariableDeclaration", "src": "791:7:15" } ], "id": 2123, "name": "ParameterList", "src": "790:9:15" } ], "id": 2124, "name": "FunctionDefinition", "src": "697:103:15" }, { "attributes": { "functionSelector": "680c7b94", "implemented": false, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "getRepaymentAddress", "scope": 2148, "stateMutability": "view", "virtual": false, "visibility": "external" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAddress", "scope": 2131, "stateVariable": false, "storageLocation": "default", "type": "address", "visibility": "internal" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2125, "name": "ElementaryTypeName", "src": "835:7:15" } ], "id": 2126, "name": "VariableDeclaration", "src": "835:20:15" } ], "id": 2127, "name": "ParameterList", "src": "834:22:15" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "", "scope": 2131, "stateVariable": false, "storageLocation": "default", "type": "address", "visibility": "internal" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2128, "name": "ElementaryTypeName", "src": "904:7:15" } ], "id": 2129, "name": "VariableDeclaration", "src": "904:7:15" } ], "id": 2130, "name": "ParameterList", "src": "903:9:15" } ], "id": 2131, "name": "FunctionDefinition", "src": "806:107:15" }, { "attributes": { "functionSelector": "aa819057", "implemented": false, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "getRepaymentAmount", "scope": 2148, "stateMutability": "view", "virtual": false, "visibility": "external" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAddress", "scope": 2140, "stateVariable": false, "storageLocation": "default", "type": "address", "visibility": "internal" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2132, "name": "ElementaryTypeName", "src": "947:7:15" } ], "id": 2133, "name": "VariableDeclaration", "src": "947:20:15" }, { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAmount", "scope": 2140, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 2134, "name": "ElementaryTypeName", "src": "969:7:15" } ], "id": 2135, "name": "VariableDeclaration", "src": "969:19:15" } ], "id": 2136, "name": "ParameterList", "src": "946:43:15" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "", "scope": 2140, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 2137, "name": "ElementaryTypeName", "src": "1037:7:15" } ], "id": 2138, "name": "VariableDeclaration", "src": "1037:7:15" } ], "id": 2139, "name": "ParameterList", "src": "1036:9:15" } ], "id": 2140, "name": "FunctionDefinition", "src": "919:127:15" }, { "attributes": { "functionSelector": "4b8a3529", "implemented": false, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "borrow", "scope": 2148, "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAddress", "scope": 2147, "stateVariable": false, "storageLocation": "default", "type": "address", "visibility": "internal" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2141, "name": "ElementaryTypeName", "src": "1068:7:15" } ], "id": 2142, "name": "VariableDeclaration", "src": "1068:20:15" }, { "attributes": { "constant": false, "mutability": "mutable", "name": "tokenAmount", "scope": 2147, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 2143, "name": "ElementaryTypeName", "src": "1090:7:15" } ], "id": 2144, "name": "VariableDeclaration", "src": "1090:19:15" } ], "id": 2145, "name": "ParameterList", "src": "1067:43:15" }, { "attributes": { "parameters": [ null ] }, "children": [], "id": 2146, "name": "ParameterList", "src": "1119:0:15" } ], "id": 2147, "name": "FunctionDefinition", "src": "1052:68:15" } ], "id": 2148, "name": "ContractDefinition", "src": "665:457:15" } ], "id": 2149, "name": "SourceUnit", "src": "640:483:15" }, "compiler": { "name": "solc", "version": "0.7.3+commit.9bfce1f6.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.3.3", "updatedAt": "2021-02-01T23:13:33.211Z", "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }