From 6952dee573906595d96af74421a42103aa6fdd5d Mon Sep 17 00:00:00 2001 From: Karan Shahani Date: Mon, 26 Sep 2022 08:51:40 -0400 Subject: [PATCH] feat(ooki): Convert to template --- src/apps/ooki/contracts/abis/IToken.json | 5249 ------ .../ooki/contracts/abis/i-price-feeds.json | 1915 -- .../ooki/contracts/abis/i-staking-v-2.json | 3959 ---- src/apps/ooki/contracts/abis/ib-zx.json | 15397 ---------------- .../abis/{i-token.json => ooki-i-token.json} | 0 ...registry.json => ooki-token-registry.json} | 0 src/apps/ooki/contracts/ethers/IPriceFeeds.ts | 534 - src/apps/ooki/contracts/ethers/IStakingV2.ts | 1039 -- src/apps/ooki/contracts/ethers/IbZx.ts | 3357 ---- .../ethers/{IToken.ts => OokiIToken.ts} | 6 +- ...{TokenRegistry.ts => OokiTokenRegistry.ts} | 6 +- .../ethers/factories/IPriceFeeds__factory.ts | 340 - .../ethers/factories/IStakingV2__factory.ts | 684 - .../ethers/factories/IbZx__factory.ts | 2851 --- ...ken__factory.ts => OokiIToken__factory.ts} | 12 +- ...ctory.ts => OokiTokenRegistry__factory.ts} | 30 +- .../ooki/contracts/ethers/factories/index.ts | 7 +- src/apps/ooki/contracts/ethers/index.ts | 14 +- src/apps/ooki/contracts/index.ts | 31 +- .../ooki/ethereum/ooki.lend.token-fetcher.ts | 137 +- src/apps/ooki/ooki.definition.ts | 10 +- src/apps/ooki/ooki.module.ts | 4 +- 22 files changed, 102 insertions(+), 35480 deletions(-) delete mode 100644 src/apps/ooki/contracts/abis/IToken.json delete mode 100644 src/apps/ooki/contracts/abis/i-price-feeds.json delete mode 100644 src/apps/ooki/contracts/abis/i-staking-v-2.json delete mode 100644 src/apps/ooki/contracts/abis/ib-zx.json rename src/apps/ooki/contracts/abis/{i-token.json => ooki-i-token.json} (100%) rename src/apps/ooki/contracts/abis/{token-registry.json => ooki-token-registry.json} (100%) delete mode 100644 src/apps/ooki/contracts/ethers/IPriceFeeds.ts delete mode 100644 src/apps/ooki/contracts/ethers/IStakingV2.ts delete mode 100644 src/apps/ooki/contracts/ethers/IbZx.ts rename src/apps/ooki/contracts/ethers/{IToken.ts => OokiIToken.ts} (99%) rename src/apps/ooki/contracts/ethers/{TokenRegistry.ts => OokiTokenRegistry.ts} (95%) delete mode 100644 src/apps/ooki/contracts/ethers/factories/IPriceFeeds__factory.ts delete mode 100644 src/apps/ooki/contracts/ethers/factories/IStakingV2__factory.ts delete mode 100644 src/apps/ooki/contracts/ethers/factories/IbZx__factory.ts rename src/apps/ooki/contracts/ethers/factories/{IToken__factory.ts => OokiIToken__factory.ts} (98%) rename src/apps/ooki/contracts/ethers/factories/{TokenRegistry__factory.ts => OokiTokenRegistry__factory.ts} (82%) diff --git a/src/apps/ooki/contracts/abis/IToken.json b/src/apps/ooki/contracts/abis/IToken.json deleted file mode 100644 index 938ca280b..000000000 --- a/src/apps/ooki/contracts/abis/IToken.json +++ /dev/null @@ -1,5249 +0,0 @@ -{ - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "burner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assetAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "Burn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "loanAmount", - "type": "uint256" - } - ], - "name": "FlashBorrow", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "minter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assetAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "Mint", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "_isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "assetBalanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLoanDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralTokenSent", - "type": "uint256" - }, - { - "internalType": "address", - "name": "collateralTokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "borrow", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - } - ], - "internalType": "struct IToken.LoanOpenData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "borrowInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [ - { - "internalType": "uint256", - "name": "loanAmountPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "burnAmount", - "type": "uint256" - } - ], - "name": "burnToEther", - "outputs": [ - { - "internalType": "uint256", - "name": "loanAmountPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newGuardian", - "type": "address" - } - ], - "name": "changeGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_user", - "type": "address" - } - ], - "name": "checkpointPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "string", - "name": "signature", - "type": "string" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "flashBorrow", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getGuardian", - "outputs": [ - { - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPoolUtilization", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "loanParamsIds", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "loanTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "leverageAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "loanTokenSent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralTokenSent", - "type": "uint256" - }, - { - "internalType": "address", - "name": "collateralTokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "bytes", - "name": "loanDataBytes", - "type": "bytes" - } - ], - "name": "marginTrade", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - } - ], - "internalType": "struct IToken.LoanOpenData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mintWithEther", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - } - ], - "name": "nextBorrowInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "supplyAmount", - "type": "int256" - } - ], - "name": "nextSupplyInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "profitOf", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_loanTokenAddress", - "type": "address" - } - ], - "name": "revokeApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newTarget", - "type": "address" - } - ], - "name": "setTarget", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "supplyInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionUnPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tokenPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssetBorrow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssetSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assetSupply", - "type": "uint256" - } - ], - "name": "totalSupplyInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newFeePercent", - "type": "uint256" - } - ], - "name": "updateFlashBorrowFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "settingsTarget", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "name": "updateSettings", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ast": { - "absolutePath": "interfaces/IToken.sol", - "exportedSymbols": { - "IToken": [ - 2275 - ] - }, - "id": 2276, - "license": "Apache-2.0", - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1921, - "literals": [ - "solidity", - ">=", - "0.5", - ".0", - "<", - "0.9", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "96:31:6" - }, - { - "id": 1922, - "literals": [ - "experimental", - "ABIEncoderV2" - ], - "nodeType": "PragmaDirective", - "src": "128:33:6" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IToken", - "contractDependencies": [], - "contractKind": "interface", - "fullyImplemented": false, - "id": 2275, - "linearizedBaseContracts": [ - 2275 - ], - "name": "IToken", - "nameLocation": "314:6:6", - "nodeType": "ContractDefinition", - "nodes": [ - { - "functionSelector": "18160ddd", - "id": 1927, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nameLocation": "448:11:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1923, - "nodeType": "ParameterList", - "parameters": [], - "src": "459:2:6" - }, - "returnParameters": { - "id": 1926, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1925, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1927, - "src": "485:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1924, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "485:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "484:9:6" - }, - "scope": 2275, - "src": "439:55:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "70a08231", - "id": 1934, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nameLocation": "508:9:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1930, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1929, - "mutability": "mutable", - "name": "account", - "nameLocation": "526:7:6", - "nodeType": "VariableDeclaration", - "scope": 1934, - "src": "518:15:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1928, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "518:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "517:17:6" - }, - "returnParameters": { - "id": 1933, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1932, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1934, - "src": "558:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1931, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "558:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "557:9:6" - }, - "scope": 2275, - "src": "499:68:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "a9059cbb", - "id": 1943, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nameLocation": "581:8:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1939, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1936, - "mutability": "mutable", - "name": "recipient", - "nameLocation": "598:9:6", - "nodeType": "VariableDeclaration", - "scope": 1943, - "src": "590:17:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1935, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "590:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1938, - "mutability": "mutable", - "name": "amount", - "nameLocation": "617:6:6", - "nodeType": "VariableDeclaration", - "scope": 1943, - "src": "609:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1937, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "609:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "589:35:6" - }, - "returnParameters": { - "id": 1942, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1941, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1943, - "src": "643:4:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1940, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "643:4:6", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "642:6:6" - }, - "scope": 2275, - "src": "572:77:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "dd62ed3e", - "id": 1952, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nameLocation": "663:9:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1948, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1945, - "mutability": "mutable", - "name": "owner", - "nameLocation": "681:5:6", - "nodeType": "VariableDeclaration", - "scope": 1952, - "src": "673:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1944, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "673:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1947, - "mutability": "mutable", - "name": "spender", - "nameLocation": "696:7:6", - "nodeType": "VariableDeclaration", - "scope": 1952, - "src": "688:15:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1946, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "688:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "672:32:6" - }, - "returnParameters": { - "id": 1951, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1950, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1952, - "src": "728:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1949, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "728:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "727:9:6" - }, - "scope": 2275, - "src": "654:83:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "095ea7b3", - "id": 1961, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "approve", - "nameLocation": "751:7:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1957, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1954, - "mutability": "mutable", - "name": "spender", - "nameLocation": "767:7:6", - "nodeType": "VariableDeclaration", - "scope": 1961, - "src": "759:15:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1953, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "759:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1956, - "mutability": "mutable", - "name": "amount", - "nameLocation": "784:6:6", - "nodeType": "VariableDeclaration", - "scope": 1961, - "src": "776:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1955, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "776:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "758:33:6" - }, - "returnParameters": { - "id": 1960, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1959, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1961, - "src": "810:4:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1958, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "810:4:6", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "809:6:6" - }, - "scope": 2275, - "src": "742:74:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "23b872dd", - "id": 1972, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nameLocation": "830:12:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1968, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1963, - "mutability": "mutable", - "name": "sender", - "nameLocation": "851:6:6", - "nodeType": "VariableDeclaration", - "scope": 1972, - "src": "843:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1962, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "843:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1965, - "mutability": "mutable", - "name": "recipient", - "nameLocation": "867:9:6", - "nodeType": "VariableDeclaration", - "scope": 1972, - "src": "859:17:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1964, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "859:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1967, - "mutability": "mutable", - "name": "amount", - "nameLocation": "886:6:6", - "nodeType": "VariableDeclaration", - "scope": 1972, - "src": "878:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1966, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "878:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "842:51:6" - }, - "returnParameters": { - "id": 1971, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1970, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1972, - "src": "912:4:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1969, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "912:4:6", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "911:6:6" - }, - "scope": 2275, - "src": "821:97:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "anonymous": false, - "id": 1980, - "name": "Transfer", - "nameLocation": "929:8:6", - "nodeType": "EventDefinition", - "parameters": { - "id": 1979, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1974, - "indexed": true, - "mutability": "mutable", - "name": "from", - "nameLocation": "954:4:6", - "nodeType": "VariableDeclaration", - "scope": 1980, - "src": "938:20:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1973, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "938:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1976, - "indexed": true, - "mutability": "mutable", - "name": "to", - "nameLocation": "976:2:6", - "nodeType": "VariableDeclaration", - "scope": 1980, - "src": "960:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1975, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "960:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1978, - "indexed": false, - "mutability": "mutable", - "name": "value", - "nameLocation": "988:5:6", - "nodeType": "VariableDeclaration", - "scope": 1980, - "src": "980:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1977, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "980:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "937:57:6" - }, - "src": "923:72:6" - }, - { - "anonymous": false, - "id": 1988, - "name": "Approval", - "nameLocation": "1006:8:6", - "nodeType": "EventDefinition", - "parameters": { - "id": 1987, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1982, - "indexed": true, - "mutability": "mutable", - "name": "owner", - "nameLocation": "1031:5:6", - "nodeType": "VariableDeclaration", - "scope": 1988, - "src": "1015:21:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1981, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1015:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1984, - "indexed": true, - "mutability": "mutable", - "name": "spender", - "nameLocation": "1054:7:6", - "nodeType": "VariableDeclaration", - "scope": 1988, - "src": "1038:23:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1983, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1038:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1986, - "indexed": false, - "mutability": "mutable", - "name": "value", - "nameLocation": "1071:5:6", - "nodeType": "VariableDeclaration", - "scope": 1988, - "src": "1063:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1985, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1063:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1014:63:6" - }, - "src": "1000:78:6" - }, - { - "anonymous": false, - "id": 1998, - "name": "Mint", - "nameLocation": "1089:4:6", - "nodeType": "EventDefinition", - "parameters": { - "id": 1997, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1990, - "indexed": true, - "mutability": "mutable", - "name": "minter", - "nameLocation": "1110:6:6", - "nodeType": "VariableDeclaration", - "scope": 1998, - "src": "1094:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1989, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1094:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1992, - "indexed": false, - "mutability": "mutable", - "name": "tokenAmount", - "nameLocation": "1125:11:6", - "nodeType": "VariableDeclaration", - "scope": 1998, - "src": "1117:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1991, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1117:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1994, - "indexed": false, - "mutability": "mutable", - "name": "assetAmount", - "nameLocation": "1145:11:6", - "nodeType": "VariableDeclaration", - "scope": 1998, - "src": "1137:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1993, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1137:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1996, - "indexed": false, - "mutability": "mutable", - "name": "price", - "nameLocation": "1165:5:6", - "nodeType": "VariableDeclaration", - "scope": 1998, - "src": "1157:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1995, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1157:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1093:78:6" - }, - "src": "1083:89:6" - }, - { - "anonymous": false, - "id": 2008, - "name": "Burn", - "nameLocation": "1183:4:6", - "nodeType": "EventDefinition", - "parameters": { - "id": 2007, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2000, - "indexed": true, - "mutability": "mutable", - "name": "burner", - "nameLocation": "1204:6:6", - "nodeType": "VariableDeclaration", - "scope": 2008, - "src": "1188:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1999, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1188:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2002, - "indexed": false, - "mutability": "mutable", - "name": "tokenAmount", - "nameLocation": "1219:11:6", - "nodeType": "VariableDeclaration", - "scope": 2008, - "src": "1211:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2001, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1211:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2004, - "indexed": false, - "mutability": "mutable", - "name": "assetAmount", - "nameLocation": "1239:11:6", - "nodeType": "VariableDeclaration", - "scope": 2008, - "src": "1231:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2003, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1231:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2006, - "indexed": false, - "mutability": "mutable", - "name": "price", - "nameLocation": "1259:5:6", - "nodeType": "VariableDeclaration", - "scope": 2008, - "src": "1251:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2005, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1251:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1187:78:6" - }, - "src": "1177:89:6" - }, - { - "anonymous": false, - "id": 2018, - "name": "FlashBorrow", - "nameLocation": "1277:11:6", - "nodeType": "EventDefinition", - "parameters": { - "id": 2017, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2010, - "indexed": false, - "mutability": "mutable", - "name": "borrower", - "nameLocation": "1297:8:6", - "nodeType": "VariableDeclaration", - "scope": 2018, - "src": "1289:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2009, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1289:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2012, - "indexed": false, - "mutability": "mutable", - "name": "target", - "nameLocation": "1314:6:6", - "nodeType": "VariableDeclaration", - "scope": 2018, - "src": "1306:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2011, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1306:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2014, - "indexed": false, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "1329:9:6", - "nodeType": "VariableDeclaration", - "scope": 2018, - "src": "1321:17:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2013, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1321:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2016, - "indexed": false, - "mutability": "mutable", - "name": "loanAmount", - "nameLocation": "1347:10:6", - "nodeType": "VariableDeclaration", - "scope": 2018, - "src": "1339:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2015, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1339:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1288:70:6" - }, - "src": "1271:88:6" - }, - { - "functionSelector": "7ff9b596", - "id": 2023, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "tokenPrice", - "nameLocation": "1374:10:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2019, - "nodeType": "ParameterList", - "parameters": [], - "src": "1384:2:6" - }, - "returnParameters": { - "id": 2022, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2021, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2023, - "src": "1410:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2020, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1410:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1409:9:6" - }, - "scope": 2275, - "src": "1365:54:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "40c10f19", - "id": 2032, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "mint", - "nameLocation": "1434:4:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2028, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2025, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "1447:8:6", - "nodeType": "VariableDeclaration", - "scope": 2032, - "src": "1439:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2024, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1439:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2027, - "mutability": "mutable", - "name": "depositAmount", - "nameLocation": "1465:13:6", - "nodeType": "VariableDeclaration", - "scope": 2032, - "src": "1457:21:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2026, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1457:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1438:41:6" - }, - "returnParameters": { - "id": 2031, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2030, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2032, - "src": "1514:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2029, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1514:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1513:9:6" - }, - "scope": 2275, - "src": "1425:98:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "9dc29fac", - "id": 2041, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "burn", - "nameLocation": "1538:4:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2037, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2034, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "1551:8:6", - "nodeType": "VariableDeclaration", - "scope": 2041, - "src": "1543:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2033, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1543:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2036, - "mutability": "mutable", - "name": "burnAmount", - "nameLocation": "1569:10:6", - "nodeType": "VariableDeclaration", - "scope": 2041, - "src": "1561:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2035, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1561:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1542:38:6" - }, - "returnParameters": { - "id": 2040, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2039, - "mutability": "mutable", - "name": "loanAmountPaid", - "nameLocation": "1623:14:6", - "nodeType": "VariableDeclaration", - "scope": 2041, - "src": "1615:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2038, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1615:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1614:24:6" - }, - "scope": 2275, - "src": "1529:110:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "c5bf0e9d", - "id": 2056, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "flashBorrow", - "nameLocation": "1654:11:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2052, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2043, - "mutability": "mutable", - "name": "borrowAmount", - "nameLocation": "1683:12:6", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1675:20:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2042, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1675:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2045, - "mutability": "mutable", - "name": "borrower", - "nameLocation": "1713:8:6", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1705:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2044, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1705:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2047, - "mutability": "mutable", - "name": "target", - "nameLocation": "1739:6:6", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1731:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2046, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1731:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2049, - "mutability": "mutable", - "name": "signature", - "nameLocation": "1771:9:6", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1755:25:6", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_string_calldata_ptr", - "typeString": "string" - }, - "typeName": { - "id": 2048, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1755:6:6", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2051, - "mutability": "mutable", - "name": "data", - "nameLocation": "1805:4:6", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1790:19:6", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 2050, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1790:5:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "1665:150:6" - }, - "returnParameters": { - "id": 2055, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2054, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2056, - "src": "1842:12:6", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 2053, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1842:5:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "1841:14:6" - }, - "scope": 2275, - "src": "1645:211:6", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2ea295fa", - "id": 2078, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrow", - "nameLocation": "1871:6:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2073, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2058, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "1895:6:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "1887:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 2057, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1887:7:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2060, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "1936:14:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "1928:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2059, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1928:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2062, - "mutability": "mutable", - "name": "initialLoanDuration", - "nameLocation": "1968:19:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "1960:27:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2061, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1960:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2064, - "mutability": "mutable", - "name": "collateralTokenSent", - "nameLocation": "2028:19:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2020:27:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2063, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2020:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2066, - "mutability": "mutable", - "name": "collateralTokenAddress", - "nameLocation": "2134:22:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2126:30:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2065, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2126:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2068, - "mutability": "mutable", - "name": "borrower", - "nameLocation": "2269:8:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2261:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2067, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2261:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2070, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "2295:8:6", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2287:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2069, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2287:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2072, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2313:14:6", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 2071, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2313:5:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "1877:498:6" - }, - "returnParameters": { - "id": 2077, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2076, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2078, - "src": "2402:19:6", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$2223_memory_ptr", - "typeString": "struct IToken.LoanOpenData" - }, - "typeName": { - "id": 2075, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 2074, - "name": "LoanOpenData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 2223, - "src": "2402:12:6" - }, - "referencedDeclaration": 2223, - "src": "2402:12:6", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$2223_storage_ptr", - "typeString": "struct IToken.LoanOpenData" - } - }, - "visibility": "internal" - } - ], - "src": "2401:21:6" - }, - "scope": 2275, - "src": "1862:561:6", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "14dfe792", - "id": 2098, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "marginTrade", - "nameLocation": "2438:11:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2093, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2080, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "2467:6:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2459:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 2079, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2459:7:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2082, - "mutability": "mutable", - "name": "leverageAmount", - "nameLocation": "2508:14:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2500:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2081, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2500:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2084, - "mutability": "mutable", - "name": "loanTokenSent", - "nameLocation": "2540:13:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2532:21:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2083, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2532:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2086, - "mutability": "mutable", - "name": "collateralTokenSent", - "nameLocation": "2571:19:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2563:27:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2085, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2563:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2088, - "mutability": "mutable", - "name": "collateralTokenAddress", - "nameLocation": "2608:22:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2600:30:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2600:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2090, - "mutability": "mutable", - "name": "trader", - "nameLocation": "2648:6:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2640:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2089, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2640:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2092, - "mutability": "mutable", - "name": "loanDataBytes", - "nameLocation": "2679:13:6", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2664:28:6", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 2091, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2664:5:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "2449:273:6" - }, - "returnParameters": { - "id": 2097, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2096, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2098, - "src": "2749:19:6", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$2223_memory_ptr", - "typeString": "struct IToken.LoanOpenData" - }, - "typeName": { - "id": 2095, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 2094, - "name": "LoanOpenData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 2223, - "src": "2749:12:6" - }, - "referencedDeclaration": 2223, - "src": "2749:12:6", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$2223_storage_ptr", - "typeString": "struct IToken.LoanOpenData" - } - }, - "visibility": "internal" - } - ], - "src": "2748:21:6" - }, - "scope": 2275, - "src": "2429:341:6", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "54198ce9", - "id": 2105, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "profitOf", - "nameLocation": "2785:8:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2101, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2100, - "mutability": "mutable", - "name": "user", - "nameLocation": "2802:4:6", - "nodeType": "VariableDeclaration", - "scope": 2105, - "src": "2794:12:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2099, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2794:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2793:14:6" - }, - "returnParameters": { - "id": 2104, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2103, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2105, - "src": "2831:6:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 2102, - "name": "int256", - "nodeType": "ElementaryTypeName", - "src": "2831:6:6", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "visibility": "internal" - } - ], - "src": "2830:8:6" - }, - "scope": 2275, - "src": "2776:63:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "eebc5081", - "id": 2112, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "checkpointPrice", - "nameLocation": "2854:15:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2108, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2107, - "mutability": "mutable", - "name": "_user", - "nameLocation": "2878:5:6", - "nodeType": "VariableDeclaration", - "scope": 2112, - "src": "2870:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2106, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2870:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2869:15:6" - }, - "returnParameters": { - "id": 2111, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2110, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2112, - "src": "2908:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2109, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2908:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2907:9:6" - }, - "scope": 2275, - "src": "2845:72:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8325a1c0", - "id": 2117, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrowInterestRate", - "nameLocation": "2932:18:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2113, - "nodeType": "ParameterList", - "parameters": [], - "src": "2950:2:6" - }, - "returnParameters": { - "id": 2116, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2115, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2117, - "src": "2976:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2114, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2976:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2975:9:6" - }, - "scope": 2275, - "src": "2923:62:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b9fe1a8f", - "id": 2124, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "nextBorrowInterestRate", - "nameLocation": "3000:22:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2120, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2119, - "mutability": "mutable", - "name": "borrowAmount", - "nameLocation": "3031:12:6", - "nodeType": "VariableDeclaration", - "scope": 2124, - "src": "3023:20:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2118, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3023:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3022:22:6" - }, - "returnParameters": { - "id": 2123, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2122, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2124, - "src": "3092:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2121, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3092:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3091:9:6" - }, - "scope": 2275, - "src": "2991:110:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "09ec6b6b", - "id": 2129, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "supplyInterestRate", - "nameLocation": "3116:18:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2125, - "nodeType": "ParameterList", - "parameters": [], - "src": "3134:2:6" - }, - "returnParameters": { - "id": 2128, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2127, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2129, - "src": "3160:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2126, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3160:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3159:9:6" - }, - "scope": 2275, - "src": "3107:62:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "c674184f", - "id": 2136, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "nextSupplyInterestRate", - "nameLocation": "3184:22:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2131, - "mutability": "mutable", - "name": "supplyAmount", - "nameLocation": "3214:12:6", - "nodeType": "VariableDeclaration", - "scope": 2136, - "src": "3207:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 2130, - "name": "int256", - "nodeType": "ElementaryTypeName", - "src": "3207:6:6", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "visibility": "internal" - } - ], - "src": "3206:21:6" - }, - "returnParameters": { - "id": 2135, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2134, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2136, - "src": "3275:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2133, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3275:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3274:9:6" - }, - "scope": 2275, - "src": "3175:109:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "12416898", - "id": 2143, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupplyInterestRate", - "nameLocation": "3299:23:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2139, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2138, - "mutability": "mutable", - "name": "assetSupply", - "nameLocation": "3331:11:6", - "nodeType": "VariableDeclaration", - "scope": 2143, - "src": "3323:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2137, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3323:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3322:21:6" - }, - "returnParameters": { - "id": 2142, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2141, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2143, - "src": "3391:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2140, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3391:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3390:9:6" - }, - "scope": 2275, - "src": "3290:110:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "20f6d07c", - "id": 2148, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalAssetBorrow", - "nameLocation": "3415:16:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2144, - "nodeType": "ParameterList", - "parameters": [], - "src": "3431:2:6" - }, - "returnParameters": { - "id": 2147, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2146, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2148, - "src": "3457:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2145, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3457:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3456:9:6" - }, - "scope": 2275, - "src": "3406:60:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8fb807c5", - "id": 2153, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalAssetSupply", - "nameLocation": "3481:16:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2149, - "nodeType": "ParameterList", - "parameters": [], - "src": "3497:2:6" - }, - "returnParameters": { - "id": 2152, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2151, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2153, - "src": "3523:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2150, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3523:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3522:9:6" - }, - "scope": 2275, - "src": "3472:60:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "06b3efd6", - "id": 2160, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "assetBalanceOf", - "nameLocation": "3547:14:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2156, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2155, - "mutability": "mutable", - "name": "_owner", - "nameLocation": "3570:6:6", - "nodeType": "VariableDeclaration", - "scope": 2160, - "src": "3562:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2154, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3562:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3561:16:6" - }, - "returnParameters": { - "id": 2159, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2158, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2160, - "src": "3601:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2157, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3601:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3600:9:6" - }, - "scope": 2275, - "src": "3538:72:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "797bf385", - "id": 2165, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loanTokenAddress", - "nameLocation": "3625:16:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2161, - "nodeType": "ParameterList", - "parameters": [], - "src": "3641:2:6" - }, - "returnParameters": { - "id": 2164, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2163, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2165, - "src": "3667:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2162, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3667:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3666:9:6" - }, - "scope": 2275, - "src": "3616:60:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "1d0806ae", - "id": 2170, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "initialPrice", - "nameLocation": "3691:12:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2166, - "nodeType": "ParameterList", - "parameters": [], - "src": "3703:2:6" - }, - "returnParameters": { - "id": 2169, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2168, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2170, - "src": "3729:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2167, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3729:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3728:9:6" - }, - "scope": 2275, - "src": "3682:56:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "3291c11a", - "id": 2177, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loanParamsIds", - "nameLocation": "3753:13:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2173, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2172, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2177, - "src": "3767:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2171, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3767:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3766:9:6" - }, - "returnParameters": { - "id": 2176, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2175, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2177, - "src": "3799:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 2174, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3799:7:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "3798:9:6" - }, - "scope": 2275, - "src": "3744:64:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 2178, - "nodeType": "StructuredDocumentation", - "src": "3815:23:6", - "text": "Guardian interface" - }, - "functionSelector": "6a8cb4c6", - "id": 2185, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "_isPaused", - "nameLocation": "3852:9:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2181, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2180, - "mutability": "mutable", - "name": "sig", - "nameLocation": "3869:3:6", - "nodeType": "VariableDeclaration", - "scope": 2185, - "src": "3862:10:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 2179, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "3862:6:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "3861:12:6" - }, - "returnParameters": { - "id": 2184, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2183, - "mutability": "mutable", - "name": "isPaused", - "nameLocation": "3902:8:6", - "nodeType": "VariableDeclaration", - "scope": 2185, - "src": "3897:13:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 2182, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3897:4:6", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "3896:15:6" - }, - "scope": 2275, - "src": "3843:69:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ab3d9ffa", - "id": 2190, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionPause", - "nameLocation": "3927:19:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2188, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2187, - "mutability": "mutable", - "name": "sig", - "nameLocation": "3954:3:6", - "nodeType": "VariableDeclaration", - "scope": 2190, - "src": "3947:10:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 2186, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "3947:6:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "3946:12:6" - }, - "returnParameters": { - "id": 2189, - "nodeType": "ParameterList", - "parameters": [], - "src": "3967:0:6" - }, - "scope": 2275, - "src": "3918:50:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "323e35b1", - "id": 2195, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionUnPause", - "nameLocation": "3983:21:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2192, - "mutability": "mutable", - "name": "sig", - "nameLocation": "4012:3:6", - "nodeType": "VariableDeclaration", - "scope": 2195, - "src": "4005:10:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 2191, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "4005:6:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "4004:12:6" - }, - "returnParameters": { - "id": 2194, - "nodeType": "ParameterList", - "parameters": [], - "src": "4025:0:6" - }, - "scope": 2275, - "src": "3974:52:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2fcb4f04", - "id": 2200, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "changeGuardian", - "nameLocation": "4041:14:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2198, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2197, - "mutability": "mutable", - "name": "newGuardian", - "nameLocation": "4064:11:6", - "nodeType": "VariableDeclaration", - "scope": 2200, - "src": "4056:19:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2196, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4056:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4055:21:6" - }, - "returnParameters": { - "id": 2199, - "nodeType": "ParameterList", - "parameters": [], - "src": "4085:0:6" - }, - "scope": 2275, - "src": "4032:54:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "a75b87d2", - "id": 2205, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getGuardian", - "nameLocation": "4101:11:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2201, - "nodeType": "ParameterList", - "parameters": [], - "src": "4112:2:6" - }, - "returnParameters": { - "id": 2204, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2203, - "mutability": "mutable", - "name": "guardian", - "nameLocation": "4146:8:6", - "nodeType": "VariableDeclaration", - "scope": 2205, - "src": "4138:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2202, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4138:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4137:18:6" - }, - "scope": 2275, - "src": "4092:64:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "484685b0", - "id": 2210, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "revokeApproval", - "nameLocation": "4175:14:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2208, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2207, - "mutability": "mutable", - "name": "_loanTokenAddress", - "nameLocation": "4198:17:6", - "nodeType": "VariableDeclaration", - "scope": 2210, - "src": "4190:25:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2206, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4190:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4189:27:6" - }, - "returnParameters": { - "id": 2209, - "nodeType": "ParameterList", - "parameters": [], - "src": "4225:0:6" - }, - "scope": 2275, - "src": "4166:60:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 2211, - "nodeType": "StructuredDocumentation", - "src": "4232:19:6", - "text": "Admin functions" - }, - "functionSelector": "776d1a01", - "id": 2216, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setTarget", - "nameLocation": "4265:9:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2214, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2213, - "mutability": "mutable", - "name": "_newTarget", - "nameLocation": "4283:10:6", - "nodeType": "VariableDeclaration", - "scope": 2216, - "src": "4275:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2212, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4275:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4274:20:6" - }, - "returnParameters": { - "id": 2215, - "nodeType": "ParameterList", - "parameters": [], - "src": "4303:0:6" - }, - "scope": 2275, - "src": "4256:48:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "canonicalName": "IToken.LoanOpenData", - "id": 2223, - "members": [ - { - "constant": false, - "id": 2218, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "4352:6:6", - "nodeType": "VariableDeclaration", - "scope": 2223, - "src": "4344:14:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 2217, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4344:7:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2220, - "mutability": "mutable", - "name": "principal", - "nameLocation": "4376:9:6", - "nodeType": "VariableDeclaration", - "scope": 2223, - "src": "4368:17:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2219, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4368:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2222, - "mutability": "mutable", - "name": "collateral", - "nameLocation": "4403:10:6", - "nodeType": "VariableDeclaration", - "scope": 2223, - "src": "4395:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2221, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4395:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LoanOpenData", - "nameLocation": "4321:12:6", - "nodeType": "StructDefinition", - "scope": 2275, - "src": "4314:106:6", - "visibility": "public" - }, - { - "functionSelector": "0d198dd7", - "id": 2228, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "updateFlashBorrowFeePercent", - "nameLocation": "4460:27:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2226, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2225, - "mutability": "mutable", - "name": "newFeePercent", - "nameLocation": "4496:13:6", - "nodeType": "VariableDeclaration", - "scope": 2228, - "src": "4488:21:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2224, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4488:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "4487:23:6" - }, - "returnParameters": { - "id": 2227, - "nodeType": "ParameterList", - "parameters": [], - "src": "4519:0:6" - }, - "scope": 2275, - "src": "4451:69:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "bf7d653b", - "id": 2233, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getPoolUtilization", - "nameLocation": "4535:18:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2229, - "nodeType": "ParameterList", - "parameters": [], - "src": "4553:2:6" - }, - "returnParameters": { - "id": 2232, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2231, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2233, - "src": "4599:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2230, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4599:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "4598:9:6" - }, - "scope": 2275, - "src": "4526:82:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "06fdde03", - "id": 2238, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "name", - "nameLocation": "4623:4:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2234, - "nodeType": "ParameterList", - "parameters": [], - "src": "4627:2:6" - }, - "returnParameters": { - "id": 2237, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2236, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2238, - "src": "4653:13:6", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 2235, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "4653:6:6", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "visibility": "internal" - } - ], - "src": "4652:15:6" - }, - "scope": 2275, - "src": "4614:54:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "95d89b41", - "id": 2243, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "symbol", - "nameLocation": "4684:6:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2239, - "nodeType": "ParameterList", - "parameters": [], - "src": "4690:2:6" - }, - "returnParameters": { - "id": 2242, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2241, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2243, - "src": "4717:13:6", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 2240, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "4717:6:6", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "visibility": "internal" - } - ], - "src": "4716:15:6" - }, - "scope": 2275, - "src": "4675:57:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "284e2f56", - "id": 2250, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "updateSettings", - "nameLocation": "4747:14:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2248, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2245, - "mutability": "mutable", - "name": "settingsTarget", - "nameLocation": "4770:14:6", - "nodeType": "VariableDeclaration", - "scope": 2250, - "src": "4762:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2244, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4762:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2247, - "mutability": "mutable", - "name": "callData", - "nameLocation": "4801:8:6", - "nodeType": "VariableDeclaration", - "scope": 2250, - "src": "4786:23:6", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 2246, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "4786:5:6", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "4761:49:6" - }, - "returnParameters": { - "id": 2249, - "nodeType": "ParameterList", - "parameters": [], - "src": "4819:0:6" - }, - "scope": 2275, - "src": "4738:82:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8da5cb5b", - "id": 2255, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "owner", - "nameLocation": "4839:5:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2251, - "nodeType": "ParameterList", - "parameters": [], - "src": "4844:2:6" - }, - "returnParameters": { - "id": 2254, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2253, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 2255, - "src": "4870:7:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2252, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4870:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4869:9:6" - }, - "scope": 2275, - "src": "4830:49:6", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f2fde38b", - "id": 2260, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferOwnership", - "nameLocation": "4894:17:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2258, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2257, - "mutability": "mutable", - "name": "newOwner", - "nameLocation": "4920:8:6", - "nodeType": "VariableDeclaration", - "scope": 2260, - "src": "4912:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2256, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4912:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4911:18:6" - }, - "returnParameters": { - "id": 2259, - "nodeType": "ParameterList", - "parameters": [], - "src": "4938:0:6" - }, - "scope": 2275, - "src": "4885:54:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8f6ede1f", - "id": 2265, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "mintWithEther", - "nameLocation": "4954:13:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2263, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2262, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "4976:8:6", - "nodeType": "VariableDeclaration", - "scope": 2265, - "src": "4968:16:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 2261, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4968:7:6", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4967:18:6" - }, - "returnParameters": { - "id": 2264, - "nodeType": "ParameterList", - "parameters": [], - "src": "5002:0:6" - }, - "scope": 2275, - "src": "4945:58:6", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "81a6b250", - "id": 2274, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "burnToEther", - "nameLocation": "5018:11:6", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 2270, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2267, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "5046:8:6", - "nodeType": "VariableDeclaration", - "scope": 2274, - "src": "5030:24:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 2266, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5030:15:6", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 2269, - "mutability": "mutable", - "name": "burnAmount", - "nameLocation": "5063:10:6", - "nodeType": "VariableDeclaration", - "scope": 2274, - "src": "5055:18:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2268, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5055:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "5029:45:6" - }, - "returnParameters": { - "id": 2273, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 2272, - "mutability": "mutable", - "name": "loanAmountPaid", - "nameLocation": "5101:14:6", - "nodeType": "VariableDeclaration", - "scope": 2274, - "src": "5093:22:6", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2271, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5093:7:6", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "5092:24:6" - }, - "scope": 2275, - "src": "5009:108:6", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - } - ], - "scope": 2276, - "src": "304:4815:6", - "usedErrors": [] - } - ], - "src": "96:5024:6" - }, - "contractName": "IToken", - "dependencies": [], - "offset": [ - 304, - 5119 - ], - "sha1": "051a2c5bb587d7862d357b50f64fc7fe94c6777a", - "source": "/**\n * Copyright 2017-2022, OokiDao. All Rights Reserved.\n * Licensed under the Apache-2.0\n */\n\npragma solidity >=0.5.0 <0.9.0;\npragma experimental ABIEncoderV2;\n// import \"@openzeppelin-3.4.0/token/ERC20/IERC20.sol\";\n\n// import \"contracts/interfaces/IERC20.sol\";\n// SPDX-License-Identifier: Apache-2.0\n\ninterface IToken {\n\n // IERC20 specification. hard including it to avoid compatibility of openzeppelin with different libraries\n function totalSupply() external view returns (uint256);\n function balanceOf(address account) external view returns (uint256);\n function transfer(address recipient, uint256 amount) external returns (bool);\n function allowance(address owner, address spender) external view returns (uint256);\n function approve(address spender, uint256 amount) external returns (bool);\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Mint(address indexed minter,uint256 tokenAmount,uint256 assetAmount,uint256 price);\n event Burn(address indexed burner,uint256 tokenAmount,uint256 assetAmount,uint256 price);\n event FlashBorrow(address borrower,address target,address loanToken,uint256 loanAmount);\n\n function tokenPrice() external view returns (uint256);\n\n function mint(address receiver, uint256 depositAmount)\n external\n returns (uint256);\n\n function burn(address receiver, uint256 burnAmount)\n external\n returns (uint256 loanAmountPaid);\n\n function flashBorrow(\n uint256 borrowAmount,\n address borrower,\n address target,\n string calldata signature,\n bytes calldata data\n ) external payable returns (bytes memory);\n\n function borrow(\n bytes32 loanId, // 0 if new loan\n uint256 withdrawAmount,\n uint256 initialLoanDuration, // duration in seconds\n uint256 collateralTokenSent, // if 0, loanId must be provided; any ETH sent must equal this value\n address collateralTokenAddress, // if address(0), this means ETH and ETH must be sent with the call or loanId must be provided\n address borrower,\n address receiver,\n bytes calldata /*loanDataBytes*/ // arbitrary order data\n ) external payable returns (LoanOpenData memory);\n\n function marginTrade(\n bytes32 loanId, // 0 if new loan\n uint256 leverageAmount,\n uint256 loanTokenSent,\n uint256 collateralTokenSent,\n address collateralTokenAddress,\n address trader,\n bytes calldata loanDataBytes // arbitrary order data\n ) external payable returns (LoanOpenData memory);\n\n function profitOf(address user) external view returns (int256);\n\n function checkpointPrice(address _user) external view returns (uint256);\n\n function borrowInterestRate() external view returns (uint256);\n\n function nextBorrowInterestRate(uint256 borrowAmount)\n external\n view\n returns (uint256);\n\n function supplyInterestRate() external view returns (uint256);\n\n function nextSupplyInterestRate(int256 supplyAmount)\n external\n view\n returns (uint256);\n\n function totalSupplyInterestRate(uint256 assetSupply)\n external\n view\n returns (uint256);\n\n function totalAssetBorrow() external view returns (uint256);\n\n function totalAssetSupply() external view returns (uint256);\n\n function assetBalanceOf(address _owner) external view returns (uint256);\n\n function loanTokenAddress() external view returns (address);\n\n function initialPrice() external view returns (uint256);\n\n function loanParamsIds(uint256) external view returns (bytes32);\n\n\n /// Guardian interface\n\n function _isPaused(bytes4 sig) external view returns (bool isPaused);\n\n function toggleFunctionPause(bytes4 sig) external;\n\n function toggleFunctionUnPause(bytes4 sig) external;\n\n function changeGuardian(address newGuardian) external;\n\n function getGuardian() external view returns (address guardian);\n \n function revokeApproval(address _loanTokenAddress) external;\n\n /// Admin functions\n function setTarget(address _newTarget) external;\n \n struct LoanOpenData {\n bytes32 loanId;\n uint256 principal;\n uint256 collateral;\n }\n\t\n //flash borrow fees\n function updateFlashBorrowFeePercent(uint256 newFeePercent) external;\n\n function getPoolUtilization()\n external\n view\n returns (uint256);\n\n function name() external view returns (string memory);\n \n function symbol() external view returns (string memory);\n\n function updateSettings(address settingsTarget, bytes calldata callData) external;\n \n function owner() external view returns (address);\n\n function transferOwnership(address newOwner) external;\n\n function mintWithEther(address receiver) external payable;\n\n function burnToEther(address payable receiver,uint256 burnAmount) external returns (uint256 loanAmountPaid);\n}\n", - "type": "interface" -} \ No newline at end of file diff --git a/src/apps/ooki/contracts/abis/i-price-feeds.json b/src/apps/ooki/contracts/abis/i-price-feeds.json deleted file mode 100644 index c8fc3eaac..000000000 --- a/src/apps/ooki/contracts/abis/i-price-feeds.json +++ /dev/null @@ -1,1915 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "Token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "amountInEth", - "outputs": [ - { - "internalType": "uint256", - "name": "ethAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "destAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSlippage", - "type": "uint256" - } - ], - "name": "checkPriceDisagreement", - "outputs": [ - { - "internalType": "uint256", - "name": "sourceToDestSwapRate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "loanAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "getCurrentMargin", - "outputs": [ - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralToLoanRate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "loanAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "getCurrentMarginAndCollateralSize", - "outputs": [ - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralInEthAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "payToken", - "type": "address" - } - ], - "name": "getFastGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "loanAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - } - ], - "name": "getMaxDrawdown", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "name": "queryPrecision", - "outputs": [ - { - "internalType": "uint256", - "name": "precision", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "name": "queryRate", - "outputs": [ - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "precision", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - } - ], - "name": "queryReturn", - "outputs": [ - { - "internalType": "uint256", - "name": "destAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "loanAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - } - ], - "name": "shouldLiquidate", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "ast": { - "absolutePath": "interfaces/IPriceFeeds.sol", - "exportedSymbols": { - "IPriceFeeds": [1428] - }, - "id": 1429, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1305, - "literals": ["solidity", ">=", "0.5", ".0", "<", "0.9", ".0"], - "nodeType": "PragmaDirective", - "src": "114:31:3" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IPriceFeeds", - "contractDependencies": [], - "contractKind": "interface", - "fullyImplemented": false, - "id": 1428, - "linearizedBaseContracts": [1428], - "name": "IPriceFeeds", - "nameLocation": "158:11:3", - "nodeType": "ContractDefinition", - "nodes": [ - { - "functionSelector": "29d5277c", - "id": 1316, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "queryRate", - "nameLocation": "185:9:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1310, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1307, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "212:11:3", - "nodeType": "VariableDeclaration", - "scope": 1316, - "src": "204:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1306, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "204:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1309, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "241:9:3", - "nodeType": "VariableDeclaration", - "scope": 1316, - "src": "233:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1308, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "233:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "194:57:3" - }, - "returnParameters": { - "id": 1315, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1312, - "mutability": "mutable", - "name": "rate", - "nameLocation": "307:4:3", - "nodeType": "VariableDeclaration", - "scope": 1316, - "src": "299:12:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1311, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "299:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1314, - "mutability": "mutable", - "name": "precision", - "nameLocation": "321:9:3", - "nodeType": "VariableDeclaration", - "scope": 1316, - "src": "313:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1313, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "313:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "298:33:3" - }, - "scope": 1428, - "src": "176:156:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "524efd4b", - "id": 1325, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "queryPrecision", - "nameLocation": "347:14:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1321, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1318, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "379:11:3", - "nodeType": "VariableDeclaration", - "scope": 1325, - "src": "371:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1317, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "371:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1320, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "408:9:3", - "nodeType": "VariableDeclaration", - "scope": 1325, - "src": "400:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1319, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "400:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "361:57:3" - }, - "returnParameters": { - "id": 1324, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1323, - "mutability": "mutable", - "name": "precision", - "nameLocation": "474:9:3", - "nodeType": "VariableDeclaration", - "scope": 1325, - "src": "466:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1322, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "466:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "465:19:3" - }, - "scope": 1428, - "src": "338:147:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "d138f9a1", - "id": 1336, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "queryReturn", - "nameLocation": "500:11:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1332, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1327, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "529:11:3", - "nodeType": "VariableDeclaration", - "scope": 1336, - "src": "521:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1326, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "521:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1329, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "558:9:3", - "nodeType": "VariableDeclaration", - "scope": 1336, - "src": "550:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1328, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "550:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1331, - "mutability": "mutable", - "name": "sourceAmount", - "nameLocation": "585:12:3", - "nodeType": "VariableDeclaration", - "scope": 1336, - "src": "577:20:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1330, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "577:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "511:87:3" - }, - "returnParameters": { - "id": 1335, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1334, - "mutability": "mutable", - "name": "destAmount", - "nameLocation": "654:10:3", - "nodeType": "VariableDeclaration", - "scope": 1336, - "src": "646:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1333, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "646:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "645:20:3" - }, - "scope": 1428, - "src": "491:175:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "1e2c62d3", - "id": 1351, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "checkPriceDisagreement", - "nameLocation": "681:22:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1347, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1338, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "721:11:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "713:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1337, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "713:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1340, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "750:9:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "742:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1339, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "742:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1342, - "mutability": "mutable", - "name": "sourceAmount", - "nameLocation": "777:12:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "769:20:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1341, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "769:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1344, - "mutability": "mutable", - "name": "destAmount", - "nameLocation": "807:10:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "799:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1343, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "799:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1346, - "mutability": "mutable", - "name": "maxSlippage", - "nameLocation": "835:11:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "827:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1345, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "827:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "703:144:3" - }, - "returnParameters": { - "id": 1350, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1349, - "mutability": "mutable", - "name": "sourceToDestSwapRate", - "nameLocation": "903:20:3", - "nodeType": "VariableDeclaration", - "scope": 1351, - "src": "895:28:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1348, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "895:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "894:30:3" - }, - "scope": 1428, - "src": "672:253:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b2cf54ea", - "id": 1360, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "amountInEth", - "nameLocation": "940:11:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1356, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1353, - "mutability": "mutable", - "name": "Token", - "nameLocation": "969:5:3", - "nodeType": "VariableDeclaration", - "scope": 1360, - "src": "961:13:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1352, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "961:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1355, - "mutability": "mutable", - "name": "amount", - "nameLocation": "992:6:3", - "nodeType": "VariableDeclaration", - "scope": 1360, - "src": "984:14:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1354, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "984:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "951:48:3" - }, - "returnParameters": { - "id": 1359, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1358, - "mutability": "mutable", - "name": "ethAmount", - "nameLocation": "1055:9:3", - "nodeType": "VariableDeclaration", - "scope": 1360, - "src": "1047:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1357, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1047:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1046:19:3" - }, - "scope": 1428, - "src": "931:135:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f80b25fb", - "id": 1375, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getMaxDrawdown", - "nameLocation": "1081:14:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1371, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1362, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "1113:9:3", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1105:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1361, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1105:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1364, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "1140:15:3", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1132:23:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1363, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1132:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1366, - "mutability": "mutable", - "name": "loanAmount", - "nameLocation": "1173:10:3", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1165:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1365, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1165:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1368, - "mutability": "mutable", - "name": "collateralAmount", - "nameLocation": "1201:16:3", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1193:24:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1367, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1193:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1370, - "mutability": "mutable", - "name": "maintenanceMargin", - "nameLocation": "1235:17:3", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1227:25:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1369, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1227:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1095:158:3" - }, - "returnParameters": { - "id": 1374, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1373, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1375, - "src": "1301:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1372, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1301:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1300:9:3" - }, - "scope": 1428, - "src": "1072:238:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ecc5382d", - "id": 1390, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getCurrentMarginAndCollateralSize", - "nameLocation": "1325:33:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1384, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1377, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "1376:9:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1368:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1376, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1368:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1379, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "1403:15:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1395:23:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1378, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1395:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1381, - "mutability": "mutable", - "name": "loanAmount", - "nameLocation": "1436:10:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1428:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1380, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1428:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1383, - "mutability": "mutable", - "name": "collateralAmount", - "nameLocation": "1464:16:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1456:24:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1382, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1456:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1358:123:3" - }, - "returnParameters": { - "id": 1389, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1386, - "mutability": "mutable", - "name": "currentMargin", - "nameLocation": "1537:13:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1529:21:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1385, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1529:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1388, - "mutability": "mutable", - "name": "collateralInEthAmount", - "nameLocation": "1560:21:3", - "nodeType": "VariableDeclaration", - "scope": 1390, - "src": "1552:29:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1387, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1552:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1528:54:3" - }, - "scope": 1428, - "src": "1316:267:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2ff0d012", - "id": 1405, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getCurrentMargin", - "nameLocation": "1598:16:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1399, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1392, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "1632:9:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1624:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1391, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1624:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1394, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "1659:15:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1651:23:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1393, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1651:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1396, - "mutability": "mutable", - "name": "loanAmount", - "nameLocation": "1692:10:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1684:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1395, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1684:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1398, - "mutability": "mutable", - "name": "collateralAmount", - "nameLocation": "1720:16:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1712:24:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1397, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1712:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1614:123:3" - }, - "returnParameters": { - "id": 1404, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1401, - "mutability": "mutable", - "name": "currentMargin", - "nameLocation": "1793:13:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1785:21:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1400, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1785:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1403, - "mutability": "mutable", - "name": "collateralToLoanRate", - "nameLocation": "1816:20:3", - "nodeType": "VariableDeclaration", - "scope": 1405, - "src": "1808:28:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1402, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1808:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1784:53:3" - }, - "scope": 1428, - "src": "1589:249:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2a887702", - "id": 1420, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "shouldLiquidate", - "nameLocation": "1853:15:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1416, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1407, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "1886:9:3", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "1878:17:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1406, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1878:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1409, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "1913:15:3", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "1905:23:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1408, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1905:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1411, - "mutability": "mutable", - "name": "loanAmount", - "nameLocation": "1946:10:3", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "1938:18:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1410, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1938:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1413, - "mutability": "mutable", - "name": "collateralAmount", - "nameLocation": "1974:16:3", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "1966:24:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1412, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1966:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1415, - "mutability": "mutable", - "name": "maintenanceMargin", - "nameLocation": "2008:17:3", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "2000:25:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1414, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2000:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1868:158:3" - }, - "returnParameters": { - "id": 1419, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1418, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1420, - "src": "2074:4:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1417, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2074:4:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "2073:6:3" - }, - "scope": 1428, - "src": "1844:236:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "90d1f66f", - "id": 1427, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getFastGasPrice", - "nameLocation": "2095:15:3", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1423, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1422, - "mutability": "mutable", - "name": "payToken", - "nameLocation": "2128:8:3", - "nodeType": "VariableDeclaration", - "scope": 1427, - "src": "2120:16:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1421, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2120:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2110:27:3" - }, - "returnParameters": { - "id": 1426, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1425, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1427, - "src": "2185:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1424, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2185:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2184:9:3" - }, - "scope": 1428, - "src": "2086:108:3", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - } - ], - "scope": 1429, - "src": "148:2048:3", - "usedErrors": [] - } - ], - "src": "114:2083:3" - }, - "contractName": "IPriceFeeds", - "dependencies": [], - "offset": [148, 2196], - "sha1": "51cd49aa793c4fca35d3e0ab7d00a9030613fb3e", - "source": "/**\n * Copyright 2017-2022, OokiDao. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0.\n */\n\npragma solidity >=0.5.0 <0.9.0;\n\n\ninterface IPriceFeeds {\n function queryRate(\n address sourceToken,\n address destToken)\n external\n view\n returns (uint256 rate, uint256 precision);\n\n function queryPrecision(\n address sourceToken,\n address destToken)\n external\n view\n returns (uint256 precision);\n\n function queryReturn(\n address sourceToken,\n address destToken,\n uint256 sourceAmount)\n external\n view\n returns (uint256 destAmount);\n\n function checkPriceDisagreement(\n address sourceToken,\n address destToken,\n uint256 sourceAmount,\n uint256 destAmount,\n uint256 maxSlippage)\n external\n view\n returns (uint256 sourceToDestSwapRate);\n\n function amountInEth(\n address Token,\n uint256 amount)\n external\n view\n returns (uint256 ethAmount);\n\n function getMaxDrawdown(\n address loanToken,\n address collateralToken,\n uint256 loanAmount,\n uint256 collateralAmount,\n uint256 maintenanceMargin)\n external\n view\n returns (uint256);\n\n function getCurrentMarginAndCollateralSize(\n address loanToken,\n address collateralToken,\n uint256 loanAmount,\n uint256 collateralAmount)\n external\n view\n returns (uint256 currentMargin, uint256 collateralInEthAmount);\n\n function getCurrentMargin(\n address loanToken,\n address collateralToken,\n uint256 loanAmount,\n uint256 collateralAmount)\n external\n view\n returns (uint256 currentMargin, uint256 collateralToLoanRate);\n\n function shouldLiquidate(\n address loanToken,\n address collateralToken,\n uint256 loanAmount,\n uint256 collateralAmount,\n uint256 maintenanceMargin)\n external\n view\n returns (bool);\n\n function getFastGasPrice(\n address payToken)\n external\n view\n returns (uint256);\n}\n", - "type": "interface" -} diff --git a/src/apps/ooki/contracts/abis/i-staking-v-2.json b/src/apps/ooki/contracts/abis/i-staking-v-2.json deleted file mode 100644 index 3fc9c25d6..000000000 --- a/src/apps/ooki/contracts/abis/i-staking-v-2.json +++ /dev/null @@ -1,3959 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "_isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "_setProposalVals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "_totalSupplyPerToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "addAltRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newOOKI", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newStableCoin", - "type": "uint256" - } - ], - "name": "addRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOfByAsset", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOfByAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "bzrxBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "iOOKIBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vBZRXBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "LPTokenBalance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOfStored", - "outputs": [ - { - "internalType": "uint256", - "name": "vestedBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vestingBalance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newGuardian", - "type": "address" - } - ], - "name": "changeGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "restake", - "type": "bool" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimAltRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimSushi", - "outputs": [ - { - "internalType": "uint256", - "name": "sushiRewardsEarned", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "earned", - "outputs": [ - { - "internalType": "uint256", - "name": "bzrxRewardsEarned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableCoinRewardsEarned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bzrxRewardsVesting", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableCoinRewardsVesting", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sushiRewardsEarned", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "exit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "exitSushi", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getGuardian", - "outputs": [ - { - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVariableWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "vBZRXWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "iOOKIWeight", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "LPTokenWeight", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "pendingCrvRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "bzrxRewardsEarned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableCoinRewardsEarned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bzrxRewardsVesting", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "stableCoinRewardsVesting", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sushiRewardsEarned", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "setApprovals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_governor", - "type": "address" - } - ], - "name": "setGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "stakingGovernance", - "type": "address" - } - ], - "name": "setVoteDelegator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionUnPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "totalSupplyByAsset", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupplyStored", - "outputs": [ - { - "internalType": "uint256", - "name": "supply", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "unstake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "settingsTarget", - "type": "address" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ], - "name": "updateSettings", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenBalance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastUpdate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "vestingEndTime", - "type": "uint256" - } - ], - "name": "vestedBalanceForAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "vested", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "vestingLastSync", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "votingBalanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "totalVotes", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "votingBalanceOfNow", - "outputs": [ - { - "internalType": "uint256", - "name": "totalVotes", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "votingFromStakedBalanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "totalVotes", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "ast": { - "absolutePath": "interfaces/IStakingV2.sol", - "exportedSymbols": { - "IStakingV2": [1919] - }, - "id": 1920, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1644, - "literals": ["solidity", ">=", "0.5", ".0", "<", "0.9", ".0"], - "nodeType": "PragmaDirective", - "src": "114:31:5" - }, - { - "id": 1645, - "literals": ["experimental", "ABIEncoderV2"], - "nodeType": "PragmaDirective", - "src": "146:33:5" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IStakingV2", - "contractDependencies": [], - "contractKind": "interface", - "fullyImplemented": false, - "id": 1919, - "linearizedBaseContracts": [1919], - "name": "IStakingV2", - "nameLocation": "191:10:5", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "IStakingV2.ProposalState", - "id": 1654, - "members": [ - { - "constant": false, - "id": 1647, - "mutability": "mutable", - "name": "proposalTime", - "nameLocation": "247:12:5", - "nodeType": "VariableDeclaration", - "scope": 1654, - "src": "239:20:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1646, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "239:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1649, - "mutability": "mutable", - "name": "iOOKIWeight", - "nameLocation": "277:11:5", - "nodeType": "VariableDeclaration", - "scope": 1654, - "src": "269:19:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1648, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "269:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1651, - "mutability": "mutable", - "name": "lpOOKIBalance", - "nameLocation": "306:13:5", - "nodeType": "VariableDeclaration", - "scope": 1654, - "src": "298:21:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1650, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "298:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1653, - "mutability": "mutable", - "name": "lpTotalSupply", - "nameLocation": "337:13:5", - "nodeType": "VariableDeclaration", - "scope": 1654, - "src": "329:21:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1652, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "329:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "ProposalState", - "nameLocation": "215:13:5", - "nodeType": "StructDefinition", - "scope": 1919, - "src": "208:149:5", - "visibility": "public" - }, - { - "canonicalName": "IStakingV2.AltRewardsUserInfo", - "id": 1659, - "members": [ - { - "constant": false, - "id": 1656, - "mutability": "mutable", - "name": "stakingStartBlock", - "nameLocation": "407:17:5", - "nodeType": "VariableDeclaration", - "scope": 1659, - "src": "399:25:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1655, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "399:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1658, - "mutability": "mutable", - "name": "pending", - "nameLocation": "442:7:5", - "nodeType": "VariableDeclaration", - "scope": 1659, - "src": "434:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1657, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "434:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "AltRewardsUserInfo", - "nameLocation": "370:18:5", - "nodeType": "StructDefinition", - "scope": 1919, - "src": "363:93:5", - "visibility": "public" - }, - { - "functionSelector": "fc41aa09", - "id": 1666, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "addRewards", - "nameLocation": "471:10:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1664, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1661, - "mutability": "mutable", - "name": "newOOKI", - "nameLocation": "490:7:5", - "nodeType": "VariableDeclaration", - "scope": 1666, - "src": "482:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1660, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "482:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1663, - "mutability": "mutable", - "name": "newStableCoin", - "nameLocation": "507:13:5", - "nodeType": "VariableDeclaration", - "scope": 1666, - "src": "499:21:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1662, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "499:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "481:40:5" - }, - "returnParameters": { - "id": 1665, - "nodeType": "ParameterList", - "parameters": [], - "src": "530:0:5" - }, - "scope": 1919, - "src": "462:69:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "cf86add5", - "id": 1675, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "stake", - "nameLocation": "546:5:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1673, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1669, - "mutability": "mutable", - "name": "tokens", - "nameLocation": "571:6:5", - "nodeType": "VariableDeclaration", - "scope": 1675, - "src": "552:25:5", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1667, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "552:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1668, - "nodeType": "ArrayTypeName", - "src": "552:9:5", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1672, - "mutability": "mutable", - "name": "values", - "nameLocation": "598:6:5", - "nodeType": "VariableDeclaration", - "scope": 1675, - "src": "579:25:5", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1670, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "579:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1671, - "nodeType": "ArrayTypeName", - "src": "579:9:5", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - } - ], - "src": "551:54:5" - }, - "returnParameters": { - "id": 1674, - "nodeType": "ParameterList", - "parameters": [], - "src": "614:0:5" - }, - "scope": 1919, - "src": "537:78:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "bcca1e04", - "id": 1684, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "unstake", - "nameLocation": "630:7:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1678, - "mutability": "mutable", - "name": "tokens", - "nameLocation": "657:6:5", - "nodeType": "VariableDeclaration", - "scope": 1684, - "src": "638:25:5", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1676, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "638:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1677, - "nodeType": "ArrayTypeName", - "src": "638:9:5", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1681, - "mutability": "mutable", - "name": "values", - "nameLocation": "684:6:5", - "nodeType": "VariableDeclaration", - "scope": 1684, - "src": "665:25:5", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1679, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "665:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1680, - "nodeType": "ArrayTypeName", - "src": "665:9:5", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - } - ], - "src": "637:54:5" - }, - "returnParameters": { - "id": 1683, - "nodeType": "ParameterList", - "parameters": [], - "src": "700:0:5" - }, - "scope": 1919, - "src": "621:80:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "008cc262", - "id": 1699, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "earned", - "nameLocation": "716:6:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1687, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1686, - "mutability": "mutable", - "name": "account", - "nameLocation": "731:7:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "723:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1685, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "723:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "722:17:5" - }, - "returnParameters": { - "id": 1698, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1689, - "mutability": "mutable", - "name": "bzrxRewardsEarned", - "nameLocation": "808:17:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "800:25:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1688, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "800:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1691, - "mutability": "mutable", - "name": "stableCoinRewardsEarned", - "nameLocation": "847:23:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "839:31:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1690, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "839:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1693, - "mutability": "mutable", - "name": "bzrxRewardsVesting", - "nameLocation": "892:18:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "884:26:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1692, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "884:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1695, - "mutability": "mutable", - "name": "stableCoinRewardsVesting", - "nameLocation": "932:24:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "924:32:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1694, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "924:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1697, - "mutability": "mutable", - "name": "sushiRewardsEarned", - "nameLocation": "978:18:5", - "nodeType": "VariableDeclaration", - "scope": 1699, - "src": "970:26:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1696, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "970:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "786:220:5" - }, - "scope": 1919, - "src": "707:300:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f1664794", - "id": 1714, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "pendingCrvRewards", - "nameLocation": "1022:17:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1702, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1701, - "mutability": "mutable", - "name": "account", - "nameLocation": "1048:7:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1040:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1700, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1040:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1039:17:5" - }, - "returnParameters": { - "id": 1713, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1704, - "mutability": "mutable", - "name": "bzrxRewardsEarned", - "nameLocation": "1125:17:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1117:25:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1703, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1117:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1706, - "mutability": "mutable", - "name": "stableCoinRewardsEarned", - "nameLocation": "1164:23:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1156:31:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1705, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1156:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1708, - "mutability": "mutable", - "name": "bzrxRewardsVesting", - "nameLocation": "1209:18:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1201:26:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1707, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1201:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1710, - "mutability": "mutable", - "name": "stableCoinRewardsVesting", - "nameLocation": "1249:24:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1241:32:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1709, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1241:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1712, - "mutability": "mutable", - "name": "sushiRewardsEarned", - "nameLocation": "1295:18:5", - "nodeType": "VariableDeclaration", - "scope": 1714, - "src": "1287:26:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1711, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1287:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1103:220:5" - }, - "scope": 1919, - "src": "1013:311:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "83e02cd8", - "id": 1723, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getVariableWeights", - "nameLocation": "1339:18:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1715, - "nodeType": "ParameterList", - "parameters": [], - "src": "1357:2:5" - }, - "returnParameters": { - "id": 1722, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1717, - "mutability": "mutable", - "name": "vBZRXWeight", - "nameLocation": "1428:11:5", - "nodeType": "VariableDeclaration", - "scope": 1723, - "src": "1420:19:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1716, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1420:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1719, - "mutability": "mutable", - "name": "iOOKIWeight", - "nameLocation": "1461:11:5", - "nodeType": "VariableDeclaration", - "scope": 1723, - "src": "1453:19:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1718, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1453:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1721, - "mutability": "mutable", - "name": "LPTokenWeight", - "nameLocation": "1494:13:5", - "nodeType": "VariableDeclaration", - "scope": 1723, - "src": "1486:21:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1720, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1486:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1406:111:5" - }, - "scope": 1919, - "src": "1330:188:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "87359ebe", - "id": 1732, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOfByAsset", - "nameLocation": "1533:16:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1728, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1725, - "mutability": "mutable", - "name": "token", - "nameLocation": "1558:5:5", - "nodeType": "VariableDeclaration", - "scope": 1732, - "src": "1550:13:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1724, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1550:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1727, - "mutability": "mutable", - "name": "account", - "nameLocation": "1573:7:5", - "nodeType": "VariableDeclaration", - "scope": 1732, - "src": "1565:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1726, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1565:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1549:32:5" - }, - "returnParameters": { - "id": 1731, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1730, - "mutability": "mutable", - "name": "balance", - "nameLocation": "1613:7:5", - "nodeType": "VariableDeclaration", - "scope": 1732, - "src": "1605:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1729, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1605:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1604:17:5" - }, - "scope": 1919, - "src": "1524:98:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2ee1a86e", - "id": 1745, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOfByAssets", - "nameLocation": "1637:17:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1735, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1734, - "mutability": "mutable", - "name": "account", - "nameLocation": "1663:7:5", - "nodeType": "VariableDeclaration", - "scope": 1745, - "src": "1655:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1733, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1655:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1654:17:5" - }, - "returnParameters": { - "id": 1744, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1737, - "mutability": "mutable", - "name": "bzrxBalance", - "nameLocation": "1740:11:5", - "nodeType": "VariableDeclaration", - "scope": 1745, - "src": "1732:19:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1736, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1732:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1739, - "mutability": "mutable", - "name": "iOOKIBalance", - "nameLocation": "1773:12:5", - "nodeType": "VariableDeclaration", - "scope": 1745, - "src": "1765:20:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1738, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1765:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1741, - "mutability": "mutable", - "name": "vBZRXBalance", - "nameLocation": "1807:12:5", - "nodeType": "VariableDeclaration", - "scope": 1745, - "src": "1799:20:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1740, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1799:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1743, - "mutability": "mutable", - "name": "LPTokenBalance", - "nameLocation": "1841:14:5", - "nodeType": "VariableDeclaration", - "scope": 1745, - "src": "1833:22:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1742, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1833:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1718:147:5" - }, - "scope": 1919, - "src": "1628:238:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "59dcf522", - "id": 1754, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "balanceOfStored", - "nameLocation": "1881:15:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1748, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1747, - "mutability": "mutable", - "name": "account", - "nameLocation": "1905:7:5", - "nodeType": "VariableDeclaration", - "scope": 1754, - "src": "1897:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1746, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1897:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1896:17:5" - }, - "returnParameters": { - "id": 1753, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1750, - "mutability": "mutable", - "name": "vestedBalance", - "nameLocation": "1945:13:5", - "nodeType": "VariableDeclaration", - "scope": 1754, - "src": "1937:21:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1749, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1937:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1752, - "mutability": "mutable", - "name": "vestingBalance", - "nameLocation": "1968:14:5", - "nodeType": "VariableDeclaration", - "scope": 1754, - "src": "1960:22:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1751, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1960:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "1936:47:5" - }, - "scope": 1919, - "src": "1872:112:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ef1c243a", - "id": 1759, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupplyStored", - "nameLocation": "1999:17:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1755, - "nodeType": "ParameterList", - "parameters": [], - "src": "2016:2:5" - }, - "returnParameters": { - "id": 1758, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1757, - "mutability": "mutable", - "name": "supply", - "nameLocation": "2050:6:5", - "nodeType": "VariableDeclaration", - "scope": 1759, - "src": "2042:14:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1756, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2042:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2041:16:5" - }, - "scope": 1919, - "src": "1990:68:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "7f3fd8ba", - "id": 1770, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "vestedBalanceForAmount", - "nameLocation": "2073:22:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1766, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1761, - "mutability": "mutable", - "name": "tokenBalance", - "nameLocation": "2113:12:5", - "nodeType": "VariableDeclaration", - "scope": 1770, - "src": "2105:20:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1760, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2105:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1763, - "mutability": "mutable", - "name": "lastUpdate", - "nameLocation": "2143:10:5", - "nodeType": "VariableDeclaration", - "scope": 1770, - "src": "2135:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1762, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2135:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1765, - "mutability": "mutable", - "name": "vestingEndTime", - "nameLocation": "2171:14:5", - "nodeType": "VariableDeclaration", - "scope": 1770, - "src": "2163:22:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1764, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2163:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2095:96:5" - }, - "returnParameters": { - "id": 1769, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1768, - "mutability": "mutable", - "name": "vested", - "nameLocation": "2223:6:5", - "nodeType": "VariableDeclaration", - "scope": 1770, - "src": "2215:14:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1767, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2215:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2214:16:5" - }, - "scope": 1919, - "src": "2064:167:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "c1159297", - "id": 1779, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "votingBalanceOf", - "nameLocation": "2246:15:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1775, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1772, - "mutability": "mutable", - "name": "account", - "nameLocation": "2270:7:5", - "nodeType": "VariableDeclaration", - "scope": 1779, - "src": "2262:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1771, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2262:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1774, - "mutability": "mutable", - "name": "proposalId", - "nameLocation": "2287:10:5", - "nodeType": "VariableDeclaration", - "scope": 1779, - "src": "2279:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1773, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2279:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2261:37:5" - }, - "returnParameters": { - "id": 1778, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1777, - "mutability": "mutable", - "name": "totalVotes", - "nameLocation": "2330:10:5", - "nodeType": "VariableDeclaration", - "scope": 1779, - "src": "2322:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1776, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2322:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2321:20:5" - }, - "scope": 1919, - "src": "2237:105:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "abbd3ab1", - "id": 1786, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "votingBalanceOfNow", - "nameLocation": "2357:18:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1781, - "mutability": "mutable", - "name": "account", - "nameLocation": "2384:7:5", - "nodeType": "VariableDeclaration", - "scope": 1786, - "src": "2376:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1780, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2376:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2375:17:5" - }, - "returnParameters": { - "id": 1785, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1784, - "mutability": "mutable", - "name": "totalVotes", - "nameLocation": "2424:10:5", - "nodeType": "VariableDeclaration", - "scope": 1786, - "src": "2416:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1783, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2416:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2415:20:5" - }, - "scope": 1919, - "src": "2348:88:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ee575209", - "id": 1793, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "votingFromStakedBalanceOf", - "nameLocation": "2451:25:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1789, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1788, - "mutability": "mutable", - "name": "account", - "nameLocation": "2485:7:5", - "nodeType": "VariableDeclaration", - "scope": 1793, - "src": "2477:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1787, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2477:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2476:17:5" - }, - "returnParameters": { - "id": 1792, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1791, - "mutability": "mutable", - "name": "totalVotes", - "nameLocation": "2525:10:5", - "nodeType": "VariableDeclaration", - "scope": 1793, - "src": "2517:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1790, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2517:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2516:20:5" - }, - "scope": 1919, - "src": "2442:95:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2a5522af", - "id": 1802, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "_setProposalVals", - "nameLocation": "2552:16:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1798, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1795, - "mutability": "mutable", - "name": "account", - "nameLocation": "2577:7:5", - "nodeType": "VariableDeclaration", - "scope": 1802, - "src": "2569:15:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1794, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2569:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1797, - "mutability": "mutable", - "name": "proposalId", - "nameLocation": "2594:10:5", - "nodeType": "VariableDeclaration", - "scope": 1802, - "src": "2586:18:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1796, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2586:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2568:37:5" - }, - "returnParameters": { - "id": 1801, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1800, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1802, - "src": "2624:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1799, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2624:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2623:9:5" - }, - "scope": 1919, - "src": "2543:90:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "e9fad8ee", - "id": 1805, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "exit", - "nameLocation": "2648:4:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1803, - "nodeType": "ParameterList", - "parameters": [], - "src": "2652:2:5" - }, - "returnParameters": { - "id": 1804, - "nodeType": "ParameterList", - "parameters": [], - "src": "2663:0:5" - }, - "scope": 1919, - "src": "2639:25:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "3e1755c7", - "id": 1812, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "addAltRewards", - "nameLocation": "2679:13:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1810, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1807, - "mutability": "mutable", - "name": "token", - "nameLocation": "2701:5:5", - "nodeType": "VariableDeclaration", - "scope": 1812, - "src": "2693:13:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1806, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2693:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1809, - "mutability": "mutable", - "name": "amount", - "nameLocation": "2716:6:5", - "nodeType": "VariableDeclaration", - "scope": 1812, - "src": "2708:14:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1808, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2708:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2692:31:5" - }, - "returnParameters": { - "id": 1811, - "nodeType": "ParameterList", - "parameters": [], - "src": "2732:0:5" - }, - "scope": 1919, - "src": "2670:63:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "0c340a24", - "id": 1817, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "governor", - "nameLocation": "2748:8:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1813, - "nodeType": "ParameterList", - "parameters": [], - "src": "2756:2:5" - }, - "returnParameters": { - "id": 1816, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1815, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1817, - "src": "2782:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1814, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2782:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2781:9:5" - }, - "scope": 1919, - "src": "2739:52:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8da5cb5b", - "id": 1822, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "owner", - "nameLocation": "2806:5:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1818, - "nodeType": "ParameterList", - "parameters": [], - "src": "2811:2:5" - }, - "returnParameters": { - "id": 1821, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1820, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1822, - "src": "2837:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1819, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2837:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2836:9:5" - }, - "scope": 1919, - "src": "2797:49:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f2fde38b", - "id": 1827, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferOwnership", - "nameLocation": "2861:17:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1825, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1824, - "mutability": "mutable", - "name": "newOwner", - "nameLocation": "2887:8:5", - "nodeType": "VariableDeclaration", - "scope": 1827, - "src": "2879:16:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1823, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2879:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "2878:18:5" - }, - "returnParameters": { - "id": 1826, - "nodeType": "ParameterList", - "parameters": [], - "src": "2905:0:5" - }, - "scope": 1919, - "src": "2852:54:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2d81a78e", - "id": 1832, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "claim", - "nameLocation": "2921:5:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1830, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1829, - "mutability": "mutable", - "name": "restake", - "nameLocation": "2932:7:5", - "nodeType": "VariableDeclaration", - "scope": 1832, - "src": "2927:12:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1828, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2927:4:5", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "2926:14:5" - }, - "returnParameters": { - "id": 1831, - "nodeType": "ParameterList", - "parameters": [], - "src": "2949:0:5" - }, - "scope": 1919, - "src": "2912:38:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "fedfa88b", - "id": 1835, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "claimAltRewards", - "nameLocation": "2965:15:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1833, - "nodeType": "ParameterList", - "parameters": [], - "src": "2980:2:5" - }, - "returnParameters": { - "id": 1834, - "nodeType": "ParameterList", - "parameters": [], - "src": "2991:0:5" - }, - "scope": 1919, - "src": "2956:36:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "febfcc48", - "id": 1842, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "_totalSupplyPerToken", - "nameLocation": "3007:20:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1838, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1837, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1842, - "src": "3028:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1836, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3028:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3027:9:5" - }, - "returnParameters": { - "id": 1841, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1840, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1842, - "src": "3059:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1839, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3059:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3058:9:5" - }, - "scope": 1919, - "src": "2998:70:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 1843, - "nodeType": "StructuredDocumentation", - "src": "3079:23:5", - "text": "Guardian Interface" - }, - "functionSelector": "6a8cb4c6", - "id": 1850, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "_isPaused", - "nameLocation": "3116:9:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1846, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1845, - "mutability": "mutable", - "name": "sig", - "nameLocation": "3133:3:5", - "nodeType": "VariableDeclaration", - "scope": 1850, - "src": "3126:10:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 1844, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "3126:6:5", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "3125:12:5" - }, - "returnParameters": { - "id": 1849, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1848, - "mutability": "mutable", - "name": "isPaused", - "nameLocation": "3166:8:5", - "nodeType": "VariableDeclaration", - "scope": 1850, - "src": "3161:13:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1847, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3161:4:5", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "3160:15:5" - }, - "scope": 1919, - "src": "3107:69:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ab3d9ffa", - "id": 1855, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionPause", - "nameLocation": "3191:19:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1853, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1852, - "mutability": "mutable", - "name": "sig", - "nameLocation": "3218:3:5", - "nodeType": "VariableDeclaration", - "scope": 1855, - "src": "3211:10:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 1851, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "3211:6:5", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "3210:12:5" - }, - "returnParameters": { - "id": 1854, - "nodeType": "ParameterList", - "parameters": [], - "src": "3231:0:5" - }, - "scope": 1919, - "src": "3182:50:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "323e35b1", - "id": 1860, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionUnPause", - "nameLocation": "3247:21:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1858, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1857, - "mutability": "mutable", - "name": "sig", - "nameLocation": "3276:3:5", - "nodeType": "VariableDeclaration", - "scope": 1860, - "src": "3269:10:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 1856, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "3269:6:5", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "3268:12:5" - }, - "returnParameters": { - "id": 1859, - "nodeType": "ParameterList", - "parameters": [], - "src": "3289:0:5" - }, - "scope": 1919, - "src": "3238:52:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2fcb4f04", - "id": 1865, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "changeGuardian", - "nameLocation": "3305:14:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1863, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1862, - "mutability": "mutable", - "name": "newGuardian", - "nameLocation": "3328:11:5", - "nodeType": "VariableDeclaration", - "scope": 1865, - "src": "3320:19:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1861, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3320:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3319:21:5" - }, - "returnParameters": { - "id": 1864, - "nodeType": "ParameterList", - "parameters": [], - "src": "3349:0:5" - }, - "scope": 1919, - "src": "3296:54:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "a75b87d2", - "id": 1870, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getGuardian", - "nameLocation": "3365:11:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1866, - "nodeType": "ParameterList", - "parameters": [], - "src": "3376:2:5" - }, - "returnParameters": { - "id": 1869, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1868, - "mutability": "mutable", - "name": "guardian", - "nameLocation": "3410:8:5", - "nodeType": "VariableDeclaration", - "scope": 1870, - "src": "3402:16:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1867, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3402:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3401:18:5" - }, - "scope": 1919, - "src": "3356:64:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "863f2e18", - "id": 1873, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "exitSushi", - "nameLocation": "3501:9:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1871, - "nodeType": "ParameterList", - "parameters": [], - "src": "3510:2:5" - }, - "returnParameters": { - "id": 1872, - "nodeType": "ParameterList", - "parameters": [], - "src": "3521:0:5" - }, - "scope": 1919, - "src": "3492:30:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "c42cf535", - "id": 1878, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setGovernor", - "nameLocation": "3537:11:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1876, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1875, - "mutability": "mutable", - "name": "_governor", - "nameLocation": "3557:9:5", - "nodeType": "VariableDeclaration", - "scope": 1878, - "src": "3549:17:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1874, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3549:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3548:19:5" - }, - "returnParameters": { - "id": 1877, - "nodeType": "ParameterList", - "parameters": [], - "src": "3576:0:5" - }, - "scope": 1919, - "src": "3528:49:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "e32d5cf8", - "id": 1887, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setApprovals", - "nameLocation": "3592:12:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1885, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1880, - "mutability": "mutable", - "name": "_token", - "nameLocation": "3622:6:5", - "nodeType": "VariableDeclaration", - "scope": 1887, - "src": "3614:14:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1879, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3614:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1882, - "mutability": "mutable", - "name": "_spender", - "nameLocation": "3646:8:5", - "nodeType": "VariableDeclaration", - "scope": 1887, - "src": "3638:16:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1881, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3638:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1884, - "mutability": "mutable", - "name": "_value", - "nameLocation": "3672:6:5", - "nodeType": "VariableDeclaration", - "scope": 1887, - "src": "3664:14:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1883, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3664:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3604:80:5" - }, - "returnParameters": { - "id": 1886, - "nodeType": "ParameterList", - "parameters": [], - "src": "3693:0:5" - }, - "scope": 1919, - "src": "3583:111:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "545be0dd", - "id": 1892, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setVoteDelegator", - "nameLocation": "3709:16:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1890, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1889, - "mutability": "mutable", - "name": "stakingGovernance", - "nameLocation": "3734:17:5", - "nodeType": "VariableDeclaration", - "scope": 1892, - "src": "3726:25:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1888, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3726:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3725:27:5" - }, - "returnParameters": { - "id": 1891, - "nodeType": "ParameterList", - "parameters": [], - "src": "3761:0:5" - }, - "scope": 1919, - "src": "3700:62:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "284e2f56", - "id": 1899, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "updateSettings", - "nameLocation": "3777:14:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1897, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1894, - "mutability": "mutable", - "name": "settingsTarget", - "nameLocation": "3800:14:5", - "nodeType": "VariableDeclaration", - "scope": 1899, - "src": "3792:22:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1893, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3792:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1896, - "mutability": "mutable", - "name": "callData", - "nameLocation": "3831:8:5", - "nodeType": "VariableDeclaration", - "scope": 1899, - "src": "3816:23:5", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 1895, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "3816:5:5", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "3791:49:5" - }, - "returnParameters": { - "id": 1898, - "nodeType": "ParameterList", - "parameters": [], - "src": "3849:0:5" - }, - "scope": 1919, - "src": "3768:82:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "4fb65036", - "id": 1904, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "claimSushi", - "nameLocation": "3865:10:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1900, - "nodeType": "ParameterList", - "parameters": [], - "src": "3875:2:5" - }, - "returnParameters": { - "id": 1903, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1902, - "mutability": "mutable", - "name": "sushiRewardsEarned", - "nameLocation": "3904:18:5", - "nodeType": "VariableDeclaration", - "scope": 1904, - "src": "3896:26:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1901, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3896:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3895:28:5" - }, - "scope": 1919, - "src": "3856:68:5", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "02baf1b0", - "id": 1911, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "totalSupplyByAsset", - "nameLocation": "3939:18:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1907, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1906, - "mutability": "mutable", - "name": "token", - "nameLocation": "3966:5:5", - "nodeType": "VariableDeclaration", - "scope": 1911, - "src": "3958:13:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1905, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3958:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3957:15:5" - }, - "returnParameters": { - "id": 1910, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1909, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1911, - "src": "4020:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1908, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4020:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "4019:9:5" - }, - "scope": 1919, - "src": "3930:99:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "9674a931", - "id": 1918, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "vestingLastSync", - "nameLocation": "4044:15:5", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1914, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1913, - "mutability": "mutable", - "name": "user", - "nameLocation": "4068:4:5", - "nodeType": "VariableDeclaration", - "scope": 1918, - "src": "4060:12:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1912, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4060:7:5", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4059:14:5" - }, - "returnParameters": { - "id": 1917, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1916, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 1918, - "src": "4096:7:5", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1915, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4096:7:5", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "4095:9:5" - }, - "scope": 1919, - "src": "4035:70:5", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - } - ], - "scope": 1920, - "src": "181:3926:5", - "usedErrors": [] - } - ], - "src": "114:3994:5" - }, - "contractName": "IStakingV2", - "dependencies": [], - "offset": [181, 4107], - "sha1": "791718c22f0e43727e4d2f01c6963512e2e50a98", - "source": "/**\n * Copyright 2017-2022, OokiDao. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0.\n */\n\npragma solidity >=0.5.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\ninterface IStakingV2 {\n struct ProposalState {\n uint256 proposalTime;\n uint256 iOOKIWeight;\n uint256 lpOOKIBalance;\n uint256 lpTotalSupply;\n }\n\n struct AltRewardsUserInfo {\n uint256 stakingStartBlock;\n uint256 pending;\n }\n\n function addRewards(uint256 newOOKI, uint256 newStableCoin) external;\n\n function stake(address[] calldata tokens, uint256[] calldata values) external;\n\n function unstake(address[] calldata tokens, uint256[] calldata values) external;\n\n function earned(address account)\n external\n view\n returns (\n uint256 bzrxRewardsEarned,\n uint256 stableCoinRewardsEarned,\n uint256 bzrxRewardsVesting,\n uint256 stableCoinRewardsVesting,\n uint256 sushiRewardsEarned\n );\n\n function pendingCrvRewards(address account)\n external\n view\n returns (\n uint256 bzrxRewardsEarned,\n uint256 stableCoinRewardsEarned,\n uint256 bzrxRewardsVesting,\n uint256 stableCoinRewardsVesting,\n uint256 sushiRewardsEarned\n );\n\n function getVariableWeights()\n external\n view\n returns (\n uint256 vBZRXWeight,\n uint256 iOOKIWeight,\n uint256 LPTokenWeight\n );\n\n function balanceOfByAsset(address token, address account) external view returns (uint256 balance);\n\n function balanceOfByAssets(address account)\n external\n view\n returns (\n uint256 bzrxBalance,\n uint256 iOOKIBalance,\n uint256 vBZRXBalance,\n uint256 LPTokenBalance\n );\n\n function balanceOfStored(address account) external view returns (uint256 vestedBalance, uint256 vestingBalance);\n\n function totalSupplyStored() external view returns (uint256 supply);\n\n function vestedBalanceForAmount(\n uint256 tokenBalance,\n uint256 lastUpdate,\n uint256 vestingEndTime\n ) external view returns (uint256 vested);\n\n function votingBalanceOf(address account, uint256 proposalId) external view returns (uint256 totalVotes);\n\n function votingBalanceOfNow(address account) external view returns (uint256 totalVotes);\n\n function votingFromStakedBalanceOf(address account) external view returns (uint256 totalVotes);\n\n function _setProposalVals(address account, uint256 proposalId) external returns (uint256);\n\n function exit() external;\n\n function addAltRewards(address token, uint256 amount) external;\n\n function governor() external view returns (address);\n\n function owner() external view returns (address);\n\n function transferOwnership(address newOwner) external;\n\n function claim(bool restake) external;\n\n function claimAltRewards() external;\n\n function _totalSupplyPerToken(address) external view returns(uint256);\n \n\n /// Guardian Interface\n\n function _isPaused(bytes4 sig) external view returns (bool isPaused);\n\n function toggleFunctionPause(bytes4 sig) external;\n\n function toggleFunctionUnPause(bytes4 sig) external;\n\n function changeGuardian(address newGuardian) external;\n\n function getGuardian() external view returns (address guardian);\n\n // Admin functions\n\n // Withdraw all from sushi masterchef\n function exitSushi() external;\n\n function setGovernor(address _governor) external;\n\n function setApprovals(\n address _token,\n address _spender,\n uint256 _value\n ) external;\n\n function setVoteDelegator(address stakingGovernance) external;\n\n function updateSettings(address settingsTarget, bytes calldata callData) external;\n\n function claimSushi() external returns (uint256 sushiRewardsEarned);\n\n function totalSupplyByAsset(address token)\n external\n view\n returns (uint256);\n\n function vestingLastSync(address user) external view returns(uint256);\n}\n", - "type": "interface" -} diff --git a/src/apps/ooki/contracts/abis/ib-zx.json b/src/apps/ooki/contracts/abis/ib-zx.json deleted file mode 100644 index 975c4a2b9..000000000 --- a/src/apps/ooki/contracts/abis/ib-zx.json +++ /dev/null @@ -1,15397 +0,0 @@ -{ - "abi": [ - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "_isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "affiliateFeePercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanParamsId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "isTorqueLoan", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "initialMargin", - "type": "uint256" - }, - { - "internalType": "address[4]", - "name": "sentAddresses", - "type": "address[4]" - }, - { - "internalType": "uint256[5]", - "name": "sentValues", - "type": "uint256[5]" - }, - { - "internalType": "bytes", - "name": "loanDataBytes", - "type": "bytes" - } - ], - "name": "borrowOrTradeFromPool", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanOpenData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "borrowingFeePercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "borrowingFeeTokensHeld", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "borrowingFeeTokensPaid", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newGuardian", - "type": "address" - } - ], - "name": "changeGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "claimAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "loanIds", - "type": "bytes32[]" - } - ], - "name": "cleanupLoans", - "outputs": [ - { - "internalType": "uint256", - "name": "totalPrincipalIn", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "closeWithDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawToken", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "gasTokenUser", - "type": "address" - }, - { - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "closeWithDepositWithGasToken", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawToken", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "swapAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "returnTokenIsCollateral", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "loanDataBytes", - "type": "bytes" - } - ], - "name": "closeWithSwap", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawToken", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "gasTokenUser", - "type": "address" - }, - { - "internalType": "uint256", - "name": "swapAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "returnTokenIsCollateral", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "loanDataBytes", - "type": "bytes" - } - ], - "name": "closeWithSwapWithGasToken", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawToken", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "delegatedManagers", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "depositCollateral", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "loanParamsIdList", - "type": "bytes32[]" - } - ], - "name": "disableLoanParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "feesController", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "unsafeOnly", - "type": "bool" - } - ], - "name": "getActiveLoans", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "endTimestamp", - "type": "uint96" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestOwedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestDepositRemaining", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidatable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSeizable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsLoanToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsCollateralToken", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanReturnData[]", - "name": "loansData", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "unsafeOnly", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isLiquidatable", - "type": "bool" - } - ], - "name": "getActiveLoansAdvanced", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "endTimestamp", - "type": "uint96" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestOwedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestDepositRemaining", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidatable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSeizable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsLoanToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsCollateralToken", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanReturnData[]", - "name": "loansData", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getActiveLoansCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collateralTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "marginAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isTorqueLoan", - "type": "bool" - } - ], - "name": "getBorrowAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanParamsId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "collateralTokenAmount", - "type": "uint256" - } - ], - "name": "getBorrowAmountByParams", - "outputs": [ - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getGuardian", - "outputs": [ - { - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - } - ], - "name": "getInterestModelValues", - "outputs": [ - { - "internalType": "uint256", - "name": "_poolLastUpdateTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolPrincipalTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolInterestTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolRatePerTokenStored", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolLastInterestRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_loanPrincipalTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_loanInterestTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_loanRatePerTokenPaid", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - } - ], - "name": "getLoan", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "endTimestamp", - "type": "uint96" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestOwedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestDepositRemaining", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidatable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSeizable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsLoanToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsCollateralToken", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanReturnData", - "name": "loanData", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - } - ], - "name": "getLoanInterestOutstanding", - "outputs": [ - { - "internalType": "uint256", - "name": "interest", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "loanParamsIdList", - "type": "bytes32[]" - } - ], - "name": "getLoanParams", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minInitialMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanParams[]", - "name": "loanParamsList", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLoanParamsList", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "loanParamsList", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLoanPoolsList", - "outputs": [ - { - "internalType": "address[]", - "name": "loanPoolsList", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - } - ], - "name": "getLoanPrincipal", - "outputs": [ - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getPoolLastInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getPoolPrincipalStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newPrincipal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "marginAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isTorqueLoan", - "type": "bool" - } - ], - "name": "getRequiredCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountRequired", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanParamsId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "newPrincipal", - "type": "uint256" - } - ], - "name": "getRequiredCollateralByParams", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountRequired", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "swapData", - "type": "bytes" - } - ], - "name": "getSwapExpectedReturn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "payload", - "type": "bytes" - } - ], - "name": "getSwapExpectedReturn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "getTWAI", - "outputs": [ - { - "internalType": "uint256", - "name": "benchmarkRate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "sig", - "type": "string" - } - ], - "name": "getTarget", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - } - ], - "name": "getTotalPrincipal", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "enum IBZx.LoanType", - "name": "loanType", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isLender", - "type": "bool" - }, - { - "internalType": "bool", - "name": "unsafeOnly", - "type": "bool" - } - ], - "name": "getUserLoans", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint96", - "name": "endTimestamp", - "type": "uint96" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestOwedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "interestDepositRemaining", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startRate", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidatable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSeizable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsLoanToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsCollateralToken", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanReturnData[]", - "name": "loansData", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bool", - "name": "isLender", - "type": "bool" - } - ], - "name": "getUserLoansCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "loanPool", - "type": "address" - } - ], - "name": "isLoanPool", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lenderInterest", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "principalTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "owedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "owedTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "paidTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LenderInterest", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lendingFeePercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lendingFeeTokensHeld", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lendingFeeTokensPaid", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "closeAmount", - "type": "uint256" - } - ], - "name": "liquidate", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "seizedAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "seizedToken", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "gasTokenUser", - "type": "address" - }, - { - "internalType": "uint256", - "name": "closeAmount", - "type": "uint256" - } - ], - "name": "liquidateWithGasToken", - "outputs": [ - { - "internalType": "uint256", - "name": "loanCloseAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "seizedAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "seizedToken", - "type": "address" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "liquidationIncentivePercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "loanInterest", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "owedPerDay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanInterest", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "loanParams", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minInitialMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanParams", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "loanPoolToUnderlying", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "loans", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "loanParamsId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "pendingTradesId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "principal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startRate", - "type": "uint256" - }, - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "address", - "name": "lender", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - } - ], - "internalType": "struct IBZx.Loan", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "name": "logicTargets", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxDisagreement", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxSwapSize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4[]", - "name": "sig", - "type": "bytes4[]" - } - ], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "flashBorrowFeePercent", - "type": "uint256" - } - ], - "name": "payFlashBorrowFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "priceFeeds", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolTokenHeld", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolTokenPaid", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "enum IBZx.FeeClaimType", - "name": "feeType", - "type": "uint8" - } - ], - "name": "queryFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "amountsHeld", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amountsPaid", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "replaceContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "rewardsBalanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "rewardsBalance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "setAffiliateFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "setBorrowingFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "delegated", - "type": "address" - }, - { - "internalType": "bool", - "name": "toggle", - "type": "bool" - } - ], - "name": "setDelegatedManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "depositValueAsLoanToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositValueAsCollateralToken", - "type": "uint256" - } - ], - "name": "setDepositAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newController", - "type": "address" - } - ], - "name": "setFeesController", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "setLendingFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "loanTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "collateralTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "setLiquidationIncentivePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "pools", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "assets", - "type": "address[]" - } - ], - "name": "setLoanPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newAmount", - "type": "uint256" - } - ], - "name": "setMaxDisagreement", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newAmount", - "type": "uint256" - } - ], - "name": "setMaxSwapSize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newContract", - "type": "address" - } - ], - "name": "setPriceFeedContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newAmount", - "type": "uint256" - } - ], - "name": "setSourceBufferPercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "addrs", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "toggles", - "type": "bool[]" - }, - { - "internalType": "bool", - "name": "withApprovals", - "type": "bool" - } - ], - "name": "setSupportedTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newContract", - "type": "address" - } - ], - "name": "setSwapsImplContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "delta", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "secondsAgo", - "type": "uint32" - } - ], - "name": "setTWAISettings", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string[]", - "name": "sigsArr", - "type": "string[]" - }, - { - "internalType": "address[]", - "name": "targetsArr", - "type": "address[]" - } - ], - "name": "setTargets", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "setTradingFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - } - ], - "name": "settleInterest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "loanToken", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minInitialMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMargin", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLoanTerm", - "type": "uint256" - } - ], - "internalType": "struct IBZx.LoanParams[]", - "name": "loanParamsList", - "type": "tuple[]" - } - ], - "name": "setupLoanParams", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "loanParamsIdList", - "type": "bytes32[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "setupLoanPoolTWAI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "sourceBufferPercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "supportedTokens", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "returnToSender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredDestTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "swapData", - "type": "bytes" - } - ], - "name": "swapExternal", - "outputs": [ - { - "internalType": "uint256", - "name": "destTokenAmountReceived", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmountUsed", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "returnToSender", - "type": "address" - }, - { - "internalType": "address", - "name": "gasTokenUser", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredDestTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "swapData", - "type": "bytes" - } - ], - "name": "swapExternalWithGasToken", - "outputs": [ - { - "internalType": "uint256", - "name": "destTokenAmountReceived", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sourceTokenAmountUsed", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "swapsImpl", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - } - ], - "name": "toggleFunctionUnPause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tradingFeePercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tradingFeeTokensHeld", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "tradingFeeTokensPaid", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferLoan", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "underlyingToLoanPool", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4[]", - "name": "sig", - "type": "bytes4[]" - } - ], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "loanId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - } - ], - "name": "withdrawCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "actualWithdrawAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "enum IBZx.FeeClaimType", - "name": "feeType", - "type": "uint8" - } - ], - "name": "withdrawFees", - "outputs": [ - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ast": { - "absolutePath": "interfaces/IBZx.sol", - "exportedSymbols": { - "IBZx": [1061] - }, - "id": 1062, - "license": "Apache-2.0", - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": ["solidity", ">=", "0.5", ".0", "<", "0.9", ".0"], - "nodeType": "PragmaDirective", - "src": "134:31:0" - }, - { - "id": 2, - "literals": ["experimental", "ABIEncoderV2"], - "nodeType": "PragmaDirective", - "src": "166:33:0" - }, - { - "abstract": false, - "baseContracts": [], - "canonicalName": "IBZx", - "contractDependencies": [], - "contractKind": "interface", - "documentation": { - "id": 3, - "nodeType": "StructuredDocumentation", - "src": "201:200:0", - "text": "@title A proxy interface for The Protocol\n @author bZeroX\n @notice This is just an interface, not to be deployed itself.\n @dev This interface is to be used for the protocol interactions." - }, - "fullyImplemented": false, - "id": 1061, - "linearizedBaseContracts": [1061], - "name": "IBZx", - "nameLocation": "411:4:0", - "nodeType": "ContractDefinition", - "nodes": [ - { - "documentation": { - "id": 4, - "nodeType": "StructuredDocumentation", - "src": "450:97:0", - "text": "@dev adds or replaces existing proxy module\n @param target target proxy module address" - }, - "functionSelector": "fb08fdaa", - "id": 9, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "replaceContract", - "nameLocation": "561:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 7, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 6, - "mutability": "mutable", - "name": "target", - "nameLocation": "585:6:0", - "nodeType": "VariableDeclaration", - "scope": 9, - "src": "577:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "577:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "576:16:0" - }, - "returnParameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [], - "src": "601:0:0" - }, - "scope": 1061, - "src": "552:50:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 10, - "nodeType": "StructuredDocumentation", - "src": "608:242:0", - "text": "@dev updates all proxy modules addreses and function signatures.\n sigsArr and targetsArr should be of equal length\n @param sigsArr array of function signatures\n @param targetsArr array of target proxy module addresses" - }, - "functionSelector": "a012d827", - "id": 19, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setTargets", - "nameLocation": "864:10:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 17, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 13, - "mutability": "mutable", - "name": "sigsArr", - "nameLocation": "902:7:0", - "nodeType": "VariableDeclaration", - "scope": 19, - "src": "884:25:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_string_calldata_ptr_$dyn_calldata_ptr", - "typeString": "string[]" - }, - "typeName": { - "baseType": { - "id": 11, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "884:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "id": 12, - "nodeType": "ArrayTypeName", - "src": "884:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr", - "typeString": "string[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 16, - "mutability": "mutable", - "name": "targetsArr", - "nameLocation": "938:10:0", - "nodeType": "VariableDeclaration", - "scope": 19, - "src": "919:29:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 14, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "919:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 15, - "nodeType": "ArrayTypeName", - "src": "919:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "874:80:0" - }, - "returnParameters": { - "id": 18, - "nodeType": "ParameterList", - "parameters": [], - "src": "963:0:0" - }, - "scope": 1061, - "src": "855:109:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 20, - "nodeType": "StructuredDocumentation", - "src": "970:98:0", - "text": "@dev returns protocol module address given a function signature\n @return module address" - }, - "functionSelector": "da1b620b", - "id": 27, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getTarget", - "nameLocation": "1082:9:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 23, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 22, - "mutability": "mutable", - "name": "sig", - "nameLocation": "1108:3:0", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "1092:19:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_string_calldata_ptr", - "typeString": "string" - }, - "typeName": { - "id": 21, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1092:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "visibility": "internal" - } - ], - "src": "1091:21:0" - }, - "returnParameters": { - "id": 26, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 25, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 27, - "src": "1136:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 24, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1136:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1135:9:0" - }, - "scope": 1061, - "src": "1073:72:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 28, - "nodeType": "StructuredDocumentation", - "src": "1188:185:0", - "text": "@dev sets price feed contract address. The contract on the addres should implement IPriceFeeds interface\n @param newContract module address for the IPriceFeeds implementation" - }, - "functionSelector": "74626404", - "id": 33, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setPriceFeedContract", - "nameLocation": "1387:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 31, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 30, - "mutability": "mutable", - "name": "newContract", - "nameLocation": "1416:11:0", - "nodeType": "VariableDeclaration", - "scope": 33, - "src": "1408:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 29, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1408:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1407:21:0" - }, - "returnParameters": { - "id": 32, - "nodeType": "ParameterList", - "parameters": [], - "src": "1437:0:0" - }, - "scope": 1061, - "src": "1378:60:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 34, - "nodeType": "StructuredDocumentation", - "src": "1444:178:0", - "text": "@dev sets swaps contract address. The contract on the addres should implement ISwapsImpl interface\n @param newContract module address for the ISwapsImpl implementation" - }, - "functionSelector": "1a81c191", - "id": 39, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setSwapsImplContract", - "nameLocation": "1636:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 37, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 36, - "mutability": "mutable", - "name": "newContract", - "nameLocation": "1665:11:0", - "nodeType": "VariableDeclaration", - "scope": 39, - "src": "1657:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 35, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1657:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "1656:21:0" - }, - "returnParameters": { - "id": 38, - "nodeType": "ParameterList", - "parameters": [], - "src": "1686:0:0" - }, - "scope": 1061, - "src": "1627:60:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 40, - "nodeType": "StructuredDocumentation", - "src": "1693:169:0", - "text": "@dev sets loan pool with assets. Accepts two arrays of equal length\n @param pools array of address of pools\n @param assets array of addresses of assets" - }, - "functionSelector": "59e49e0f", - "id": 49, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setLoanPool", - "nameLocation": "1876:11:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 47, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 43, - "mutability": "mutable", - "name": "pools", - "nameLocation": "1907:5:0", - "nodeType": "VariableDeclaration", - "scope": 49, - "src": "1888:24:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 41, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1888:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 42, - "nodeType": "ArrayTypeName", - "src": "1888:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 46, - "mutability": "mutable", - "name": "assets", - "nameLocation": "1933:6:0", - "nodeType": "VariableDeclaration", - "scope": 49, - "src": "1914:25:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 44, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1914:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 45, - "nodeType": "ArrayTypeName", - "src": "1914:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "1887:53:0" - }, - "returnParameters": { - "id": 48, - "nodeType": "ParameterList", - "parameters": [], - "src": "1957:0:0" - }, - "scope": 1061, - "src": "1867:91:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 50, - "nodeType": "StructuredDocumentation", - "src": "1964:304:0", - "text": "@dev updates list of supported tokens, it can be use also to disable or enable particualr token\n @param addrs array of address of pools\n @param toggles array of addresses of assets\n @param withApprovals resets tokens to unlimited approval with the swaps integration (kyber, etc.)" - }, - "functionSelector": "2254b28b", - "id": 61, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setSupportedTokens", - "nameLocation": "2282:18:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 59, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 53, - "mutability": "mutable", - "name": "addrs", - "nameLocation": "2329:5:0", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "2310:24:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 51, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2310:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 52, - "nodeType": "ArrayTypeName", - "src": "2310:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 56, - "mutability": "mutable", - "name": "toggles", - "nameLocation": "2360:7:0", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "2344:23:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_calldata_ptr", - "typeString": "bool[]" - }, - "typeName": { - "baseType": { - "id": 54, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2344:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 55, - "nodeType": "ArrayTypeName", - "src": "2344:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 58, - "mutability": "mutable", - "name": "withApprovals", - "nameLocation": "2382:13:0", - "nodeType": "VariableDeclaration", - "scope": 61, - "src": "2377:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 57, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2377:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "2300:101:0" - }, - "returnParameters": { - "id": 60, - "nodeType": "ParameterList", - "parameters": [], - "src": "2410:0:0" - }, - "scope": 1061, - "src": "2273:138:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 62, - "nodeType": "StructuredDocumentation", - "src": "2417:96:0", - "text": "@dev sets lending fee with WEI_PERCENT_PRECISION\n @param newValue lending fee percent" - }, - "functionSelector": "d238db22", - "id": 67, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setLendingFeePercent", - "nameLocation": "2527:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 65, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 64, - "mutability": "mutable", - "name": "newValue", - "nameLocation": "2556:8:0", - "nodeType": "VariableDeclaration", - "scope": 67, - "src": "2548:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 63, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2548:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2547:18:0" - }, - "returnParameters": { - "id": 66, - "nodeType": "ParameterList", - "parameters": [], - "src": "2574:0:0" - }, - "scope": 1061, - "src": "2518:57:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 68, - "nodeType": "StructuredDocumentation", - "src": "2581:96:0", - "text": "@dev sets trading fee with WEI_PERCENT_PRECISION\n @param newValue trading fee percent" - }, - "functionSelector": "0c615ee9", - "id": 73, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setTradingFeePercent", - "nameLocation": "2691:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 71, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 70, - "mutability": "mutable", - "name": "newValue", - "nameLocation": "2720:8:0", - "nodeType": "VariableDeclaration", - "scope": 73, - "src": "2712:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 69, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2712:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2711:18:0" - }, - "returnParameters": { - "id": 72, - "nodeType": "ParameterList", - "parameters": [], - "src": "2738:0:0" - }, - "scope": 1061, - "src": "2682:57:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 74, - "nodeType": "StructuredDocumentation", - "src": "2745:100:0", - "text": "@dev sets borrowing fee with WEI_PERCENT_PRECISION\n @param newValue borrowing fee percent" - }, - "functionSelector": "17f8b788", - "id": 79, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setBorrowingFeePercent", - "nameLocation": "2859:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 77, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 76, - "mutability": "mutable", - "name": "newValue", - "nameLocation": "2890:8:0", - "nodeType": "VariableDeclaration", - "scope": 79, - "src": "2882:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 75, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2882:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "2881:18:0" - }, - "returnParameters": { - "id": 78, - "nodeType": "ParameterList", - "parameters": [], - "src": "2908:0:0" - }, - "scope": 1061, - "src": "2850:59:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 80, - "nodeType": "StructuredDocumentation", - "src": "2915:100:0", - "text": "@dev sets affiliate fee with WEI_PERCENT_PRECISION\n @param newValue affiliate fee percent" - }, - "functionSelector": "d21f8e24", - "id": 85, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setAffiliateFeePercent", - "nameLocation": "3029:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 83, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 82, - "mutability": "mutable", - "name": "newValue", - "nameLocation": "3060:8:0", - "nodeType": "VariableDeclaration", - "scope": 85, - "src": "3052:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 81, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3052:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3051:18:0" - }, - "returnParameters": { - "id": 84, - "nodeType": "ParameterList", - "parameters": [], - "src": "3078:0:0" - }, - "scope": 1061, - "src": "3020:59:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 86, - "nodeType": "StructuredDocumentation", - "src": "3085:332:0", - "text": "@dev sets liquidation inncetive percent per loan per token. This is the profit percent\n that liquidator gets in the process of liquidating.\n @param loanTokens array list of loan tokens\n @param collateralTokens array list of collateral tokens\n @param amounts array list of liquidation inncetive amount" - }, - "functionSelector": "50372915", - "id": 98, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setLiquidationIncentivePercent", - "nameLocation": "3431:30:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 96, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 89, - "mutability": "mutable", - "name": "loanTokens", - "nameLocation": "3490:10:0", - "nodeType": "VariableDeclaration", - "scope": 98, - "src": "3471:29:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 87, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3471:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 88, - "nodeType": "ArrayTypeName", - "src": "3471:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 92, - "mutability": "mutable", - "name": "collateralTokens", - "nameLocation": "3529:16:0", - "nodeType": "VariableDeclaration", - "scope": 98, - "src": "3510:35:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 90, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3510:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 91, - "nodeType": "ArrayTypeName", - "src": "3510:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 95, - "mutability": "mutable", - "name": "amounts", - "nameLocation": "3574:7:0", - "nodeType": "VariableDeclaration", - "scope": 98, - "src": "3555:26:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 93, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3555:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 94, - "nodeType": "ArrayTypeName", - "src": "3555:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - } - ], - "src": "3461:126:0" - }, - "returnParameters": { - "id": 97, - "nodeType": "ParameterList", - "parameters": [], - "src": "3596:0:0" - }, - "scope": 1061, - "src": "3422:175:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 99, - "nodeType": "StructuredDocumentation", - "src": "3603:102:0", - "text": "@dev sets max swap rate slippage percent.\n @param newAmount max swap rate slippage percent." - }, - "functionSelector": "7fb202e5", - "id": 104, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setMaxDisagreement", - "nameLocation": "3719:18:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 102, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 101, - "mutability": "mutable", - "name": "newAmount", - "nameLocation": "3746:9:0", - "nodeType": "VariableDeclaration", - "scope": 104, - "src": "3738:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 100, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3738:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3737:19:0" - }, - "returnParameters": { - "id": 103, - "nodeType": "ParameterList", - "parameters": [], - "src": "3765:0:0" - }, - "scope": 1061, - "src": "3710:56:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 105, - "nodeType": "StructuredDocumentation", - "src": "3772:8:0", - "text": "TODO" - }, - "functionSelector": "7337ee64", - "id": 110, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setSourceBufferPercent", - "nameLocation": "3794:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 108, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 107, - "mutability": "mutable", - "name": "newAmount", - "nameLocation": "3825:9:0", - "nodeType": "VariableDeclaration", - "scope": 110, - "src": "3817:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 106, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3817:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3816:19:0" - }, - "returnParameters": { - "id": 109, - "nodeType": "ParameterList", - "parameters": [], - "src": "3844:0:0" - }, - "scope": 1061, - "src": "3785:60:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 111, - "nodeType": "StructuredDocumentation", - "src": "3851:95:0", - "text": "@dev sets maximum supported swap size in ETH\n @param newAmount max swap size in ETH." - }, - "functionSelector": "355a395f", - "id": 116, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setMaxSwapSize", - "nameLocation": "3960:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 114, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 113, - "mutability": "mutable", - "name": "newAmount", - "nameLocation": "3983:9:0", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "3975:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 112, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3975:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3974:19:0" - }, - "returnParameters": { - "id": 115, - "nodeType": "ParameterList", - "parameters": [], - "src": "4002:0:0" - }, - "scope": 1061, - "src": "3951:52:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 117, - "nodeType": "StructuredDocumentation", - "src": "4009:100:0", - "text": "@dev sets fee controller address\n @param newController address of the new fees controller" - }, - "functionSelector": "e8997dbd", - "id": 122, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setFeesController", - "nameLocation": "4123:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 120, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 119, - "mutability": "mutable", - "name": "newController", - "nameLocation": "4149:13:0", - "nodeType": "VariableDeclaration", - "scope": 122, - "src": "4141:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 118, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4141:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "4140:23:0" - }, - "returnParameters": { - "id": 121, - "nodeType": "ParameterList", - "parameters": [], - "src": "4172:0:0" - }, - "scope": 1061, - "src": "4114:59:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 123, - "nodeType": "StructuredDocumentation", - "src": "4179:234:0", - "text": "@dev withdraws lending fees to receiver. Only can be called by feesController address\n @param tokens array of token addresses.\n @param receiver fees receiver address\n @return amounts array of amounts withdrawn" - }, - "functionSelector": "3360d3df", - "id": 137, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "withdrawFees", - "nameLocation": "4427:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 126, - "mutability": "mutable", - "name": "tokens", - "nameLocation": "4468:6:0", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "4449:25:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 124, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4449:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 125, - "nodeType": "ArrayTypeName", - "src": "4449:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 128, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "4492:8:0", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "4484:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 127, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4484:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 131, - "mutability": "mutable", - "name": "feeType", - "nameLocation": "4523:7:0", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "4510:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FeeClaimType_$1008", - "typeString": "enum IBZx.FeeClaimType" - }, - "typeName": { - "id": 130, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 129, - "name": "FeeClaimType", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1008, - "src": "4510:12:0" - }, - "referencedDeclaration": 1008, - "src": "4510:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FeeClaimType_$1008", - "typeString": "enum IBZx.FeeClaimType" - } - }, - "visibility": "internal" - } - ], - "src": "4439:97:0" - }, - "returnParameters": { - "id": 136, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 135, - "mutability": "mutable", - "name": "amounts", - "nameLocation": "4572:7:0", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "4555:24:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 133, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4555:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 134, - "nodeType": "ArrayTypeName", - "src": "4555:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - } - ], - "src": "4554:26:0" - }, - "scope": 1061, - "src": "4418:163:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "263e7bf0", - "id": 152, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "queryFees", - "nameLocation": "5542:9:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 144, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 140, - "mutability": "mutable", - "name": "tokens", - "nameLocation": "5571:6:0", - "nodeType": "VariableDeclaration", - "scope": 152, - "src": "5552:25:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 138, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5552:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 139, - "nodeType": "ArrayTypeName", - "src": "5552:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 143, - "mutability": "mutable", - "name": "feeType", - "nameLocation": "5592:7:0", - "nodeType": "VariableDeclaration", - "scope": 152, - "src": "5579:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FeeClaimType_$1008", - "typeString": "enum IBZx.FeeClaimType" - }, - "typeName": { - "id": 142, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 141, - "name": "FeeClaimType", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1008, - "src": "5579:12:0" - }, - "referencedDeclaration": 1008, - "src": "5579:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FeeClaimType_$1008", - "typeString": "enum IBZx.FeeClaimType" - } - }, - "visibility": "internal" - } - ], - "src": "5551:49:0" - }, - "returnParameters": { - "id": 151, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 147, - "mutability": "mutable", - "name": "amountsHeld", - "nameLocation": "5665:11:0", - "nodeType": "VariableDeclaration", - "scope": 152, - "src": "5648:28:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 145, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5648:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ArrayTypeName", - "src": "5648:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 150, - "mutability": "mutable", - "name": "amountsPaid", - "nameLocation": "5695:11:0", - "nodeType": "VariableDeclaration", - "scope": 152, - "src": "5678:28:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 148, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5678:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 149, - "nodeType": "ArrayTypeName", - "src": "5678:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "visibility": "internal" - } - ], - "src": "5647:60:0" - }, - "scope": 1061, - "src": "5533:175:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "78d849ed", - "id": 157, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "priceFeeds", - "nameLocation": "5723:10:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 153, - "nodeType": "ParameterList", - "parameters": [], - "src": "5733:2:0" - }, - "returnParameters": { - "id": 156, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 155, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 157, - "src": "5759:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 154, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5759:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "5758:9:0" - }, - "scope": 1061, - "src": "5714:54:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "7420ca3e", - "id": 162, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "swapsImpl", - "nameLocation": "5783:9:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 158, - "nodeType": "ParameterList", - "parameters": [], - "src": "5792:2:0" - }, - "returnParameters": { - "id": 161, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 160, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 162, - "src": "5818:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 159, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5818:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "5817:9:0" - }, - "scope": 1061, - "src": "5774:53:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "17548b79", - "id": 169, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "logicTargets", - "nameLocation": "5842:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 165, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 164, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 169, - "src": "5855:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 163, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "5855:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "5854:8:0" - }, - "returnParameters": { - "id": 168, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 167, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 169, - "src": "5886:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 166, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5886:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "5885:9:0" - }, - "scope": 1061, - "src": "5833:62:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "c4a90815", - "id": 177, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loans", - "nameLocation": "5910:5:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 172, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 171, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 177, - "src": "5916:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 170, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5916:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "5915:9:0" - }, - "returnParameters": { - "id": 176, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 175, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 177, - "src": "5948:11:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Loan_$1033_memory_ptr", - "typeString": "struct IBZx.Loan" - }, - "typeName": { - "id": 174, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 173, - "name": "Loan", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1033, - "src": "5948:4:0" - }, - "referencedDeclaration": 1033, - "src": "5948:4:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Loan_$1033_storage_ptr", - "typeString": "struct IBZx.Loan" - } - }, - "visibility": "internal" - } - ], - "src": "5947:13:0" - }, - "scope": 1061, - "src": "5901:60:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "cb6eacd1", - "id": 185, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loanParams", - "nameLocation": "5976:10:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 180, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 179, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 185, - "src": "5987:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 178, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5987:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "5986:9:0" - }, - "returnParameters": { - "id": 184, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 183, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 185, - "src": "6019:17:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanParams_$957_memory_ptr", - "typeString": "struct IBZx.LoanParams" - }, - "typeName": { - "id": 182, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 181, - "name": "LoanParams", - "nodeType": "IdentifierPath", - "referencedDeclaration": 957, - "src": "6019:10:0" - }, - "referencedDeclaration": 957, - "src": "6019:10:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanParams_$957_storage_ptr", - "typeString": "struct IBZx.LoanParams" - } - }, - "visibility": "internal" - } - ], - "src": "6018:19:0" - }, - "scope": 1061, - "src": "5967:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "4115a2b6", - "id": 194, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "delegatedManagers", - "nameLocation": "6245:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 190, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 187, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 194, - "src": "6263:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 186, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6263:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 189, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 194, - "src": "6272:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 188, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6272:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6262:18:0" - }, - "returnParameters": { - "id": 193, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 192, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 194, - "src": "6304:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 191, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "6304:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "6303:6:0" - }, - "scope": 1061, - "src": "6236:74:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "62fff3f6", - "id": 204, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "lenderInterest", - "nameLocation": "6325:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 199, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 196, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 204, - "src": "6340:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 195, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6340:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 198, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 204, - "src": "6349:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 197, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6349:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6339:18:0" - }, - "returnParameters": { - "id": 203, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 202, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 204, - "src": "6405:21:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LenderInterest_$1044_memory_ptr", - "typeString": "struct IBZx.LenderInterest" - }, - "typeName": { - "id": 201, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 200, - "name": "LenderInterest", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1044, - "src": "6405:14:0" - }, - "referencedDeclaration": 1044, - "src": "6405:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LenderInterest_$1044_storage_ptr", - "typeString": "struct IBZx.LenderInterest" - } - }, - "visibility": "internal" - } - ], - "src": "6404:23:0" - }, - "scope": 1061, - "src": "6316:112:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "569fc1fb", - "id": 212, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loanInterest", - "nameLocation": "6443:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 207, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 206, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 212, - "src": "6456:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 205, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6456:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "6455:9:0" - }, - "returnParameters": { - "id": 211, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 210, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 212, - "src": "6488:19:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanInterest_$1051_memory_ptr", - "typeString": "struct IBZx.LoanInterest" - }, - "typeName": { - "id": 209, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 208, - "name": "LoanInterest", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1051, - "src": "6488:12:0" - }, - "referencedDeclaration": 1051, - "src": "6488:12:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanInterest_$1051_storage_ptr", - "typeString": "struct IBZx.LoanInterest" - } - }, - "visibility": "internal" - } - ], - "src": "6487:21:0" - }, - "scope": 1061, - "src": "6434:75:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "e8f62764", - "id": 217, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "feesController", - "nameLocation": "6524:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 213, - "nodeType": "ParameterList", - "parameters": [], - "src": "6538:2:0" - }, - "returnParameters": { - "id": 216, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 215, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 217, - "src": "6564:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 214, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6564:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6563:9:0" - }, - "scope": 1061, - "src": "6515:58:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "4699f846", - "id": 222, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "lendingFeePercent", - "nameLocation": "6588:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 218, - "nodeType": "ParameterList", - "parameters": [], - "src": "6605:2:0" - }, - "returnParameters": { - "id": 221, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 220, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 222, - "src": "6631:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 219, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6631:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "6630:9:0" - }, - "scope": 1061, - "src": "6579:61:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "4203e395", - "id": 229, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "lendingFeeTokensHeld", - "nameLocation": "6655:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 225, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 224, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 229, - "src": "6676:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 223, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6676:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6675:9:0" - }, - "returnParameters": { - "id": 228, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 227, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 229, - "src": "6708:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 226, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6708:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "6707:9:0" - }, - "scope": 1061, - "src": "6646:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "92d894f8", - "id": 236, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "lendingFeeTokensPaid", - "nameLocation": "6732:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 232, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 231, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 236, - "src": "6753:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 230, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6753:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6752:9:0" - }, - "returnParameters": { - "id": 235, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 234, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 236, - "src": "6785:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 233, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6785:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "6784:9:0" - }, - "scope": 1061, - "src": "6723:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "edab119f", - "id": 241, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrowingFeePercent", - "nameLocation": "6809:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 237, - "nodeType": "ParameterList", - "parameters": [], - "src": "6828:2:0" - }, - "returnParameters": { - "id": 240, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 239, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 241, - "src": "6854:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 238, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6854:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "6853:9:0" - }, - "scope": 1061, - "src": "6800:63:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b7e15241", - "id": 248, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrowingFeeTokensHeld", - "nameLocation": "6878:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 244, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 243, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 248, - "src": "6901:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 242, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6901:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6900:9:0" - }, - "returnParameters": { - "id": 247, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 246, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 248, - "src": "6933:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 245, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6933:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "6932:9:0" - }, - "scope": 1061, - "src": "6869:73:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b30643d9", - "id": 255, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrowingFeeTokensPaid", - "nameLocation": "6957:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 251, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 250, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 255, - "src": "6980:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 249, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6980:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "6979:9:0" - }, - "returnParameters": { - "id": 254, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 253, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 255, - "src": "7012:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 252, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7012:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7011:9:0" - }, - "scope": 1061, - "src": "6948:73:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "d485045e", - "id": 262, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "tradingFeeTokensHeld", - "nameLocation": "7036:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 258, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 257, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 262, - "src": "7057:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 256, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7057:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7056:9:0" - }, - "returnParameters": { - "id": 261, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 260, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 262, - "src": "7089:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 259, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7089:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7088:9:0" - }, - "scope": 1061, - "src": "7027:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "3452d2d4", - "id": 269, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "tradingFeeTokensPaid", - "nameLocation": "7113:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 265, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 264, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 269, - "src": "7134:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 263, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7134:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7133:9:0" - }, - "returnParameters": { - "id": 268, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 267, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 269, - "src": "7166:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 266, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7166:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7165:9:0" - }, - "scope": 1061, - "src": "7104:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2a324027", - "id": 274, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "tradingFeePercent", - "nameLocation": "7190:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 270, - "nodeType": "ParameterList", - "parameters": [], - "src": "7207:2:0" - }, - "returnParameters": { - "id": 273, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 272, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 274, - "src": "7233:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 271, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7233:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7232:9:0" - }, - "scope": 1061, - "src": "7181:61:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "7a8faeb8", - "id": 279, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "protocolTokenHeld", - "nameLocation": "7257:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 275, - "nodeType": "ParameterList", - "parameters": [], - "src": "7274:2:0" - }, - "returnParameters": { - "id": 278, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 277, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 279, - "src": "7300:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 276, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7300:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7299:9:0" - }, - "scope": 1061, - "src": "7248:61:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2f470764", - "id": 284, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "protocolTokenPaid", - "nameLocation": "7324:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 280, - "nodeType": "ParameterList", - "parameters": [], - "src": "7341:2:0" - }, - "returnParameters": { - "id": 283, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 282, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 284, - "src": "7367:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 281, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7367:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7366:9:0" - }, - "scope": 1061, - "src": "7315:61:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ae0a8530", - "id": 289, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "affiliateFeePercent", - "nameLocation": "7391:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 285, - "nodeType": "ParameterList", - "parameters": [], - "src": "7410:2:0" - }, - "returnParameters": { - "id": 288, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 287, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 289, - "src": "7436:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 286, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7436:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7435:9:0" - }, - "scope": 1061, - "src": "7382:63:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f27451ac", - "id": 298, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "liquidationIncentivePercent", - "nameLocation": "7460:27:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 294, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 291, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "7488:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 290, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7488:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 293, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "7497:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 292, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7497:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7487:18:0" - }, - "returnParameters": { - "id": 297, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 296, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "7553:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 295, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7553:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7552:9:0" - }, - "scope": 1061, - "src": "7451:111:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8dc48ba5", - "id": 305, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "loanPoolToUnderlying", - "nameLocation": "7577:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 301, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 300, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 305, - "src": "7598:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 299, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7598:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7597:9:0" - }, - "returnParameters": { - "id": 304, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 303, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 305, - "src": "7630:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 302, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7630:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7629:9:0" - }, - "scope": 1061, - "src": "7568:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "218b39c6", - "id": 312, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "underlyingToLoanPool", - "nameLocation": "7654:20:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 308, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 307, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 312, - "src": "7675:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 306, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7675:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7674:9:0" - }, - "returnParameters": { - "id": 311, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 310, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 312, - "src": "7707:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 309, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7707:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7706:9:0" - }, - "scope": 1061, - "src": "7645:71:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "68c4ac26", - "id": 319, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "supportedTokens", - "nameLocation": "7731:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 315, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 314, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 319, - "src": "7747:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 313, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7747:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "7746:9:0" - }, - "returnParameters": { - "id": 318, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 317, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 319, - "src": "7779:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 316, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7779:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "7778:6:0" - }, - "scope": 1061, - "src": "7722:63:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "d473c2da", - "id": 324, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "maxDisagreement", - "nameLocation": "7800:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 320, - "nodeType": "ParameterList", - "parameters": [], - "src": "7815:2:0" - }, - "returnParameters": { - "id": 323, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 322, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 324, - "src": "7841:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 321, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7841:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7840:9:0" - }, - "scope": 1061, - "src": "7791:59:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "691bfee8", - "id": 329, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "sourceBufferPercent", - "nameLocation": "7865:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 325, - "nodeType": "ParameterList", - "parameters": [], - "src": "7884:2:0" - }, - "returnParameters": { - "id": 328, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 327, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 329, - "src": "7910:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 326, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7910:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7909:9:0" - }, - "scope": 1061, - "src": "7856:63:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "4f28cac2", - "id": 334, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "maxSwapSize", - "nameLocation": "7934:11:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 330, - "nodeType": "ParameterList", - "parameters": [], - "src": "7945:2:0" - }, - "returnParameters": { - "id": 333, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 332, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 334, - "src": "7971:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 331, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7971:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "7970:9:0" - }, - "scope": 1061, - "src": "7925:55:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 335, - "nodeType": "StructuredDocumentation", - "src": "7986:203:0", - "text": "@dev get list of loan pools in the system. Ordering is not guaranteed\n @param start start index\n @param count number of pools to return\n @return loanPoolsList array of loan pools" - }, - "functionSelector": "402946b9", - "id": 345, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoanPoolsList", - "nameLocation": "8203:16:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 340, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 337, - "mutability": "mutable", - "name": "start", - "nameLocation": "8228:5:0", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "8220:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 336, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8220:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 339, - "mutability": "mutable", - "name": "count", - "nameLocation": "8243:5:0", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "8235:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 338, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8235:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "8219:30:0" - }, - "returnParameters": { - "id": 344, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 343, - "mutability": "mutable", - "name": "loanPoolsList", - "nameLocation": "8314:13:0", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "8297:30:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 341, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8297:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 342, - "nodeType": "ArrayTypeName", - "src": "8297:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - } - ], - "src": "8296:32:0" - }, - "scope": 1061, - "src": "8194:135:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 346, - "nodeType": "StructuredDocumentation", - "src": "8335:79:0", - "text": "@dev checks whether addreess is a loan pool address\n @return boolean" - }, - "functionSelector": "115dd4b1", - "id": 353, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "isLoanPool", - "nameLocation": "8428:10:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 349, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 348, - "mutability": "mutable", - "name": "loanPool", - "nameLocation": "8447:8:0", - "nodeType": "VariableDeclaration", - "scope": 353, - "src": "8439:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 347, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8439:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "8438:18:0" - }, - "returnParameters": { - "id": 352, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 351, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 353, - "src": "8480:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 350, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8480:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "8479:6:0" - }, - "scope": 1061, - "src": "8419:67:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 354, - "nodeType": "StructuredDocumentation", - "src": "8525:149:0", - "text": "@dev creates new loan param settings\n @param loanParamsList array of LoanParams\n @return loanParamsIdList array of loan ids created" - }, - "functionSelector": "a1ae275e", - "id": 364, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setupLoanParams", - "nameLocation": "8688:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 359, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 358, - "mutability": "mutable", - "name": "loanParamsList", - "nameLocation": "8726:14:0", - "nodeType": "VariableDeclaration", - "scope": 364, - "src": "8704:36:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanParams_$957_calldata_ptr_$dyn_calldata_ptr", - "typeString": "struct IBZx.LoanParams[]" - }, - "typeName": { - "baseType": { - "id": 356, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 355, - "name": "LoanParams", - "nodeType": "IdentifierPath", - "referencedDeclaration": 957, - "src": "8704:10:0" - }, - "referencedDeclaration": 957, - "src": "8704:10:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanParams_$957_storage_ptr", - "typeString": "struct IBZx.LoanParams" - } - }, - "id": 357, - "nodeType": "ArrayTypeName", - "src": "8704:12:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanParams_$957_storage_$dyn_storage_ptr", - "typeString": "struct IBZx.LoanParams[]" - } - }, - "visibility": "internal" - } - ], - "src": "8703:38:0" - }, - "returnParameters": { - "id": 363, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 362, - "mutability": "mutable", - "name": "loanParamsIdList", - "nameLocation": "8793:16:0", - "nodeType": "VariableDeclaration", - "scope": 364, - "src": "8776:33:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 360, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8776:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 361, - "nodeType": "ArrayTypeName", - "src": "8776:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "visibility": "internal" - } - ], - "src": "8775:35:0" - }, - "scope": 1061, - "src": "8679:132:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "58b625bd", - "id": 369, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setupLoanPoolTWAI", - "nameLocation": "8826:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 367, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 366, - "mutability": "mutable", - "name": "pool", - "nameLocation": "8852:4:0", - "nodeType": "VariableDeclaration", - "scope": 369, - "src": "8844:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 365, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8844:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "8843:14:0" - }, - "returnParameters": { - "id": 368, - "nodeType": "ParameterList", - "parameters": [], - "src": "8866:0:0" - }, - "scope": 1061, - "src": "8817:50:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ae98b550", - "id": 376, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setTWAISettings", - "nameLocation": "8882:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 374, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 371, - "mutability": "mutable", - "name": "delta", - "nameLocation": "8905:5:0", - "nodeType": "VariableDeclaration", - "scope": 376, - "src": "8898:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 370, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "8898:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 373, - "mutability": "mutable", - "name": "secondsAgo", - "nameLocation": "8919:10:0", - "nodeType": "VariableDeclaration", - "scope": 376, - "src": "8912:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 372, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "8912:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "visibility": "internal" - } - ], - "src": "8897:33:0" - }, - "returnParameters": { - "id": 375, - "nodeType": "ParameterList", - "parameters": [], - "src": "8939:0:0" - }, - "scope": 1061, - "src": "8873:67:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 377, - "nodeType": "StructuredDocumentation", - "src": "8946:137:0", - "text": "@dev Deactivates LoanParams for future loans. Active loans using it are unaffected.\n @param loanParamsIdList array of loan ids" - }, - "functionSelector": "fe30fa6a", - "id": 383, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "disableLoanParams", - "nameLocation": "9097:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 381, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 380, - "mutability": "mutable", - "name": "loanParamsIdList", - "nameLocation": "9134:16:0", - "nodeType": "VariableDeclaration", - "scope": 383, - "src": "9115:35:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_calldata_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 378, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9115:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 379, - "nodeType": "ArrayTypeName", - "src": "9115:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "visibility": "internal" - } - ], - "src": "9114:37:0" - }, - "returnParameters": { - "id": 382, - "nodeType": "ParameterList", - "parameters": [], - "src": "9160:0:0" - }, - "scope": 1061, - "src": "9088:73:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 384, - "nodeType": "StructuredDocumentation", - "src": "9167:147:0", - "text": "@dev gets array of LoanParams by given ids\n @param loanParamsIdList array of loan ids\n @return loanParamsList array of LoanParams" - }, - "functionSelector": "2d9cd076", - "id": 394, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoanParams", - "nameLocation": "9328:13:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 388, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 387, - "mutability": "mutable", - "name": "loanParamsIdList", - "nameLocation": "9361:16:0", - "nodeType": "VariableDeclaration", - "scope": 394, - "src": "9342:35:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_calldata_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 385, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9342:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 386, - "nodeType": "ArrayTypeName", - "src": "9342:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "visibility": "internal" - } - ], - "src": "9341:37:0" - }, - "returnParameters": { - "id": 393, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 392, - "mutability": "mutable", - "name": "loanParamsList", - "nameLocation": "9446:14:0", - "nodeType": "VariableDeclaration", - "scope": 394, - "src": "9426:34:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanParams_$957_memory_ptr_$dyn_memory_ptr", - "typeString": "struct IBZx.LoanParams[]" - }, - "typeName": { - "baseType": { - "id": 390, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 389, - "name": "LoanParams", - "nodeType": "IdentifierPath", - "referencedDeclaration": 957, - "src": "9426:10:0" - }, - "referencedDeclaration": 957, - "src": "9426:10:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanParams_$957_storage_ptr", - "typeString": "struct IBZx.LoanParams" - } - }, - "id": 391, - "nodeType": "ArrayTypeName", - "src": "9426:12:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanParams_$957_storage_$dyn_storage_ptr", - "typeString": "struct IBZx.LoanParams[]" - } - }, - "visibility": "internal" - } - ], - "src": "9425:36:0" - }, - "scope": 1061, - "src": "9319:143:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 395, - "nodeType": "StructuredDocumentation", - "src": "9468:238:0", - "text": "@dev Enumerates LoanParams in the system by owner\n @param owner of the loan params\n @param start number of loans to return\n @param count total number of the items\n @return loanParamsList array of LoanParams" - }, - "functionSelector": "cf59e67b", - "id": 407, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoanParamsList", - "nameLocation": "9720:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 402, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 397, - "mutability": "mutable", - "name": "owner", - "nameLocation": "9755:5:0", - "nodeType": "VariableDeclaration", - "scope": 407, - "src": "9747:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 396, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9747:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 399, - "mutability": "mutable", - "name": "start", - "nameLocation": "9778:5:0", - "nodeType": "VariableDeclaration", - "scope": 407, - "src": "9770:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 398, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9770:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 401, - "mutability": "mutable", - "name": "count", - "nameLocation": "9801:5:0", - "nodeType": "VariableDeclaration", - "scope": 407, - "src": "9793:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 400, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9793:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "9737:75:0" - }, - "returnParameters": { - "id": 406, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 405, - "mutability": "mutable", - "name": "loanParamsList", - "nameLocation": "9853:14:0", - "nodeType": "VariableDeclaration", - "scope": 407, - "src": "9836:31:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 403, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9836:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 404, - "nodeType": "ArrayTypeName", - "src": "9836:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "visibility": "internal" - } - ], - "src": "9835:33:0" - }, - "scope": 1061, - "src": "9711:158:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 408, - "nodeType": "StructuredDocumentation", - "src": "9875:162:0", - "text": "@dev returns total loan principal for token address\n @param lender address\n @param loanToken address\n @return total principal of the loan" - }, - "functionSelector": "4a1e88fe", - "id": 417, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getTotalPrincipal", - "nameLocation": "10051:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 413, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 410, - "mutability": "mutable", - "name": "lender", - "nameLocation": "10077:6:0", - "nodeType": "VariableDeclaration", - "scope": 417, - "src": "10069:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 409, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10069:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 412, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "10093:9:0", - "nodeType": "VariableDeclaration", - "scope": 417, - "src": "10085:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 411, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10085:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "10068:35:0" - }, - "returnParameters": { - "id": 416, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 415, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 417, - "src": "10151:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 414, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10151:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "10150:9:0" - }, - "scope": 1061, - "src": "10042:118:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 418, - "nodeType": "StructuredDocumentation", - "src": "10166:149:0", - "text": "@dev returns total principal for a loan pool that was last settled\n @param pool address\n @return total stored principal of the loan" - }, - "functionSelector": "2af7376a", - "id": 425, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getPoolPrincipalStored", - "nameLocation": "10329:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 421, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 420, - "mutability": "mutable", - "name": "pool", - "nameLocation": "10360:4:0", - "nodeType": "VariableDeclaration", - "scope": 425, - "src": "10352:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 419, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10352:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "10351:14:0" - }, - "returnParameters": { - "id": 424, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 423, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 425, - "src": "10413:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 422, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10413:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "10412:9:0" - }, - "scope": 1061, - "src": "10320:102:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 426, - "nodeType": "StructuredDocumentation", - "src": "10428:140:0", - "text": "@dev returns the last interest rate founnd during interest settlement\n @param pool address\n @return the last interset rate" - }, - "functionSelector": "b87df15a", - "id": 433, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getPoolLastInterestRate", - "nameLocation": "10582:23:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 429, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 428, - "mutability": "mutable", - "name": "pool", - "nameLocation": "10614:4:0", - "nodeType": "VariableDeclaration", - "scope": 433, - "src": "10606:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 427, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10606:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "10605:14:0" - }, - "returnParameters": { - "id": 432, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 431, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 433, - "src": "10667:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 430, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10667:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "10666:9:0" - }, - "scope": 1061, - "src": "10573:103:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 434, - "nodeType": "StructuredDocumentation", - "src": "10715:1270:0", - "text": "@dev This is THE function that borrows or trades on the protocol\n @param loanParamsId id of the LoanParam created beforehand by setupLoanParams function\n @param loanId id of existing loan, if 0, start a new loan\n @param isTorqueLoan boolean whether it is toreque or non torque loan\n @param initialMargin in WEI_PERCENT_PRECISION\n @param sentAddresses array of size 4:\n lender: must match loan if loanId provided\n borrower: must match loan if loanId provided\n receiver: receiver of funds (address(0) assumes borrower address)\n manager: delegated manager of loan unless address(0)\n @param sentValues array of size 5:\n newRate: new loan interest rate\n newPrincipal: new loan size (borrowAmount + any borrowed interest)\n torqueInterest: new amount of interest to escrow for Torque loan (determines initial loan length)\n loanTokenReceived: total loanToken deposit (amount not sent to borrower in the case of Torque loans)\n collateralTokenReceived: total collateralToken deposit\n @param loanDataBytes required when sending ether\n @return principal of the loan and collateral amount" - }, - "functionSelector": "585314cf", - "id": 458, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "borrowOrTradeFromPool", - "nameLocation": "11999:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 453, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 436, - "mutability": "mutable", - "name": "loanParamsId", - "nameLocation": "12038:12:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12030:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 435, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "12030:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 438, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "12068:6:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12060:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 437, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "12060:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 440, - "mutability": "mutable", - "name": "isTorqueLoan", - "nameLocation": "12089:12:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12084:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 439, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "12084:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 442, - "mutability": "mutable", - "name": "initialMargin", - "nameLocation": "12119:13:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12111:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 441, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12111:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 446, - "mutability": "mutable", - "name": "sentAddresses", - "nameLocation": "12162:13:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12142:33:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$4_calldata_ptr", - "typeString": "address[4]" - }, - "typeName": { - "baseType": { - "id": 443, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "12142:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 445, - "length": { - "hexValue": "34", - "id": 444, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12150:1:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "12142:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$4_storage_ptr", - "typeString": "address[4]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 450, - "mutability": "mutable", - "name": "sentValues", - "nameLocation": "12205:10:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12185:30:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$5_calldata_ptr", - "typeString": "uint256[5]" - }, - "typeName": { - "baseType": { - "id": 447, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12185:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 449, - "length": { - "hexValue": "35", - "id": 448, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12193:1:0", - "typeDescriptions": { - "typeIdentifier": "t_rational_5_by_1", - "typeString": "int_const 5" - }, - "value": "5" - }, - "nodeType": "ArrayTypeName", - "src": "12185:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$5_storage_ptr", - "typeString": "uint256[5]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 452, - "mutability": "mutable", - "name": "loanDataBytes", - "nameLocation": "12240:13:0", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12225:28:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 451, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "12225:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "12020:239:0" - }, - "returnParameters": { - "id": 457, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 456, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 458, - "src": "12286:19:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$964_memory_ptr", - "typeString": "struct IBZx.LoanOpenData" - }, - "typeName": { - "id": 455, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 454, - "name": "LoanOpenData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 964, - "src": "12286:12:0" - }, - "referencedDeclaration": 964, - "src": "12286:12:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanOpenData_$964_storage_ptr", - "typeString": "struct IBZx.LoanOpenData" - } - }, - "visibility": "internal" - } - ], - "src": "12285:21:0" - }, - "scope": 1061, - "src": "11990:317:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 459, - "nodeType": "StructuredDocumentation", - "src": "12313:207:0", - "text": "@dev sets/disables/enables the delegated manager for the loan\n @param loanId id of the loan\n @param delegated delegated manager address\n @param toggle boolean set enabled or disabled" - }, - "functionSelector": "33d8991f", - "id": 468, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setDelegatedManager", - "nameLocation": "12534:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 466, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 461, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "12571:6:0", - "nodeType": "VariableDeclaration", - "scope": 468, - "src": "12563:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 460, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "12563:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 463, - "mutability": "mutable", - "name": "delegated", - "nameLocation": "12595:9:0", - "nodeType": "VariableDeclaration", - "scope": 468, - "src": "12587:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 462, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "12587:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 465, - "mutability": "mutable", - "name": "toggle", - "nameLocation": "12619:6:0", - "nodeType": "VariableDeclaration", - "scope": 468, - "src": "12614:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 464, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "12614:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "12553:78:0" - }, - "returnParameters": { - "id": 467, - "nodeType": "ParameterList", - "parameters": [], - "src": "12640:0:0" - }, - "scope": 1061, - "src": "12525:116:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 469, - "nodeType": "StructuredDocumentation", - "src": "12647:398:0", - "text": "@dev calculates required collateral for simulated position\n @param loanToken address of loan token\n @param collateralToken address of collateral token\n @param newPrincipal principal amount of the loan\n @param marginAmount margin amount of the loan\n @param isTorqueLoan boolean torque or non torque loan\n @return collateralAmountRequired amount required" - }, - "functionSelector": "25decac0", - "id": 484, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getRequiredCollateral", - "nameLocation": "13059:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 480, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 471, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "13098:9:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13090:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 470, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "13090:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 473, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "13125:15:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13117:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 472, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "13117:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 475, - "mutability": "mutable", - "name": "newPrincipal", - "nameLocation": "13158:12:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13150:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 474, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13150:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 477, - "mutability": "mutable", - "name": "marginAmount", - "nameLocation": "13188:12:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13180:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 476, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13180:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 479, - "mutability": "mutable", - "name": "isTorqueLoan", - "nameLocation": "13215:12:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13210:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 478, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "13210:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "13080:153:0" - }, - "returnParameters": { - "id": 483, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 482, - "mutability": "mutable", - "name": "collateralAmountRequired", - "nameLocation": "13265:24:0", - "nodeType": "VariableDeclaration", - "scope": 484, - "src": "13257:32:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 481, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13257:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "13256:34:0" - }, - "scope": 1061, - "src": "13050:241:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "13814ca4", - "id": 493, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getRequiredCollateralByParams", - "nameLocation": "13306:29:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 489, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 486, - "mutability": "mutable", - "name": "loanParamsId", - "nameLocation": "13353:12:0", - "nodeType": "VariableDeclaration", - "scope": 493, - "src": "13345:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 485, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "13345:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 488, - "mutability": "mutable", - "name": "newPrincipal", - "nameLocation": "13383:12:0", - "nodeType": "VariableDeclaration", - "scope": 493, - "src": "13375:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 487, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13375:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "13335:66:0" - }, - "returnParameters": { - "id": 492, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 491, - "mutability": "mutable", - "name": "collateralAmountRequired", - "nameLocation": "13433:24:0", - "nodeType": "VariableDeclaration", - "scope": 493, - "src": "13425:32:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 490, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13425:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "13424:34:0" - }, - "scope": 1061, - "src": "13297:162:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 494, - "nodeType": "StructuredDocumentation", - "src": "13465:387:0", - "text": "@dev calculates borrow amount for simulated position\n @param loanToken address of loan token\n @param collateralToken address of collateral token\n @param collateralTokenAmount amount of collateral token sent\n @param marginAmount margin amount\n @param isTorqueLoan boolean torque or non torque loan\n @return borrowAmount possible borrow amount" - }, - "functionSelector": "e762319f", - "id": 509, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getBorrowAmount", - "nameLocation": "13866:15:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 505, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 496, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "13899:9:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "13891:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 495, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "13891:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 498, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "13926:15:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "13918:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 497, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "13918:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 500, - "mutability": "mutable", - "name": "collateralTokenAmount", - "nameLocation": "13959:21:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "13951:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 499, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13951:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 502, - "mutability": "mutable", - "name": "marginAmount", - "nameLocation": "13998:12:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "13990:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 501, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "13990:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 504, - "mutability": "mutable", - "name": "isTorqueLoan", - "nameLocation": "14025:12:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "14020:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 503, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "14020:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "13881:162:0" - }, - "returnParameters": { - "id": 508, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 507, - "mutability": "mutable", - "name": "borrowAmount", - "nameLocation": "14075:12:0", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "14067:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 506, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14067:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "14066:22:0" - }, - "scope": 1061, - "src": "13857:232:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "65df83f6", - "id": 518, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getBorrowAmountByParams", - "nameLocation": "14104:23:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 514, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 511, - "mutability": "mutable", - "name": "loanParamsId", - "nameLocation": "14145:12:0", - "nodeType": "VariableDeclaration", - "scope": 518, - "src": "14137:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 510, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "14137:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 513, - "mutability": "mutable", - "name": "collateralTokenAmount", - "nameLocation": "14175:21:0", - "nodeType": "VariableDeclaration", - "scope": 518, - "src": "14167:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 512, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14167:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "14127:75:0" - }, - "returnParameters": { - "id": 517, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 516, - "mutability": "mutable", - "name": "borrowAmount", - "nameLocation": "14234:12:0", - "nodeType": "VariableDeclaration", - "scope": 518, - "src": "14226:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 515, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14226:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "14225:22:0" - }, - "scope": 1061, - "src": "14095:153:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 519, - "nodeType": "StructuredDocumentation", - "src": "14287:397:0", - "text": "@dev liquidates unhealty loans\n @param loanId id of the loan\n @param receiver address receiving liquidated loan collateral\n @param closeAmount amount to close denominated in loanToken\n @return loanCloseAmount amount of the collateral token of the loan\n @return seizedAmount sezied amount in the collateral token\n @return seizedToken loan token address" - }, - "functionSelector": "e4f3e739", - "id": 534, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "liquidate", - "nameLocation": "14698:9:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 526, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 521, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "14725:6:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14717:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 520, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "14717:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 523, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "14749:8:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14741:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 522, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "14741:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 525, - "mutability": "mutable", - "name": "closeAmount", - "nameLocation": "14775:11:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14767:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 524, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14767:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "14707:85:0" - }, - "returnParameters": { - "id": 533, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 528, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "14864:15:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14856:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 527, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14856:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 530, - "mutability": "mutable", - "name": "seizedAmount", - "nameLocation": "14901:12:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14893:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 529, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "14893:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 532, - "mutability": "mutable", - "name": "seizedToken", - "nameLocation": "14935:11:0", - "nodeType": "VariableDeclaration", - "scope": 534, - "src": "14927:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 531, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "14927:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "14842:114:0" - }, - "scope": 1061, - "src": "14689:268:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 535, - "nodeType": "StructuredDocumentation", - "src": "14963:360:0", - "text": "@dev close position with loan token deposit\n @param loanId id of the loan\n @param receiver collateral token reciever address\n @param depositAmount amount of loan token to deposit\n @return loanCloseAmount loan close amount\n @return withdrawAmount loan token withdraw amount\n @return withdrawToken loan token address" - }, - "functionSelector": "366f513b", - "id": 550, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "closeWithDeposit", - "nameLocation": "15337:16:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 542, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 537, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "15371:6:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15363:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 536, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "15363:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 539, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "15395:8:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15387:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 538, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "15387:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 541, - "mutability": "mutable", - "name": "depositAmount", - "nameLocation": "15421:13:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15413:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 540, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "15413:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "15353:115:0" - }, - "returnParameters": { - "id": 549, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 544, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "15540:15:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15532:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 543, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "15532:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 546, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "15577:14:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15569:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 545, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "15569:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 548, - "mutability": "mutable", - "name": "withdrawToken", - "nameLocation": "15613:13:0", - "nodeType": "VariableDeclaration", - "scope": 550, - "src": "15605:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 547, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "15605:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "15518:118:0" - }, - "scope": 1061, - "src": "15328:309:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 551, - "nodeType": "StructuredDocumentation", - "src": "15643:522:0", - "text": "@dev close position with swap\n @param loanId id of the loan\n @param receiver collateral token reciever address\n @param swapAmount amount of loan token to swap\n @param returnTokenIsCollateral boolean whether to return tokens is collateral\n @param loanDataBytes custom payload for specifying swap implementation and data to pass\n @return loanCloseAmount loan close amount\n @return withdrawAmount loan token withdraw amount\n @return withdrawToken loan token address" - }, - "functionSelector": "f8de21d2", - "id": 570, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "closeWithSwap", - "nameLocation": "16179:13:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 562, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 553, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "16210:6:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16202:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 552, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "16202:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 555, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "16234:8:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16226:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 554, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "16226:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 557, - "mutability": "mutable", - "name": "swapAmount", - "nameLocation": "16260:10:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16252:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "16252:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 559, - "mutability": "mutable", - "name": "returnTokenIsCollateral", - "nameLocation": "16319:23:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16314:28:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 558, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "16314:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 561, - "mutability": "mutable", - "name": "loanDataBytes", - "nameLocation": "16430:13:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16415:28:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 560, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "16415:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "16192:257:0" - }, - "returnParameters": { - "id": 569, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 564, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "16505:15:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16497:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 563, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "16497:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 566, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "16542:14:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16534:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 565, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "16534:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 568, - "mutability": "mutable", - "name": "withdrawToken", - "nameLocation": "16578:13:0", - "nodeType": "VariableDeclaration", - "scope": 570, - "src": "16570:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 567, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "16570:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "16483:118:0" - }, - "scope": 1061, - "src": "16170:432:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 571, - "nodeType": "StructuredDocumentation", - "src": "16656:438:0", - "text": "@dev liquidates unhealty loans by using Gas token\n @param loanId id of the loan\n @param receiver address receiving liquidated loan collateral\n @param gasTokenUser user address of the GAS token\n @param closeAmount amount to close denominated in loanToken\n @return loanCloseAmount loan close amount\n @return seizedAmount loan token withdraw amount\n @return seizedToken loan token address" - }, - "functionSelector": "1b95e628", - "id": 588, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "liquidateWithGasToken", - "nameLocation": "17108:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 580, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 573, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "17147:6:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17139:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 572, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "17139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 575, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "17171:8:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17163:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 574, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "17163:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 577, - "mutability": "mutable", - "name": "gasTokenUser", - "nameLocation": "17197:12:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17189:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 576, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "17189:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 579, - "mutability": "mutable", - "name": "closeAmount", - "nameLocation": "17227:11:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17219:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 578, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "17219:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "17129:143:0" - }, - "returnParameters": { - "id": 587, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 582, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "17344:15:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17336:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 581, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "17336:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 584, - "mutability": "mutable", - "name": "seizedAmount", - "nameLocation": "17381:12:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17373:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 583, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "17373:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 586, - "mutability": "mutable", - "name": "seizedToken", - "nameLocation": "17415:11:0", - "nodeType": "VariableDeclaration", - "scope": 588, - "src": "17407:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 585, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "17407:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "17322:114:0" - }, - "scope": 1061, - "src": "17099:338:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 589, - "nodeType": "StructuredDocumentation", - "src": "17443:443:0", - "text": "@dev close position with loan token deposit\n @param loanId id of the loan\n @param receiver collateral token reciever address\n @param gasTokenUser user address of the GAS token\n @param depositAmount amount of loan token to deposit denominated in loanToken\n @return loanCloseAmount loan close amount\n @return withdrawAmount loan token withdraw amount\n @return withdrawToken loan token address" - }, - "functionSelector": "596df685", - "id": 606, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "closeWithDepositWithGasToken", - "nameLocation": "17900:28:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 598, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "17946:6:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "17938:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 590, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "17938:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 593, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "17970:8:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "17962:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 592, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "17962:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 595, - "mutability": "mutable", - "name": "gasTokenUser", - "nameLocation": "17996:12:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "17988:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 594, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "17988:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 597, - "mutability": "mutable", - "name": "depositAmount", - "nameLocation": "18026:13:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "18018:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 596, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "18018:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "17928:117:0" - }, - "returnParameters": { - "id": 605, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "18117:15:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "18109:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "18109:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 602, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "18154:14:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "18146:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 601, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "18146:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 604, - "mutability": "mutable", - "name": "withdrawToken", - "nameLocation": "18190:13:0", - "nodeType": "VariableDeclaration", - "scope": 606, - "src": "18182:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 603, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "18182:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "18095:118:0" - }, - "scope": 1061, - "src": "17891:323:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 607, - "nodeType": "StructuredDocumentation", - "src": "18220:529:0", - "text": "@dev close position with swap\n @param loanId id of the loan\n @param receiver collateral token reciever address\n @param gasTokenUser user address of the GAS token\n @param swapAmount amount of loan token to swap denominated in collateralToken\n @param returnTokenIsCollateral true: withdraws collateralToken, false: withdraws loanToken\n @return loanCloseAmount loan close amount\n @return withdrawAmount loan token withdraw amount\n @return withdrawToken loan token address" - }, - "functionSelector": "cf662a53", - "id": 628, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "closeWithSwapWithGasToken", - "nameLocation": "18763:25:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 620, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 609, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "18806:6:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18798:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 608, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "18798:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 611, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "18830:8:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18822:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 610, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "18822:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 613, - "mutability": "mutable", - "name": "gasTokenUser", - "nameLocation": "18856:12:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18848:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 612, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "18848:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 615, - "mutability": "mutable", - "name": "swapAmount", - "nameLocation": "18886:10:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18878:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 614, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "18878:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 617, - "mutability": "mutable", - "name": "returnTokenIsCollateral", - "nameLocation": "18911:23:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18906:28:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 616, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "18906:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 619, - "mutability": "mutable", - "name": "loanDataBytes", - "nameLocation": "18959:13:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "18944:28:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 618, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "18944:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "18788:190:0" - }, - "returnParameters": { - "id": 627, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 622, - "mutability": "mutable", - "name": "loanCloseAmount", - "nameLocation": "19034:15:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "19026:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 621, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "19026:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 624, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "19071:14:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "19063:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 623, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "19063:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 626, - "mutability": "mutable", - "name": "withdrawToken", - "nameLocation": "19107:13:0", - "nodeType": "VariableDeclaration", - "scope": 628, - "src": "19099:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 625, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "19099:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "19012:118:0" - }, - "scope": 1061, - "src": "18754:377:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 629, - "nodeType": "StructuredDocumentation", - "src": "19173:174:0", - "text": "@dev deposit collateral to existing loan\n @param loanId existing loan id\n @param depositAmount amount to deposit which must match msg.value if ether is sent" - }, - "functionSelector": "dea9b464", - "id": 636, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "depositCollateral", - "nameLocation": "19361:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 634, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 631, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "19387:6:0", - "nodeType": "VariableDeclaration", - "scope": 636, - "src": "19379:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 630, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "19379:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 633, - "mutability": "mutable", - "name": "depositAmount", - "nameLocation": "19403:13:0", - "nodeType": "VariableDeclaration", - "scope": 636, - "src": "19395:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 632, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "19395:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "19378:39:0" - }, - "returnParameters": { - "id": 635, - "nodeType": "ParameterList", - "parameters": [], - "src": "19450:0:0" - }, - "scope": 1061, - "src": "19352:99:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 637, - "nodeType": "StructuredDocumentation", - "src": "19457:248:0", - "text": "@dev withdraw collateral from existing loan\n @param loanId existing loan id\n @param receiver address of withdrawn tokens\n @param withdrawAmount amount to withdraw\n @return actualWithdrawAmount actual amount withdrawn" - }, - "functionSelector": "db35400d", - "id": 648, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "withdrawCollateral", - "nameLocation": "19719:18:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 644, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 639, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "19755:6:0", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "19747:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 638, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "19747:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 641, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "19779:8:0", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "19771:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 640, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "19771:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 643, - "mutability": "mutable", - "name": "withdrawAmount", - "nameLocation": "19805:14:0", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "19797:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 642, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "19797:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "19737:88:0" - }, - "returnParameters": { - "id": 647, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 646, - "mutability": "mutable", - "name": "actualWithdrawAmount", - "nameLocation": "19852:20:0", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "19844:28:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 645, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "19844:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "19843:30:0" - }, - "scope": 1061, - "src": "19710:164:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 649, - "nodeType": "StructuredDocumentation", - "src": "19880:110:0", - "text": "@dev settles accrued interest for all active loans from a loan pool\n @param loanId existing loan id" - }, - "functionSelector": "f136f37e", - "id": 654, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "settleInterest", - "nameLocation": "20004:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 652, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 651, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "20027:6:0", - "nodeType": "VariableDeclaration", - "scope": 654, - "src": "20019:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 650, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "20019:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "20018:16:0" - }, - "returnParameters": { - "id": 653, - "nodeType": "ParameterList", - "parameters": [], - "src": "20043:0:0" - }, - "scope": 1061, - "src": "19995:49:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b1bb8225", - "id": 663, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "setDepositAmount", - "nameLocation": "20059:16:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 661, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 656, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "20093:6:0", - "nodeType": "VariableDeclaration", - "scope": 663, - "src": "20085:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 655, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "20085:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 658, - "mutability": "mutable", - "name": "depositValueAsLoanToken", - "nameLocation": "20117:23:0", - "nodeType": "VariableDeclaration", - "scope": 663, - "src": "20109:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 657, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20109:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 660, - "mutability": "mutable", - "name": "depositValueAsCollateralToken", - "nameLocation": "20158:29:0", - "nodeType": "VariableDeclaration", - "scope": 663, - "src": "20150:37:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 659, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20150:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "20075:118:0" - }, - "returnParameters": { - "id": 662, - "nodeType": "ParameterList", - "parameters": [], - "src": "20202:0:0" - }, - "scope": 1061, - "src": "20050:153:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2d7af0f4", - "id": 670, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferLoan", - "nameLocation": "20218:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 668, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 665, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "20239:6:0", - "nodeType": "VariableDeclaration", - "scope": 670, - "src": "20231:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 664, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "20231:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 667, - "mutability": "mutable", - "name": "newOwner", - "nameLocation": "20255:8:0", - "nodeType": "VariableDeclaration", - "scope": 670, - "src": "20247:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 666, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "20247:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "20230:34:0" - }, - "returnParameters": { - "id": 669, - "nodeType": "ParameterList", - "parameters": [], - "src": "20273:0:0" - }, - "scope": 1061, - "src": "20209:65:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ef5cfb8c", - "id": 677, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "claimRewards", - "nameLocation": "20367:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 673, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 672, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "20388:8:0", - "nodeType": "VariableDeclaration", - "scope": 677, - "src": "20380:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 671, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "20380:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "20379:18:0" - }, - "returnParameters": { - "id": 676, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 675, - "mutability": "mutable", - "name": "claimAmount", - "nameLocation": "20440:11:0", - "nodeType": "VariableDeclaration", - "scope": 677, - "src": "20432:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 674, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20432:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "20431:21:0" - }, - "scope": 1061, - "src": "20358:95:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "33dc41c7", - "id": 684, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "rewardsBalanceOf", - "nameLocation": "20546:16:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 680, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 679, - "mutability": "mutable", - "name": "user", - "nameLocation": "20571:4:0", - "nodeType": "VariableDeclaration", - "scope": 684, - "src": "20563:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 678, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "20563:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "20562:14:0" - }, - "returnParameters": { - "id": 683, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 682, - "mutability": "mutable", - "name": "rewardsBalance", - "nameLocation": "20632:14:0", - "nodeType": "VariableDeclaration", - "scope": 684, - "src": "20624:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 681, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20624:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "20623:24:0" - }, - "scope": 1061, - "src": "20537:111:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "448c0ec9", - "id": 707, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getInterestModelValues", - "nameLocation": "20663:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 689, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 686, - "mutability": "mutable", - "name": "pool", - "nameLocation": "20703:4:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20695:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 685, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "20695:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 688, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "20725:6:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20717:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 687, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "20717:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "20685:47:0" - }, - "returnParameters": { - "id": 706, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 691, - "mutability": "mutable", - "name": "_poolLastUpdateTime", - "nameLocation": "20797:19:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20789:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 690, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20789:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 693, - "mutability": "mutable", - "name": "_poolPrincipalTotal", - "nameLocation": "20834:19:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20826:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 692, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20826:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 695, - "mutability": "mutable", - "name": "_poolInterestTotal", - "nameLocation": "20871:18:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20863:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 694, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20863:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 697, - "mutability": "mutable", - "name": "_poolRatePerTokenStored", - "nameLocation": "20907:23:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20899:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 696, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20899:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 699, - "mutability": "mutable", - "name": "_poolLastInterestRate", - "nameLocation": "20948:21:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20940:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 698, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20940:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 701, - "mutability": "mutable", - "name": "_loanPrincipalTotal", - "nameLocation": "20987:19:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "20979:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 700, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "20979:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 703, - "mutability": "mutable", - "name": "_loanInterestTotal", - "nameLocation": "21024:18:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "21016:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 702, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "21016:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 705, - "mutability": "mutable", - "name": "_loanRatePerTokenPaid", - "nameLocation": "21060:21:0", - "nodeType": "VariableDeclaration", - "scope": 707, - "src": "21052:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 704, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "21052:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "20779:312:0" - }, - "scope": 1061, - "src": "20654:438:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "b283162a", - "id": 714, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getTWAI", - "nameLocation": "21111:7:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 710, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 709, - "mutability": "mutable", - "name": "pool", - "nameLocation": "21136:4:0", - "nodeType": "VariableDeclaration", - "scope": 714, - "src": "21128:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 708, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "21128:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "21118:23:0" - }, - "returnParameters": { - "id": 713, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 712, - "mutability": "mutable", - "name": "benchmarkRate", - "nameLocation": "21202:13:0", - "nodeType": "VariableDeclaration", - "scope": 714, - "src": "21194:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 711, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "21194:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "21180:45:0" - }, - "scope": 1061, - "src": "21102:124:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 715, - "nodeType": "StructuredDocumentation", - "src": "21232:474:0", - "text": "@dev gets list of loans of particular user address\n @param user address of the loans\n @param start of the index\n @param count number of loans to return\n @param loanType type of the loan: All(0), Margin(1), NonMargin(2)\n @param isLender whether to list lender loans or borrower loans\n @param unsafeOnly booleat if true return only unsafe loans that are open for liquidation\n @return loansData LoanReturnData array of loans" - }, - "functionSelector": "369ed072", - "id": 735, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getUserLoans", - "nameLocation": "21720:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 729, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 717, - "mutability": "mutable", - "name": "user", - "nameLocation": "21750:4:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21742:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 716, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "21742:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 719, - "mutability": "mutable", - "name": "start", - "nameLocation": "21772:5:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21764:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 718, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "21764:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 721, - "mutability": "mutable", - "name": "count", - "nameLocation": "21795:5:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21787:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 720, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "21787:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 724, - "mutability": "mutable", - "name": "loanType", - "nameLocation": "21819:8:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21810:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_LoanType_$968", - "typeString": "enum IBZx.LoanType" - }, - "typeName": { - "id": 723, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 722, - "name": "LoanType", - "nodeType": "IdentifierPath", - "referencedDeclaration": 968, - "src": "21810:8:0" - }, - "referencedDeclaration": 968, - "src": "21810:8:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_LoanType_$968", - "typeString": "enum IBZx.LoanType" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 726, - "mutability": "mutable", - "name": "isLender", - "nameLocation": "21842:8:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21837:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 725, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "21837:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 728, - "mutability": "mutable", - "name": "unsafeOnly", - "nameLocation": "21865:10:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21860:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 727, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "21860:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "21732:149:0" - }, - "returnParameters": { - "id": 734, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 733, - "mutability": "mutable", - "name": "loansData", - "nameLocation": "21929:9:0", - "nodeType": "VariableDeclaration", - "scope": 735, - "src": "21905:33:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_memory_ptr_$dyn_memory_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - }, - "typeName": { - "baseType": { - "id": 731, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 730, - "name": "LoanReturnData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1003, - "src": "21905:14:0" - }, - "referencedDeclaration": 1003, - "src": "21905:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanReturnData_$1003_storage_ptr", - "typeString": "struct IBZx.LoanReturnData" - } - }, - "id": 732, - "nodeType": "ArrayTypeName", - "src": "21905:16:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_storage_$dyn_storage_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - } - }, - "visibility": "internal" - } - ], - "src": "21904:35:0" - }, - "scope": 1061, - "src": "21711:229:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ab3bd428", - "id": 744, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getUserLoansCount", - "nameLocation": "21955:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 740, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 737, - "mutability": "mutable", - "name": "user", - "nameLocation": "21981:4:0", - "nodeType": "VariableDeclaration", - "scope": 744, - "src": "21973:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 736, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "21973:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 739, - "mutability": "mutable", - "name": "isLender", - "nameLocation": "21992:8:0", - "nodeType": "VariableDeclaration", - "scope": 744, - "src": "21987:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 738, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "21987:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "21972:29:0" - }, - "returnParameters": { - "id": 743, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 742, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 744, - "src": "22049:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 741, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "22049:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "22048:9:0" - }, - "scope": 1061, - "src": "21946:112:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 745, - "nodeType": "StructuredDocumentation", - "src": "22064:109:0", - "text": "@dev gets existing loan\n @param loanId id of existing loan\n @return loanData array of loans" - }, - "functionSelector": "8932f5f7", - "id": 753, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoan", - "nameLocation": "22187:7:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 748, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 747, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "22203:6:0", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "22195:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 746, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "22195:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "22194:16:0" - }, - "returnParameters": { - "id": 752, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 751, - "mutability": "mutable", - "name": "loanData", - "nameLocation": "22280:8:0", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "22258:30:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanReturnData_$1003_memory_ptr", - "typeString": "struct IBZx.LoanReturnData" - }, - "typeName": { - "id": 750, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 749, - "name": "LoanReturnData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1003, - "src": "22258:14:0" - }, - "referencedDeclaration": 1003, - "src": "22258:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanReturnData_$1003_storage_ptr", - "typeString": "struct IBZx.LoanReturnData" - } - }, - "visibility": "internal" - } - ], - "src": "22257:32:0" - }, - "scope": 1061, - "src": "22178:112:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 754, - "nodeType": "StructuredDocumentation", - "src": "22296:115:0", - "text": "@dev gets loan principal including interest\n @param loanId id of existing loan\n @return principal" - }, - "functionSelector": "90e06dc0", - "id": 761, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoanPrincipal", - "nameLocation": "22425:16:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 757, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 756, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "22450:6:0", - "nodeType": "VariableDeclaration", - "scope": 761, - "src": "22442:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 755, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "22442:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "22441:16:0" - }, - "returnParameters": { - "id": 760, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 759, - "mutability": "mutable", - "name": "principal", - "nameLocation": "22513:9:0", - "nodeType": "VariableDeclaration", - "scope": 761, - "src": "22505:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 758, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "22505:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "22504:19:0" - }, - "scope": 1061, - "src": "22416:108:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 762, - "nodeType": "StructuredDocumentation", - "src": "22530:106:0", - "text": "@dev gets loan outstanding interest\n @param loanId id of existing loan\n @return interest" - }, - "functionSelector": "2b81cf6a", - "id": 769, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getLoanInterestOutstanding", - "nameLocation": "22650:26:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 765, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 764, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "22685:6:0", - "nodeType": "VariableDeclaration", - "scope": 769, - "src": "22677:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 763, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "22677:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - } - ], - "src": "22676:16:0" - }, - "returnParameters": { - "id": 768, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 767, - "mutability": "mutable", - "name": "interest", - "nameLocation": "22748:8:0", - "nodeType": "VariableDeclaration", - "scope": 769, - "src": "22740:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 766, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "22740:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "22739:18:0" - }, - "scope": 1061, - "src": "22641:117:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 770, - "nodeType": "StructuredDocumentation", - "src": "22765:217:0", - "text": "@dev get current active loans in the system\n @param start of the index\n @param count number of loans to return\n @param unsafeOnly boolean if true return unsafe loan only (open for liquidation)" - }, - "functionSelector": "60857c2c", - "id": 783, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getActiveLoans", - "nameLocation": "22996:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 777, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 772, - "mutability": "mutable", - "name": "start", - "nameLocation": "23028:5:0", - "nodeType": "VariableDeclaration", - "scope": 783, - "src": "23020:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 771, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "23020:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 774, - "mutability": "mutable", - "name": "count", - "nameLocation": "23051:5:0", - "nodeType": "VariableDeclaration", - "scope": 783, - "src": "23043:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 773, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "23043:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 776, - "mutability": "mutable", - "name": "unsafeOnly", - "nameLocation": "23071:10:0", - "nodeType": "VariableDeclaration", - "scope": 783, - "src": "23066:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 775, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "23066:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "23010:77:0" - }, - "returnParameters": { - "id": 782, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 781, - "mutability": "mutable", - "name": "loansData", - "nameLocation": "23135:9:0", - "nodeType": "VariableDeclaration", - "scope": 783, - "src": "23111:33:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_memory_ptr_$dyn_memory_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - }, - "typeName": { - "baseType": { - "id": 779, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 778, - "name": "LoanReturnData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1003, - "src": "23111:14:0" - }, - "referencedDeclaration": 1003, - "src": "23111:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanReturnData_$1003_storage_ptr", - "typeString": "struct IBZx.LoanReturnData" - } - }, - "id": 780, - "nodeType": "ArrayTypeName", - "src": "23111:16:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_storage_$dyn_storage_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - } - }, - "visibility": "internal" - } - ], - "src": "23110:35:0" - }, - "scope": 1061, - "src": "22987:159:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 784, - "nodeType": "StructuredDocumentation", - "src": "23152:294:0", - "text": "@dev get current active loans in the system\n @param start of the index\n @param count number of loans to return\n @param unsafeOnly boolean if true return unsafe loan only (open for liquidation)\n @param isLiquidatable boolean if true return liquidatable loans only" - }, - "functionSelector": "c43b962f", - "id": 799, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getActiveLoansAdvanced", - "nameLocation": "23460:22:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 793, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 786, - "mutability": "mutable", - "name": "start", - "nameLocation": "23500:5:0", - "nodeType": "VariableDeclaration", - "scope": 799, - "src": "23492:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 785, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "23492:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 788, - "mutability": "mutable", - "name": "count", - "nameLocation": "23523:5:0", - "nodeType": "VariableDeclaration", - "scope": 799, - "src": "23515:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 787, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "23515:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 790, - "mutability": "mutable", - "name": "unsafeOnly", - "nameLocation": "23543:10:0", - "nodeType": "VariableDeclaration", - "scope": 799, - "src": "23538:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 789, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "23538:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 792, - "mutability": "mutable", - "name": "isLiquidatable", - "nameLocation": "23568:14:0", - "nodeType": "VariableDeclaration", - "scope": 799, - "src": "23563:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 791, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "23563:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "23482:106:0" - }, - "returnParameters": { - "id": 798, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 797, - "mutability": "mutable", - "name": "loansData", - "nameLocation": "23636:9:0", - "nodeType": "VariableDeclaration", - "scope": 799, - "src": "23612:33:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_memory_ptr_$dyn_memory_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - }, - "typeName": { - "baseType": { - "id": 795, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 794, - "name": "LoanReturnData", - "nodeType": "IdentifierPath", - "referencedDeclaration": 1003, - "src": "23612:14:0" - }, - "referencedDeclaration": 1003, - "src": "23612:14:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LoanReturnData_$1003_storage_ptr", - "typeString": "struct IBZx.LoanReturnData" - } - }, - "id": 796, - "nodeType": "ArrayTypeName", - "src": "23612:16:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_LoanReturnData_$1003_storage_$dyn_storage_ptr", - "typeString": "struct IBZx.LoanReturnData[]" - } - }, - "visibility": "internal" - } - ], - "src": "23611:35:0" - }, - "scope": 1061, - "src": "23451:196:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "51c4e7b2", - "id": 804, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getActiveLoansCount", - "nameLocation": "23662:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 800, - "nodeType": "ParameterList", - "parameters": [], - "src": "23681:2:0" - }, - "returnParameters": { - "id": 803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 802, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 804, - "src": "23707:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 801, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "23707:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "23706:9:0" - }, - "scope": 1061, - "src": "23653:63:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 805, - "nodeType": "StructuredDocumentation", - "src": "23755:499:0", - "text": "@dev swap thru external integration\n @param sourceToken source token address\n @param destToken destintaion token address\n @param receiver address to receive tokens\n @param returnToSender TODO\n @param sourceTokenAmount source token amount\n @param requiredDestTokenAmount destination token amount\n @param swapData TODO\n @return destTokenAmountReceived destination token received\n @return sourceTokenAmountUsed source token amount used" - }, - "functionSelector": "11058a8a", - "id": 826, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "swapExternal", - "nameLocation": "24268:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 820, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 807, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "24298:11:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24290:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 806, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "24290:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 809, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "24327:9:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24319:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 808, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "24319:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 811, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "24354:8:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24346:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 810, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "24346:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 813, - "mutability": "mutable", - "name": "returnToSender", - "nameLocation": "24380:14:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24372:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 812, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "24372:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 815, - "mutability": "mutable", - "name": "sourceTokenAmount", - "nameLocation": "24412:17:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24404:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 814, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "24404:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 817, - "mutability": "mutable", - "name": "requiredDestTokenAmount", - "nameLocation": "24447:23:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24439:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 816, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "24439:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 819, - "mutability": "mutable", - "name": "swapData", - "nameLocation": "24495:8:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24480:23:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 818, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "24480:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "24280:229:0" - }, - "returnParameters": { - "id": 825, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 822, - "mutability": "mutable", - "name": "destTokenAmountReceived", - "nameLocation": "24581:23:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24573:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 821, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "24573:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 824, - "mutability": "mutable", - "name": "sourceTokenAmountUsed", - "nameLocation": "24626:21:0", - "nodeType": "VariableDeclaration", - "scope": 826, - "src": "24618:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 823, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "24618:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "24559:98:0" - }, - "scope": 1061, - "src": "24259:399:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 827, - "nodeType": "StructuredDocumentation", - "src": "24664:567:0", - "text": "@dev swap thru external integration using GAS\n @param sourceToken source token address\n @param destToken destintaion token address\n @param receiver address to receive tokens\n @param returnToSender TODO\n @param gasTokenUser user address of the GAS token\n @param sourceTokenAmount source token amount\n @param requiredDestTokenAmount destination token amount\n @param swapData TODO\n @return destTokenAmountReceived destination token received\n @return sourceTokenAmountUsed source token amount used" - }, - "functionSelector": "8b12c490", - "id": 850, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "swapExternalWithGasToken", - "nameLocation": "25245:24:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 844, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 829, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "25287:11:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25279:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 828, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "25279:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 831, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "25316:9:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25308:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 830, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "25308:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 833, - "mutability": "mutable", - "name": "receiver", - "nameLocation": "25343:8:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25335:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 832, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "25335:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 835, - "mutability": "mutable", - "name": "returnToSender", - "nameLocation": "25369:14:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25361:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 834, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "25361:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 837, - "mutability": "mutable", - "name": "gasTokenUser", - "nameLocation": "25401:12:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25393:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 836, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "25393:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 839, - "mutability": "mutable", - "name": "sourceTokenAmount", - "nameLocation": "25431:17:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25423:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 838, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "25423:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 841, - "mutability": "mutable", - "name": "requiredDestTokenAmount", - "nameLocation": "25466:23:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25458:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 840, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "25458:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 843, - "mutability": "mutable", - "name": "swapData", - "nameLocation": "25514:8:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25499:23:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 842, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "25499:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "25269:259:0" - }, - "returnParameters": { - "id": 849, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 846, - "mutability": "mutable", - "name": "destTokenAmountReceived", - "nameLocation": "25600:23:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25592:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 845, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "25592:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 848, - "mutability": "mutable", - "name": "sourceTokenAmountUsed", - "nameLocation": "25645:21:0", - "nodeType": "VariableDeclaration", - "scope": 850, - "src": "25637:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 847, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "25637:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "25578:98:0" - }, - "scope": 1061, - "src": "25236:441:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 851, - "nodeType": "StructuredDocumentation", - "src": "25683:250:0", - "text": "@dev calculate simulated return of swap\n @param sourceToken source token address\n @param destToken destination token address\n @param sourceTokenAmount source token amount\n @return amoun denominated in destination token" - }, - "functionSelector": "2fa1c94a", - "id": 864, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getSwapExpectedReturn", - "nameLocation": "26000:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 860, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 853, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "26039:11:0", - "nodeType": "VariableDeclaration", - "scope": 864, - "src": "26031:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 852, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26031:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 855, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "26068:9:0", - "nodeType": "VariableDeclaration", - "scope": 864, - "src": "26060:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 854, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26060:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 857, - "mutability": "mutable", - "name": "sourceTokenAmount", - "nameLocation": "26095:17:0", - "nodeType": "VariableDeclaration", - "scope": 864, - "src": "26087:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 856, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "26087:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 859, - "mutability": "mutable", - "name": "swapData", - "nameLocation": "26137:8:0", - "nodeType": "VariableDeclaration", - "scope": 864, - "src": "26122:23:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 858, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "26122:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "26021:130:0" - }, - "returnParameters": { - "id": 863, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 862, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 864, - "src": "26175:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 861, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "26175:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "26174:9:0" - }, - "scope": 1061, - "src": "25991:193:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "6c9f064c", - "id": 879, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getSwapExpectedReturn", - "nameLocation": "26199:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 875, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 866, - "mutability": "mutable", - "name": "trader", - "nameLocation": "26238:6:0", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26230:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 865, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26230:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 868, - "mutability": "mutable", - "name": "sourceToken", - "nameLocation": "26262:11:0", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26254:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 867, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26254:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 870, - "mutability": "mutable", - "name": "destToken", - "nameLocation": "26291:9:0", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26283:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 869, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26283:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 872, - "mutability": "mutable", - "name": "sourceTokenAmount", - "nameLocation": "26318:17:0", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26310:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 871, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "26310:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 874, - "mutability": "mutable", - "name": "payload", - "nameLocation": "26360:7:0", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26345:22:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 873, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "26345:5:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "visibility": "internal" - } - ], - "src": "26220:148:0" - }, - "returnParameters": { - "id": 878, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 877, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 879, - "src": "26403:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 876, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "26403:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "26402:9:0" - }, - "scope": 1061, - "src": "26190:222:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "8da5cb5b", - "id": 884, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "owner", - "nameLocation": "26427:5:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 880, - "nodeType": "ParameterList", - "parameters": [], - "src": "26432:2:0" - }, - "returnParameters": { - "id": 883, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 882, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 884, - "src": "26458:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 881, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26458:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "26457:9:0" - }, - "scope": 1061, - "src": "26418:49:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f2fde38b", - "id": 889, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "transferOwnership", - "nameLocation": "26482:17:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 887, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 886, - "mutability": "mutable", - "name": "newOwner", - "nameLocation": "26508:8:0", - "nodeType": "VariableDeclaration", - "scope": 889, - "src": "26500:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 885, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26500:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "26499:18:0" - }, - "returnParameters": { - "id": 888, - "nodeType": "ParameterList", - "parameters": [], - "src": "26526:0:0" - }, - "scope": 1061, - "src": "26473:54:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 890, - "nodeType": "StructuredDocumentation", - "src": "26534:23:0", - "text": "Guardian Interface" - }, - "functionSelector": "6a8cb4c6", - "id": 897, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "_isPaused", - "nameLocation": "26571:9:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 893, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 892, - "mutability": "mutable", - "name": "sig", - "nameLocation": "26588:3:0", - "nodeType": "VariableDeclaration", - "scope": 897, - "src": "26581:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 891, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "26581:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "26580:12:0" - }, - "returnParameters": { - "id": 896, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 895, - "mutability": "mutable", - "name": "isPaused", - "nameLocation": "26621:8:0", - "nodeType": "VariableDeclaration", - "scope": 897, - "src": "26616:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 894, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "26616:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "src": "26615:15:0" - }, - "scope": 1061, - "src": "26562:69:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ab3d9ffa", - "id": 902, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionPause", - "nameLocation": "26646:19:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 900, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 899, - "mutability": "mutable", - "name": "sig", - "nameLocation": "26673:3:0", - "nodeType": "VariableDeclaration", - "scope": 902, - "src": "26666:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 898, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "26666:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "26665:12:0" - }, - "returnParameters": { - "id": 901, - "nodeType": "ParameterList", - "parameters": [], - "src": "26686:0:0" - }, - "scope": 1061, - "src": "26637:50:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "323e35b1", - "id": 907, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "toggleFunctionUnPause", - "nameLocation": "26702:21:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 905, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 904, - "mutability": "mutable", - "name": "sig", - "nameLocation": "26731:3:0", - "nodeType": "VariableDeclaration", - "scope": 907, - "src": "26724:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - }, - "typeName": { - "id": 903, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "26724:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "visibility": "internal" - } - ], - "src": "26723:12:0" - }, - "returnParameters": { - "id": 906, - "nodeType": "ParameterList", - "parameters": [], - "src": "26744:0:0" - }, - "scope": 1061, - "src": "26693:52:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "f8ddf397", - "id": 913, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "pause", - "nameLocation": "26760:5:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 911, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 910, - "mutability": "mutable", - "name": "sig", - "nameLocation": "26785:3:0", - "nodeType": "VariableDeclaration", - "scope": 913, - "src": "26766:22:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes4_$dyn_calldata_ptr", - "typeString": "bytes4[]" - }, - "typeName": { - "baseType": { - "id": 908, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "26766:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "id": 909, - "nodeType": "ArrayTypeName", - "src": "26766:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes4_$dyn_storage_ptr", - "typeString": "bytes4[]" - } - }, - "visibility": "internal" - } - ], - "src": "26765:24:0" - }, - "returnParameters": { - "id": 912, - "nodeType": "ParameterList", - "parameters": [], - "src": "26798:0:0" - }, - "scope": 1061, - "src": "26751:48:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "ac544a04", - "id": 919, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "unpause", - "nameLocation": "26814:7:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 917, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 916, - "mutability": "mutable", - "name": "sig", - "nameLocation": "26841:3:0", - "nodeType": "VariableDeclaration", - "scope": 919, - "src": "26822:22:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes4_$dyn_calldata_ptr", - "typeString": "bytes4[]" - }, - "typeName": { - "baseType": { - "id": 914, - "name": "bytes4", - "nodeType": "ElementaryTypeName", - "src": "26822:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes4", - "typeString": "bytes4" - } - }, - "id": 915, - "nodeType": "ArrayTypeName", - "src": "26822:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes4_$dyn_storage_ptr", - "typeString": "bytes4[]" - } - }, - "visibility": "internal" - } - ], - "src": "26821:24:0" - }, - "returnParameters": { - "id": 918, - "nodeType": "ParameterList", - "parameters": [], - "src": "26854:0:0" - }, - "scope": 1061, - "src": "26805:50:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "2fcb4f04", - "id": 924, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "changeGuardian", - "nameLocation": "26870:14:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 922, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 921, - "mutability": "mutable", - "name": "newGuardian", - "nameLocation": "26893:11:0", - "nodeType": "VariableDeclaration", - "scope": 924, - "src": "26885:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 920, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26885:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "26884:21:0" - }, - "returnParameters": { - "id": 923, - "nodeType": "ParameterList", - "parameters": [], - "src": "26914:0:0" - }, - "scope": 1061, - "src": "26861:54:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "functionSelector": "a75b87d2", - "id": 929, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "getGuardian", - "nameLocation": "26930:11:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 925, - "nodeType": "ParameterList", - "parameters": [], - "src": "26941:2:0" - }, - "returnParameters": { - "id": 928, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 927, - "mutability": "mutable", - "name": "guardian", - "nameLocation": "26975:8:0", - "nodeType": "VariableDeclaration", - "scope": 929, - "src": "26967:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 926, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "26967:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "26966:18:0" - }, - "scope": 1061, - "src": "26921:64:0", - "stateMutability": "view", - "virtual": false, - "visibility": "external" - }, - { - "documentation": { - "id": 930, - "nodeType": "StructuredDocumentation", - "src": "26991:27:0", - "text": "Loan Cleanup Interface" - }, - "functionSelector": "4704ffbc", - "id": 940, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "cleanupLoans", - "nameLocation": "27032:12:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 936, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 932, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "27062:9:0", - "nodeType": "VariableDeclaration", - "scope": 940, - "src": "27054:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 931, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27054:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 935, - "mutability": "mutable", - "name": "loanIds", - "nameLocation": "27100:7:0", - "nodeType": "VariableDeclaration", - "scope": 940, - "src": "27081:26:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_calldata_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 933, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "27081:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 934, - "nodeType": "ArrayTypeName", - "src": "27081:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "visibility": "internal" - } - ], - "src": "27044:64:0" - }, - "returnParameters": { - "id": 939, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 938, - "mutability": "mutable", - "name": "totalPrincipalIn", - "nameLocation": "27167:16:0", - "nodeType": "VariableDeclaration", - "scope": 940, - "src": "27159:24:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 937, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27159:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "27158:26:0" - }, - "scope": 1061, - "src": "27023:162:0", - "stateMutability": "payable", - "virtual": false, - "visibility": "external" - }, - { - "canonicalName": "IBZx.LoanParams", - "id": 957, - "members": [ - { - "constant": false, - "id": 942, - "mutability": "mutable", - "name": "id", - "nameLocation": "27227:2:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27219:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 941, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "27219:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 944, - "mutability": "mutable", - "name": "active", - "nameLocation": "27244:6:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27239:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 943, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "27239:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 946, - "mutability": "mutable", - "name": "owner", - "nameLocation": "27268:5:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27260:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 945, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27260:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 948, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "27291:9:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27283:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 947, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27283:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 950, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "27318:15:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27310:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 949, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27310:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 952, - "mutability": "mutable", - "name": "minInitialMargin", - "nameLocation": "27351:16:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27343:24:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 951, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27343:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 954, - "mutability": "mutable", - "name": "maintenanceMargin", - "nameLocation": "27385:17:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27377:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 953, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27377:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 956, - "mutability": "mutable", - "name": "maxLoanTerm", - "nameLocation": "27420:11:0", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "27412:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 955, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27412:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LoanParams", - "nameLocation": "27198:10:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "27191:247:0", - "visibility": "public" - }, - { - "canonicalName": "IBZx.LoanOpenData", - "id": 964, - "members": [ - { - "constant": false, - "id": 959, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "27482:6:0", - "nodeType": "VariableDeclaration", - "scope": 964, - "src": "27474:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 958, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "27474:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 961, - "mutability": "mutable", - "name": "principal", - "nameLocation": "27506:9:0", - "nodeType": "VariableDeclaration", - "scope": 964, - "src": "27498:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 960, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27498:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 963, - "mutability": "mutable", - "name": "collateral", - "nameLocation": "27533:10:0", - "nodeType": "VariableDeclaration", - "scope": 964, - "src": "27525:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 962, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27525:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LoanOpenData", - "nameLocation": "27451:12:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "27444:106:0", - "visibility": "public" - }, - { - "canonicalName": "IBZx.LoanType", - "id": 968, - "members": [ - { - "id": 965, - "name": "All", - "nameLocation": "27580:3:0", - "nodeType": "EnumValue", - "src": "27580:3:0" - }, - { - "id": 966, - "name": "Margin", - "nameLocation": "27593:6:0", - "nodeType": "EnumValue", - "src": "27593:6:0" - }, - { - "id": 967, - "name": "NonMargin", - "nameLocation": "27609:9:0", - "nodeType": "EnumValue", - "src": "27609:9:0" - } - ], - "name": "LoanType", - "nameLocation": "27561:8:0", - "nodeType": "EnumDefinition", - "src": "27556:68:0" - }, - { - "canonicalName": "IBZx.LoanReturnData", - "id": 1003, - "members": [ - { - "constant": false, - "id": 970, - "mutability": "mutable", - "name": "loanId", - "nameLocation": "27670:6:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27662:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 969, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "27662:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 972, - "mutability": "mutable", - "name": "endTimestamp", - "nameLocation": "27693:12:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27686:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint96", - "typeString": "uint96" - }, - "typeName": { - "id": 971, - "name": "uint96", - "nodeType": "ElementaryTypeName", - "src": "27686:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint96", - "typeString": "uint96" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 974, - "mutability": "mutable", - "name": "loanToken", - "nameLocation": "27723:9:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27715:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 973, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27715:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 976, - "mutability": "mutable", - "name": "collateralToken", - "nameLocation": "27750:15:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27742:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 975, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "27742:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 978, - "mutability": "mutable", - "name": "principal", - "nameLocation": "27783:9:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27775:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 977, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27775:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 980, - "mutability": "mutable", - "name": "collateral", - "nameLocation": "27810:10:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27802:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 979, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27802:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 982, - "mutability": "mutable", - "name": "interestOwedPerDay", - "nameLocation": "27838:18:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27830:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 981, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27830:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 984, - "mutability": "mutable", - "name": "interestDepositRemaining", - "nameLocation": "27874:24:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27866:32:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 983, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27866:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 986, - "mutability": "mutable", - "name": "startRate", - "nameLocation": "27916:9:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27908:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 985, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27908:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 988, - "mutability": "mutable", - "name": "startMargin", - "nameLocation": "27943:11:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27935:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 987, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27935:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 990, - "mutability": "mutable", - "name": "maintenanceMargin", - "nameLocation": "27972:17:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27964:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 989, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27964:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 992, - "mutability": "mutable", - "name": "currentMargin", - "nameLocation": "28007:13:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "27999:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 991, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "27999:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 994, - "mutability": "mutable", - "name": "maxLoanTerm", - "nameLocation": "28038:11:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "28030:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 993, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28030:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 996, - "mutability": "mutable", - "name": "maxLiquidatable", - "nameLocation": "28067:15:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "28059:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 995, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28059:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 998, - "mutability": "mutable", - "name": "maxSeizable", - "nameLocation": "28100:11:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "28092:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 997, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28092:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1000, - "mutability": "mutable", - "name": "depositValueAsLoanToken", - "nameLocation": "28129:23:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "28121:31:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 999, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28121:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1002, - "mutability": "mutable", - "name": "depositValueAsCollateralToken", - "nameLocation": "28170:29:0", - "nodeType": "VariableDeclaration", - "scope": 1003, - "src": "28162:37:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1001, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28162:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LoanReturnData", - "nameLocation": "27637:14:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "27630:576:0", - "visibility": "public" - }, - { - "canonicalName": "IBZx.FeeClaimType", - "id": 1008, - "members": [ - { - "id": 1004, - "name": "All", - "nameLocation": "28240:3:0", - "nodeType": "EnumValue", - "src": "28240:3:0" - }, - { - "id": 1005, - "name": "Lending", - "nameLocation": "28253:7:0", - "nodeType": "EnumValue", - "src": "28253:7:0" - }, - { - "id": 1006, - "name": "Trading", - "nameLocation": "28270:7:0", - "nodeType": "EnumValue", - "src": "28270:7:0" - }, - { - "id": 1007, - "name": "Borrowing", - "nameLocation": "28287:9:0", - "nodeType": "EnumValue", - "src": "28287:9:0" - } - ], - "name": "FeeClaimType", - "nameLocation": "28217:12:0", - "nodeType": "EnumDefinition", - "src": "28212:90:0" - }, - { - "canonicalName": "IBZx.Loan", - "id": 1033, - "members": [ - { - "constant": false, - "id": 1010, - "mutability": "mutable", - "name": "id", - "nameLocation": "28338:2:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28330:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1009, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "28330:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1012, - "mutability": "mutable", - "name": "loanParamsId", - "nameLocation": "28376:12:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28368:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1011, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "28368:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1014, - "mutability": "mutable", - "name": "pendingTradesId", - "nameLocation": "28435:15:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28427:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1013, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "28427:7:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1016, - "mutability": "mutable", - "name": "principal", - "nameLocation": "28500:9:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28492:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1015, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28492:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1018, - "mutability": "mutable", - "name": "collateral", - "nameLocation": "28564:10:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28556:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1017, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28556:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1020, - "mutability": "mutable", - "name": "startTimestamp", - "nameLocation": "28634:14:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28626:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1019, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28626:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1022, - "mutability": "mutable", - "name": "endTimestamp", - "nameLocation": "28685:12:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28677:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1021, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28677:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1024, - "mutability": "mutable", - "name": "startMargin", - "nameLocation": "28823:11:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28815:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1023, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28815:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1026, - "mutability": "mutable", - "name": "startRate", - "nameLocation": "28891:9:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28883:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1025, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "28883:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1028, - "mutability": "mutable", - "name": "borrower", - "nameLocation": "29001:8:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "28993:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1027, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "28993:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1030, - "mutability": "mutable", - "name": "lender", - "nameLocation": "29052:6:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "29044:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1029, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "29044:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1032, - "mutability": "mutable", - "name": "active", - "nameLocation": "29096:6:0", - "nodeType": "VariableDeclaration", - "scope": 1033, - "src": "29091:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1031, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "29091:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "visibility": "internal" - } - ], - "name": "Loan", - "nameLocation": "28315:4:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "28308:845:0", - "visibility": "public" - }, - { - "canonicalName": "IBZx.LenderInterest", - "id": 1044, - "members": [ - { - "constant": false, - "id": 1035, - "mutability": "mutable", - "name": "principalTotal", - "nameLocation": "29199:14:0", - "nodeType": "VariableDeclaration", - "scope": 1044, - "src": "29191:22:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1034, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29191:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1037, - "mutability": "mutable", - "name": "owedPerDay", - "nameLocation": "29277:10:0", - "nodeType": "VariableDeclaration", - "scope": 1044, - "src": "29269:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1036, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29269:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1039, - "mutability": "mutable", - "name": "owedTotal", - "nameLocation": "29353:9:0", - "nodeType": "VariableDeclaration", - "scope": 1044, - "src": "29345:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1038, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29345:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1041, - "mutability": "mutable", - "name": "paidTotal", - "nameLocation": "29458:9:0", - "nodeType": "VariableDeclaration", - "scope": 1044, - "src": "29450:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1040, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29450:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1043, - "mutability": "mutable", - "name": "updatedTimestamp", - "nameLocation": "29525:16:0", - "nodeType": "VariableDeclaration", - "scope": 1044, - "src": "29517:24:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1042, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29517:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LenderInterest", - "nameLocation": "29166:14:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "29159:404:0", - "visibility": "public" - }, - { - "canonicalName": "IBZx.LoanInterest", - "id": 1051, - "members": [ - { - "constant": false, - "id": 1046, - "mutability": "mutable", - "name": "owedPerDay", - "nameLocation": "29607:10:0", - "nodeType": "VariableDeclaration", - "scope": 1051, - "src": "29599:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1045, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29599:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1048, - "mutability": "mutable", - "name": "depositTotal", - "nameLocation": "29669:12:0", - "nodeType": "VariableDeclaration", - "scope": 1051, - "src": "29661:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1047, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29661:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1050, - "mutability": "mutable", - "name": "updatedTimestamp", - "nameLocation": "29735:16:0", - "nodeType": "VariableDeclaration", - "scope": 1051, - "src": "29727:24:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1049, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29727:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "name": "LoanInterest", - "nameLocation": "29576:12:0", - "nodeType": "StructDefinition", - "scope": 1061, - "src": "29569:204:0", - "visibility": "public" - }, - { - "functionSelector": "39254483", - "id": 1060, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "payFlashBorrowFees", - "nameLocation": "29822:18:0", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1058, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1053, - "mutability": "mutable", - "name": "user", - "nameLocation": "29858:4:0", - "nodeType": "VariableDeclaration", - "scope": 1060, - "src": "29850:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1052, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "29850:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1055, - "mutability": "mutable", - "name": "borrowAmount", - "nameLocation": "29880:12:0", - "nodeType": "VariableDeclaration", - "scope": 1060, - "src": "29872:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1054, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29872:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 1057, - "mutability": "mutable", - "name": "flashBorrowFeePercent", - "nameLocation": "29910:21:0", - "nodeType": "VariableDeclaration", - "scope": 1060, - "src": "29902:29:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1056, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "29902:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "29840:92:0" - }, - "returnParameters": { - "id": 1059, - "nodeType": "ParameterList", - "parameters": [], - "src": "29949:0:0" - }, - "scope": 1061, - "src": "29813:137:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - } - ], - "scope": 1062, - "src": "401:29551:0", - "usedErrors": [] - } - ], - "src": "134:29819:0" - }, - "contractName": "IBZx", - "dependencies": [], - "offset": [401, 29952], - "sha1": "d902d2ae9218831588d2415734065017328e706f", - "source": "/**\n * Copyright 2017-2022, OokiDao. All Rights Reserved.\n * Licensed under the Apache-2.0\n */\n// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.5.0 <0.9.0;\npragma experimental ABIEncoderV2;\n\n/// @title A proxy interface for The Protocol\n/// @author bZeroX\n/// @notice This is just an interface, not to be deployed itself.\n/// @dev This interface is to be used for the protocol interactions.\ninterface IBZx {\n ////// Protocol //////\n\n /// @dev adds or replaces existing proxy module\n /// @param target target proxy module address\n function replaceContract(address target) external;\n\n /// @dev updates all proxy modules addreses and function signatures.\n /// sigsArr and targetsArr should be of equal length\n /// @param sigsArr array of function signatures\n /// @param targetsArr array of target proxy module addresses\n function setTargets(\n string[] calldata sigsArr,\n address[] calldata targetsArr\n ) external;\n\n /// @dev returns protocol module address given a function signature\n /// @return module address\n function getTarget(string calldata sig) external view returns (address);\n\n ////// Protocol Settings //////\n\n /// @dev sets price feed contract address. The contract on the addres should implement IPriceFeeds interface\n /// @param newContract module address for the IPriceFeeds implementation\n function setPriceFeedContract(address newContract) external;\n\n /// @dev sets swaps contract address. The contract on the addres should implement ISwapsImpl interface\n /// @param newContract module address for the ISwapsImpl implementation\n function setSwapsImplContract(address newContract) external;\n\n /// @dev sets loan pool with assets. Accepts two arrays of equal length\n /// @param pools array of address of pools\n /// @param assets array of addresses of assets\n function setLoanPool(address[] calldata pools, address[] calldata assets)\n external;\n\n /// @dev updates list of supported tokens, it can be use also to disable or enable particualr token\n /// @param addrs array of address of pools\n /// @param toggles array of addresses of assets\n /// @param withApprovals resets tokens to unlimited approval with the swaps integration (kyber, etc.)\n function setSupportedTokens(\n address[] calldata addrs,\n bool[] calldata toggles,\n bool withApprovals\n ) external;\n\n /// @dev sets lending fee with WEI_PERCENT_PRECISION\n /// @param newValue lending fee percent\n function setLendingFeePercent(uint256 newValue) external;\n\n /// @dev sets trading fee with WEI_PERCENT_PRECISION\n /// @param newValue trading fee percent\n function setTradingFeePercent(uint256 newValue) external;\n\n /// @dev sets borrowing fee with WEI_PERCENT_PRECISION\n /// @param newValue borrowing fee percent\n function setBorrowingFeePercent(uint256 newValue) external;\n\n /// @dev sets affiliate fee with WEI_PERCENT_PRECISION\n /// @param newValue affiliate fee percent\n function setAffiliateFeePercent(uint256 newValue) external;\n\n /// @dev sets liquidation inncetive percent per loan per token. This is the profit percent\n /// that liquidator gets in the process of liquidating.\n /// @param loanTokens array list of loan tokens\n /// @param collateralTokens array list of collateral tokens\n /// @param amounts array list of liquidation inncetive amount\n function setLiquidationIncentivePercent(\n address[] calldata loanTokens,\n address[] calldata collateralTokens,\n uint256[] calldata amounts\n ) external;\n\n /// @dev sets max swap rate slippage percent.\n /// @param newAmount max swap rate slippage percent.\n function setMaxDisagreement(uint256 newAmount) external;\n\n /// TODO\n function setSourceBufferPercent(uint256 newAmount) external;\n\n /// @dev sets maximum supported swap size in ETH\n /// @param newAmount max swap size in ETH.\n function setMaxSwapSize(uint256 newAmount) external;\n\n /// @dev sets fee controller address\n /// @param newController address of the new fees controller\n function setFeesController(address newController) external;\n\n /// @dev withdraws lending fees to receiver. Only can be called by feesController address\n /// @param tokens array of token addresses.\n /// @param receiver fees receiver address\n /// @return amounts array of amounts withdrawn\n function withdrawFees(\n address[] calldata tokens,\n address receiver,\n FeeClaimType feeType\n ) external returns (uint256[] memory amounts);\n\n /*\n Targets still exist, but functions are decommissioned:\n\n /// @dev withdraw protocol token (BZRX) from vesting contract vBZRX\n /// @param receiver address of BZRX tokens claimed\n /// @param amount of BZRX token to be claimed. max is claimed if amount is greater than balance.\n /// @return rewardToken reward token address\n /// @return withdrawAmount amount\n function withdrawProtocolToken(address receiver, uint256 amount)\n external\n returns (address rewardToken, uint256 withdrawAmount);\n\n /// @dev depozit protocol token (BZRX)\n /// @param amount address of BZRX tokens to deposit\n function depositProtocolToken(uint256 amount) external;\n\n function grantRewards(address[] calldata users, uint256[] calldata amounts)\n external\n returns (uint256 totalAmount);*/\n\n // NOTE: this doesn't sanitize inputs -> inaccurate values may be returned if there are duplicate token inputs\n function queryFees(address[] calldata tokens, FeeClaimType feeType)\n external\n view\n returns (uint256[] memory amountsHeld, uint256[] memory amountsPaid);\n\n function priceFeeds() external view returns (address);\n\n function swapsImpl() external view returns (address);\n\n function logicTargets(bytes4) external view returns (address);\n\n function loans(bytes32) external view returns (Loan memory);\n\n function loanParams(bytes32) external view returns (LoanParams memory);\n\n // we don't use this yet\n // function lenderOrders(address, bytes32) external returns (Order memory);\n // function borrowerOrders(address, bytes32) external returns (Order memory);\n\n function delegatedManagers(bytes32, address) external view returns (bool);\n\n function lenderInterest(address, address)\n external\n view\n returns (LenderInterest memory);\n\n function loanInterest(bytes32) external view returns (LoanInterest memory);\n\n function feesController() external view returns (address);\n\n function lendingFeePercent() external view returns (uint256);\n\n function lendingFeeTokensHeld(address) external view returns (uint256);\n\n function lendingFeeTokensPaid(address) external view returns (uint256);\n\n function borrowingFeePercent() external view returns (uint256);\n\n function borrowingFeeTokensHeld(address) external view returns (uint256);\n\n function borrowingFeeTokensPaid(address) external view returns (uint256);\n\n function tradingFeeTokensHeld(address) external view returns (uint256);\n\n function tradingFeeTokensPaid(address) external view returns (uint256);\n\n function tradingFeePercent() external view returns (uint256);\n\n function protocolTokenHeld() external view returns (uint256);\n\n function protocolTokenPaid() external view returns (uint256);\n\n function affiliateFeePercent() external view returns (uint256);\n\n function liquidationIncentivePercent(address, address)\n external\n view\n returns (uint256);\n\n function loanPoolToUnderlying(address) external view returns (address);\n\n function underlyingToLoanPool(address) external view returns (address);\n\n function supportedTokens(address) external view returns (bool);\n\n function maxDisagreement() external view returns (uint256);\n\n function sourceBufferPercent() external view returns (uint256);\n\n function maxSwapSize() external view returns (uint256);\n\n /// @dev get list of loan pools in the system. Ordering is not guaranteed\n /// @param start start index\n /// @param count number of pools to return\n /// @return loanPoolsList array of loan pools\n function getLoanPoolsList(uint256 start, uint256 count)\n external\n view\n returns (address[] memory loanPoolsList);\n\n /// @dev checks whether addreess is a loan pool address\n /// @return boolean\n function isLoanPool(address loanPool) external view returns (bool);\n\n ////// Loan Settings //////\n\n /// @dev creates new loan param settings\n /// @param loanParamsList array of LoanParams\n /// @return loanParamsIdList array of loan ids created\n function setupLoanParams(LoanParams[] calldata loanParamsList)\n external\n returns (bytes32[] memory loanParamsIdList);\n\n function setupLoanPoolTWAI(address pool) external;\n\n function setTWAISettings(uint32 delta, uint32 secondsAgo) external;\n\n /// @dev Deactivates LoanParams for future loans. Active loans using it are unaffected.\n /// @param loanParamsIdList array of loan ids\n function disableLoanParams(bytes32[] calldata loanParamsIdList) external;\n\n /// @dev gets array of LoanParams by given ids\n /// @param loanParamsIdList array of loan ids\n /// @return loanParamsList array of LoanParams\n function getLoanParams(bytes32[] calldata loanParamsIdList)\n external\n view\n returns (LoanParams[] memory loanParamsList);\n\n /// @dev Enumerates LoanParams in the system by owner\n /// @param owner of the loan params\n /// @param start number of loans to return\n /// @param count total number of the items\n /// @return loanParamsList array of LoanParams\n function getLoanParamsList(\n address owner,\n uint256 start,\n uint256 count\n ) external view returns (bytes32[] memory loanParamsList);\n\n /// @dev returns total loan principal for token address\n /// @param lender address\n /// @param loanToken address\n /// @return total principal of the loan\n function getTotalPrincipal(address lender, address loanToken)\n external\n view\n returns (uint256);\n\n /// @dev returns total principal for a loan pool that was last settled\n /// @param pool address\n /// @return total stored principal of the loan\n function getPoolPrincipalStored(address pool)\n external\n view\n returns (uint256);\n\n /// @dev returns the last interest rate founnd during interest settlement\n /// @param pool address\n /// @return the last interset rate\n function getPoolLastInterestRate(address pool)\n external\n view\n returns (uint256);\n\n ////// Loan Openings //////\n\n /// @dev This is THE function that borrows or trades on the protocol\n /// @param loanParamsId id of the LoanParam created beforehand by setupLoanParams function\n /// @param loanId id of existing loan, if 0, start a new loan\n /// @param isTorqueLoan boolean whether it is toreque or non torque loan\n /// @param initialMargin in WEI_PERCENT_PRECISION\n /// @param sentAddresses array of size 4:\n /// lender: must match loan if loanId provided\n /// borrower: must match loan if loanId provided\n /// receiver: receiver of funds (address(0) assumes borrower address)\n /// manager: delegated manager of loan unless address(0)\n /// @param sentValues array of size 5:\n /// newRate: new loan interest rate\n /// newPrincipal: new loan size (borrowAmount + any borrowed interest)\n /// torqueInterest: new amount of interest to escrow for Torque loan (determines initial loan length)\n /// loanTokenReceived: total loanToken deposit (amount not sent to borrower in the case of Torque loans)\n /// collateralTokenReceived: total collateralToken deposit\n /// @param loanDataBytes required when sending ether\n /// @return principal of the loan and collateral amount\n function borrowOrTradeFromPool(\n bytes32 loanParamsId,\n bytes32 loanId,\n bool isTorqueLoan,\n uint256 initialMargin,\n address[4] calldata sentAddresses,\n uint256[5] calldata sentValues,\n bytes calldata loanDataBytes\n ) external payable returns (LoanOpenData memory);\n\n /// @dev sets/disables/enables the delegated manager for the loan\n /// @param loanId id of the loan\n /// @param delegated delegated manager address\n /// @param toggle boolean set enabled or disabled\n function setDelegatedManager(\n bytes32 loanId,\n address delegated,\n bool toggle\n ) external;\n\n /// @dev calculates required collateral for simulated position\n /// @param loanToken address of loan token\n /// @param collateralToken address of collateral token\n /// @param newPrincipal principal amount of the loan\n /// @param marginAmount margin amount of the loan\n /// @param isTorqueLoan boolean torque or non torque loan\n /// @return collateralAmountRequired amount required\n function getRequiredCollateral(\n address loanToken,\n address collateralToken,\n uint256 newPrincipal,\n uint256 marginAmount,\n bool isTorqueLoan\n ) external view returns (uint256 collateralAmountRequired);\n\n function getRequiredCollateralByParams(\n bytes32 loanParamsId,\n uint256 newPrincipal\n ) external view returns (uint256 collateralAmountRequired);\n\n /// @dev calculates borrow amount for simulated position\n /// @param loanToken address of loan token\n /// @param collateralToken address of collateral token\n /// @param collateralTokenAmount amount of collateral token sent\n /// @param marginAmount margin amount\n /// @param isTorqueLoan boolean torque or non torque loan\n /// @return borrowAmount possible borrow amount\n function getBorrowAmount(\n address loanToken,\n address collateralToken,\n uint256 collateralTokenAmount,\n uint256 marginAmount,\n bool isTorqueLoan\n ) external view returns (uint256 borrowAmount);\n\n function getBorrowAmountByParams(\n bytes32 loanParamsId,\n uint256 collateralTokenAmount\n ) external view returns (uint256 borrowAmount);\n\n ////// Loan Closings //////\n\n /// @dev liquidates unhealty loans\n /// @param loanId id of the loan\n /// @param receiver address receiving liquidated loan collateral\n /// @param closeAmount amount to close denominated in loanToken\n /// @return loanCloseAmount amount of the collateral token of the loan\n /// @return seizedAmount sezied amount in the collateral token\n /// @return seizedToken loan token address\n function liquidate(\n bytes32 loanId,\n address receiver,\n uint256 closeAmount\n )\n external\n payable\n returns (\n uint256 loanCloseAmount,\n uint256 seizedAmount,\n address seizedToken\n );\n\n /// @dev close position with loan token deposit\n /// @param loanId id of the loan\n /// @param receiver collateral token reciever address\n /// @param depositAmount amount of loan token to deposit\n /// @return loanCloseAmount loan close amount\n /// @return withdrawAmount loan token withdraw amount\n /// @return withdrawToken loan token address\n function closeWithDeposit(\n bytes32 loanId,\n address receiver,\n uint256 depositAmount // denominated in loanToken\n )\n external\n payable\n returns (\n uint256 loanCloseAmount,\n uint256 withdrawAmount,\n address withdrawToken\n );\n\n /// @dev close position with swap\n /// @param loanId id of the loan\n /// @param receiver collateral token reciever address\n /// @param swapAmount amount of loan token to swap\n /// @param returnTokenIsCollateral boolean whether to return tokens is collateral\n /// @param loanDataBytes custom payload for specifying swap implementation and data to pass\n /// @return loanCloseAmount loan close amount\n /// @return withdrawAmount loan token withdraw amount\n /// @return withdrawToken loan token address\n function closeWithSwap(\n bytes32 loanId,\n address receiver,\n uint256 swapAmount, // denominated in collateralToken\n bool returnTokenIsCollateral, // true: withdraws collateralToken, false: withdraws loanToken\n bytes calldata loanDataBytes\n )\n external\n returns (\n uint256 loanCloseAmount,\n uint256 withdrawAmount,\n address withdrawToken\n );\n\n ////// Loan Closings With Gas Token //////\n\n /// @dev liquidates unhealty loans by using Gas token\n /// @param loanId id of the loan\n /// @param receiver address receiving liquidated loan collateral\n /// @param gasTokenUser user address of the GAS token\n /// @param closeAmount amount to close denominated in loanToken\n /// @return loanCloseAmount loan close amount\n /// @return seizedAmount loan token withdraw amount\n /// @return seizedToken loan token address\n function liquidateWithGasToken(\n bytes32 loanId,\n address receiver,\n address gasTokenUser,\n uint256 closeAmount // denominated in loanToken\n )\n external\n payable\n returns (\n uint256 loanCloseAmount,\n uint256 seizedAmount,\n address seizedToken\n );\n\n /// @dev close position with loan token deposit\n /// @param loanId id of the loan\n /// @param receiver collateral token reciever address\n /// @param gasTokenUser user address of the GAS token\n /// @param depositAmount amount of loan token to deposit denominated in loanToken\n /// @return loanCloseAmount loan close amount\n /// @return withdrawAmount loan token withdraw amount\n /// @return withdrawToken loan token address\n function closeWithDepositWithGasToken(\n bytes32 loanId,\n address receiver,\n address gasTokenUser,\n uint256 depositAmount\n )\n external\n payable\n returns (\n uint256 loanCloseAmount,\n uint256 withdrawAmount,\n address withdrawToken\n );\n\n /// @dev close position with swap\n /// @param loanId id of the loan\n /// @param receiver collateral token reciever address\n /// @param gasTokenUser user address of the GAS token\n /// @param swapAmount amount of loan token to swap denominated in collateralToken\n /// @param returnTokenIsCollateral true: withdraws collateralToken, false: withdraws loanToken\n /// @return loanCloseAmount loan close amount\n /// @return withdrawAmount loan token withdraw amount\n /// @return withdrawToken loan token address\n function closeWithSwapWithGasToken(\n bytes32 loanId,\n address receiver,\n address gasTokenUser,\n uint256 swapAmount,\n bool returnTokenIsCollateral,\n bytes calldata loanDataBytes\n )\n external\n returns (\n uint256 loanCloseAmount,\n uint256 withdrawAmount,\n address withdrawToken\n );\n\n ////// Loan Maintenance //////\n\n /// @dev deposit collateral to existing loan\n /// @param loanId existing loan id\n /// @param depositAmount amount to deposit which must match msg.value if ether is sent\n function depositCollateral(bytes32 loanId, uint256 depositAmount)\n external\n payable;\n\n /// @dev withdraw collateral from existing loan\n /// @param loanId existing loan id\n /// @param receiver address of withdrawn tokens\n /// @param withdrawAmount amount to withdraw\n /// @return actualWithdrawAmount actual amount withdrawn\n function withdrawCollateral(\n bytes32 loanId,\n address receiver,\n uint256 withdrawAmount\n ) external returns (uint256 actualWithdrawAmount);\n\n /// @dev settles accrued interest for all active loans from a loan pool\n /// @param loanId existing loan id\n function settleInterest(bytes32 loanId) external;\n\n function setDepositAmount(\n bytes32 loanId,\n uint256 depositValueAsLoanToken,\n uint256 depositValueAsCollateralToken\n ) external;\n\n function transferLoan(bytes32 loanId, address newOwner) external;\n\n // Decommissioned function, but leave interface to allow remaining claims\n function claimRewards(address receiver)\n external\n returns (uint256 claimAmount);\n\n // Decommissioned function, but leave interface to allow remaining claims\n function rewardsBalanceOf(address user)\n external\n view\n returns (uint256 rewardsBalance);\n\n function getInterestModelValues(\n address pool,\n bytes32 loanId)\n external\n view\n returns (\n uint256 _poolLastUpdateTime,\n uint256 _poolPrincipalTotal,\n uint256 _poolInterestTotal,\n uint256 _poolRatePerTokenStored,\n uint256 _poolLastInterestRate,\n uint256 _loanPrincipalTotal,\n uint256 _loanInterestTotal,\n uint256 _loanRatePerTokenPaid\n );\n \n function getTWAI(\n address pool)\n external\n view returns (\n uint256 benchmarkRate\n );\n\n /// @dev gets list of loans of particular user address\n /// @param user address of the loans\n /// @param start of the index\n /// @param count number of loans to return\n /// @param loanType type of the loan: All(0), Margin(1), NonMargin(2)\n /// @param isLender whether to list lender loans or borrower loans\n /// @param unsafeOnly booleat if true return only unsafe loans that are open for liquidation\n /// @return loansData LoanReturnData array of loans\n function getUserLoans(\n address user,\n uint256 start,\n uint256 count,\n LoanType loanType,\n bool isLender,\n bool unsafeOnly\n ) external view returns (LoanReturnData[] memory loansData);\n\n function getUserLoansCount(address user, bool isLender)\n external\n view\n returns (uint256);\n\n /// @dev gets existing loan\n /// @param loanId id of existing loan\n /// @return loanData array of loans\n function getLoan(bytes32 loanId)\n external\n view\n returns (LoanReturnData memory loanData);\n\n /// @dev gets loan principal including interest\n /// @param loanId id of existing loan\n /// @return principal\n function getLoanPrincipal(bytes32 loanId)\n external\n view\n returns (uint256 principal);\n\n /// @dev gets loan outstanding interest\n /// @param loanId id of existing loan\n /// @return interest\n function getLoanInterestOutstanding(bytes32 loanId)\n external\n view\n returns (uint256 interest);\n\n\n /// @dev get current active loans in the system\n /// @param start of the index\n /// @param count number of loans to return\n /// @param unsafeOnly boolean if true return unsafe loan only (open for liquidation)\n function getActiveLoans(\n uint256 start,\n uint256 count,\n bool unsafeOnly\n ) external view returns (LoanReturnData[] memory loansData);\n\n /// @dev get current active loans in the system\n /// @param start of the index\n /// @param count number of loans to return\n /// @param unsafeOnly boolean if true return unsafe loan only (open for liquidation)\n /// @param isLiquidatable boolean if true return liquidatable loans only\n function getActiveLoansAdvanced(\n uint256 start,\n uint256 count,\n bool unsafeOnly,\n bool isLiquidatable\n ) external view returns (LoanReturnData[] memory loansData);\n\n function getActiveLoansCount() external view returns (uint256);\n\n ////// Swap External //////\n\n /// @dev swap thru external integration\n /// @param sourceToken source token address\n /// @param destToken destintaion token address\n /// @param receiver address to receive tokens\n /// @param returnToSender TODO\n /// @param sourceTokenAmount source token amount\n /// @param requiredDestTokenAmount destination token amount\n /// @param swapData TODO\n /// @return destTokenAmountReceived destination token received\n /// @return sourceTokenAmountUsed source token amount used\n function swapExternal(\n address sourceToken,\n address destToken,\n address receiver,\n address returnToSender,\n uint256 sourceTokenAmount,\n uint256 requiredDestTokenAmount,\n bytes calldata swapData\n )\n external\n payable\n returns (\n uint256 destTokenAmountReceived,\n uint256 sourceTokenAmountUsed\n );\n\n /// @dev swap thru external integration using GAS\n /// @param sourceToken source token address\n /// @param destToken destintaion token address\n /// @param receiver address to receive tokens\n /// @param returnToSender TODO\n /// @param gasTokenUser user address of the GAS token\n /// @param sourceTokenAmount source token amount\n /// @param requiredDestTokenAmount destination token amount\n /// @param swapData TODO\n /// @return destTokenAmountReceived destination token received\n /// @return sourceTokenAmountUsed source token amount used\n function swapExternalWithGasToken(\n address sourceToken,\n address destToken,\n address receiver,\n address returnToSender,\n address gasTokenUser,\n uint256 sourceTokenAmount,\n uint256 requiredDestTokenAmount,\n bytes calldata swapData\n )\n external\n payable\n returns (\n uint256 destTokenAmountReceived,\n uint256 sourceTokenAmountUsed\n );\n\n /// @dev calculate simulated return of swap\n /// @param sourceToken source token address\n /// @param destToken destination token address\n /// @param sourceTokenAmount source token amount\n /// @return amoun denominated in destination token\n // TODO remove as soon as deployed on all chains\n function getSwapExpectedReturn(\n address sourceToken,\n address destToken,\n uint256 sourceTokenAmount,\n bytes calldata swapData\n ) external view returns (uint256);\n\n function getSwapExpectedReturn(\n address trader,\n address sourceToken,\n address destToken,\n uint256 sourceTokenAmount,\n bytes calldata payload)\n external\n returns (uint256);\n\n function owner() external view returns (address);\n\n function transferOwnership(address newOwner) external;\n\n\n /// Guardian Interface\n\n function _isPaused(bytes4 sig) external view returns (bool isPaused);\n\n function toggleFunctionPause(bytes4 sig) external;\n\n function toggleFunctionUnPause(bytes4 sig) external;\n\n function pause(bytes4 [] calldata sig) external;\n\n function unpause(bytes4 [] calldata sig) external;\n\n function changeGuardian(address newGuardian) external;\n\n function getGuardian() external view returns (address guardian);\n\n /// Loan Cleanup Interface\n\n function cleanupLoans(\n address loanToken,\n bytes32[] calldata loanIds)\n external\n payable\n returns (uint256 totalPrincipalIn);\n\n struct LoanParams {\n bytes32 id;\n bool active;\n address owner;\n address loanToken;\n address collateralToken;\n uint256 minInitialMargin;\n uint256 maintenanceMargin;\n uint256 maxLoanTerm;\n }\n\n struct LoanOpenData {\n bytes32 loanId;\n uint256 principal;\n uint256 collateral;\n }\n\n enum LoanType {\n All,\n Margin,\n NonMargin\n }\n\n struct LoanReturnData {\n bytes32 loanId;\n uint96 endTimestamp;\n address loanToken;\n address collateralToken;\n uint256 principal;\n uint256 collateral;\n uint256 interestOwedPerDay;\n uint256 interestDepositRemaining;\n uint256 startRate;\n uint256 startMargin;\n uint256 maintenanceMargin;\n uint256 currentMargin;\n uint256 maxLoanTerm;\n uint256 maxLiquidatable;\n uint256 maxSeizable;\n uint256 depositValueAsLoanToken;\n uint256 depositValueAsCollateralToken;\n }\n\n enum FeeClaimType {\n All,\n Lending,\n Trading,\n Borrowing\n }\n\n struct Loan {\n bytes32 id; // id of the loan\n bytes32 loanParamsId; // the linked loan params id\n bytes32 pendingTradesId; // the linked pending trades id\n uint256 principal; // total borrowed amount outstanding\n uint256 collateral; // total collateral escrowed for the loan\n uint256 startTimestamp; // loan start time\n uint256 endTimestamp; // for active loans, this is the expected loan end time, for in-active loans, is the actual (past) end time\n uint256 startMargin; // initial margin when the loan opened\n uint256 startRate; // reference rate when the loan opened for converting collateralToken to loanToken\n address borrower; // borrower of this loan\n address lender; // lender of this loan\n bool active; // if false, the loan has been fully closed\n }\n\n struct LenderInterest {\n uint256 principalTotal; // total borrowed amount outstanding of asset\n uint256 owedPerDay; // interest owed per day for all loans of asset\n uint256 owedTotal; // total interest owed for all loans of asset (assuming they go to full term)\n uint256 paidTotal; // total interest paid so far for asset\n uint256 updatedTimestamp; // last update\n }\n\n struct LoanInterest {\n uint256 owedPerDay; // interest owed per day for loan\n uint256 depositTotal; // total escrowed interest for loan\n uint256 updatedTimestamp; // last update\n }\n\t\n\t////// Flash Borrow Fees //////\n function payFlashBorrowFees(\n address user,\n uint256 borrowAmount,\n uint256 flashBorrowFeePercent)\n external;\n}\n", - "type": "interface" -} diff --git a/src/apps/ooki/contracts/abis/i-token.json b/src/apps/ooki/contracts/abis/ooki-i-token.json similarity index 100% rename from src/apps/ooki/contracts/abis/i-token.json rename to src/apps/ooki/contracts/abis/ooki-i-token.json diff --git a/src/apps/ooki/contracts/abis/token-registry.json b/src/apps/ooki/contracts/abis/ooki-token-registry.json similarity index 100% rename from src/apps/ooki/contracts/abis/token-registry.json rename to src/apps/ooki/contracts/abis/ooki-token-registry.json diff --git a/src/apps/ooki/contracts/ethers/IPriceFeeds.ts b/src/apps/ooki/contracts/ethers/IPriceFeeds.ts deleted file mode 100644 index 270423736..000000000 --- a/src/apps/ooki/contracts/ethers/IPriceFeeds.ts +++ /dev/null @@ -1,534 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers'; -import type { FunctionFragment, Result } from '@ethersproject/abi'; -import type { Listener, Provider } from '@ethersproject/providers'; -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; - -export interface IPriceFeedsInterface extends utils.Interface { - functions: { - 'amountInEth(address,uint256)': FunctionFragment; - 'checkPriceDisagreement(address,address,uint256,uint256,uint256)': FunctionFragment; - 'getCurrentMargin(address,address,uint256,uint256)': FunctionFragment; - 'getCurrentMarginAndCollateralSize(address,address,uint256,uint256)': FunctionFragment; - 'getFastGasPrice(address)': FunctionFragment; - 'getMaxDrawdown(address,address,uint256,uint256,uint256)': FunctionFragment; - 'queryPrecision(address,address)': FunctionFragment; - 'queryRate(address,address)': FunctionFragment; - 'queryReturn(address,address,uint256)': FunctionFragment; - 'shouldLiquidate(address,address,uint256,uint256,uint256)': FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | 'amountInEth' - | 'checkPriceDisagreement' - | 'getCurrentMargin' - | 'getCurrentMarginAndCollateralSize' - | 'getFastGasPrice' - | 'getMaxDrawdown' - | 'queryPrecision' - | 'queryRate' - | 'queryReturn' - | 'shouldLiquidate', - ): FunctionFragment; - - encodeFunctionData( - functionFragment: 'amountInEth', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'checkPriceDisagreement', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'getCurrentMargin', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'getCurrentMarginAndCollateralSize', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData(functionFragment: 'getFastGasPrice', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'getMaxDrawdown', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'queryPrecision', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'queryRate', values: [PromiseOrValue, PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'queryReturn', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'shouldLiquidate', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - - decodeFunctionResult(functionFragment: 'amountInEth', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'checkPriceDisagreement', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getCurrentMargin', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getCurrentMarginAndCollateralSize', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getFastGasPrice', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getMaxDrawdown', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'queryPrecision', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'queryRate', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'queryReturn', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'shouldLiquidate', data: BytesLike): Result; - - events: {}; -} - -export interface IPriceFeeds extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: IPriceFeedsInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>; - - listeners(eventFilter?: TypedEventFilter): Array>; - listeners(eventName?: string): Array; - removeAllListeners(eventFilter: TypedEventFilter): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - amountInEth( - Token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { ethAmount: BigNumber }>; - - checkPriceDisagreement( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - destAmount: PromiseOrValue, - maxSlippage: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { sourceToDestSwapRate: BigNumber }>; - - getCurrentMargin( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralToLoanRate: BigNumber; - } - >; - - getCurrentMarginAndCollateralSize( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralInEthAmount: BigNumber; - } - >; - - getFastGasPrice(payToken: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - getMaxDrawdown( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber]>; - - queryPrecision( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { precision: BigNumber }>; - - queryRate( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; precision: BigNumber }>; - - queryReturn( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { destAmount: BigNumber }>; - - shouldLiquidate( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[boolean]>; - }; - - amountInEth( - Token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - checkPriceDisagreement( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - destAmount: PromiseOrValue, - maxSlippage: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMargin( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralToLoanRate: BigNumber; - } - >; - - getCurrentMarginAndCollateralSize( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralInEthAmount: BigNumber; - } - >; - - getFastGasPrice(payToken: PromiseOrValue, overrides?: CallOverrides): Promise; - - getMaxDrawdown( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryPrecision( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryRate( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; precision: BigNumber }>; - - queryReturn( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - shouldLiquidate( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - callStatic: { - amountInEth( - Token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - checkPriceDisagreement( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - destAmount: PromiseOrValue, - maxSlippage: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMargin( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralToLoanRate: BigNumber; - } - >; - - getCurrentMarginAndCollateralSize( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - currentMargin: BigNumber; - collateralInEthAmount: BigNumber; - } - >; - - getFastGasPrice(payToken: PromiseOrValue, overrides?: CallOverrides): Promise; - - getMaxDrawdown( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryPrecision( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryRate( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber, BigNumber] & { rate: BigNumber; precision: BigNumber }>; - - queryReturn( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - shouldLiquidate( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - }; - - filters: {}; - - estimateGas: { - amountInEth( - Token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - checkPriceDisagreement( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - destAmount: PromiseOrValue, - maxSlippage: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMargin( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMarginAndCollateralSize( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getFastGasPrice(payToken: PromiseOrValue, overrides?: CallOverrides): Promise; - - getMaxDrawdown( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryPrecision( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryRate( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryReturn( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - shouldLiquidate( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - }; - - populateTransaction: { - amountInEth( - Token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - checkPriceDisagreement( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - destAmount: PromiseOrValue, - maxSlippage: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMargin( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getCurrentMarginAndCollateralSize( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getFastGasPrice(payToken: PromiseOrValue, overrides?: CallOverrides): Promise; - - getMaxDrawdown( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryPrecision( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryRate( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - queryReturn( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - shouldLiquidate( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - loanAmount: PromiseOrValue, - collateralAmount: PromiseOrValue, - maintenanceMargin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - }; -} diff --git a/src/apps/ooki/contracts/ethers/IStakingV2.ts b/src/apps/ooki/contracts/ethers/IStakingV2.ts deleted file mode 100644 index b54643a6e..000000000 --- a/src/apps/ooki/contracts/ethers/IStakingV2.ts +++ /dev/null @@ -1,1039 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers'; -import type { FunctionFragment, Result } from '@ethersproject/abi'; -import type { Listener, Provider } from '@ethersproject/providers'; -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; - -export interface IStakingV2Interface extends utils.Interface { - functions: { - '_isPaused(bytes4)': FunctionFragment; - '_setProposalVals(address,uint256)': FunctionFragment; - '_totalSupplyPerToken(address)': FunctionFragment; - 'addAltRewards(address,uint256)': FunctionFragment; - 'addRewards(uint256,uint256)': FunctionFragment; - 'balanceOfByAsset(address,address)': FunctionFragment; - 'balanceOfByAssets(address)': FunctionFragment; - 'balanceOfStored(address)': FunctionFragment; - 'changeGuardian(address)': FunctionFragment; - 'claim(bool)': FunctionFragment; - 'claimAltRewards()': FunctionFragment; - 'claimSushi()': FunctionFragment; - 'earned(address)': FunctionFragment; - 'exit()': FunctionFragment; - 'exitSushi()': FunctionFragment; - 'getGuardian()': FunctionFragment; - 'getVariableWeights()': FunctionFragment; - 'governor()': FunctionFragment; - 'owner()': FunctionFragment; - 'pendingCrvRewards(address)': FunctionFragment; - 'setApprovals(address,address,uint256)': FunctionFragment; - 'setGovernor(address)': FunctionFragment; - 'setVoteDelegator(address)': FunctionFragment; - 'stake(address[],uint256[])': FunctionFragment; - 'toggleFunctionPause(bytes4)': FunctionFragment; - 'toggleFunctionUnPause(bytes4)': FunctionFragment; - 'totalSupplyByAsset(address)': FunctionFragment; - 'totalSupplyStored()': FunctionFragment; - 'transferOwnership(address)': FunctionFragment; - 'unstake(address[],uint256[])': FunctionFragment; - 'updateSettings(address,bytes)': FunctionFragment; - 'vestedBalanceForAmount(uint256,uint256,uint256)': FunctionFragment; - 'vestingLastSync(address)': FunctionFragment; - 'votingBalanceOf(address,uint256)': FunctionFragment; - 'votingBalanceOfNow(address)': FunctionFragment; - 'votingFromStakedBalanceOf(address)': FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | '_isPaused' - | '_setProposalVals' - | '_totalSupplyPerToken' - | 'addAltRewards' - | 'addRewards' - | 'balanceOfByAsset' - | 'balanceOfByAssets' - | 'balanceOfStored' - | 'changeGuardian' - | 'claim' - | 'claimAltRewards' - | 'claimSushi' - | 'earned' - | 'exit' - | 'exitSushi' - | 'getGuardian' - | 'getVariableWeights' - | 'governor' - | 'owner' - | 'pendingCrvRewards' - | 'setApprovals' - | 'setGovernor' - | 'setVoteDelegator' - | 'stake' - | 'toggleFunctionPause' - | 'toggleFunctionUnPause' - | 'totalSupplyByAsset' - | 'totalSupplyStored' - | 'transferOwnership' - | 'unstake' - | 'updateSettings' - | 'vestedBalanceForAmount' - | 'vestingLastSync' - | 'votingBalanceOf' - | 'votingBalanceOfNow' - | 'votingFromStakedBalanceOf', - ): FunctionFragment; - - encodeFunctionData(functionFragment: '_isPaused', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: '_setProposalVals', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: '_totalSupplyPerToken', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'addAltRewards', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'addRewards', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'balanceOfByAsset', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'balanceOfByAssets', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'balanceOfStored', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'changeGuardian', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'claim', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'claimAltRewards', values?: undefined): string; - encodeFunctionData(functionFragment: 'claimSushi', values?: undefined): string; - encodeFunctionData(functionFragment: 'earned', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'exit', values?: undefined): string; - encodeFunctionData(functionFragment: 'exitSushi', values?: undefined): string; - encodeFunctionData(functionFragment: 'getGuardian', values?: undefined): string; - encodeFunctionData(functionFragment: 'getVariableWeights', values?: undefined): string; - encodeFunctionData(functionFragment: 'governor', values?: undefined): string; - encodeFunctionData(functionFragment: 'owner', values?: undefined): string; - encodeFunctionData(functionFragment: 'pendingCrvRewards', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'setApprovals', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'setGovernor', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setVoteDelegator', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'stake', - values: [PromiseOrValue[], PromiseOrValue[]], - ): string; - encodeFunctionData(functionFragment: 'toggleFunctionPause', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'toggleFunctionUnPause', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'totalSupplyByAsset', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'totalSupplyStored', values?: undefined): string; - encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'unstake', - values: [PromiseOrValue[], PromiseOrValue[]], - ): string; - encodeFunctionData( - functionFragment: 'updateSettings', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'vestedBalanceForAmount', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'vestingLastSync', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'votingBalanceOf', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'votingBalanceOfNow', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'votingFromStakedBalanceOf', values: [PromiseOrValue]): string; - - decodeFunctionResult(functionFragment: '_isPaused', data: BytesLike): Result; - decodeFunctionResult(functionFragment: '_setProposalVals', data: BytesLike): Result; - decodeFunctionResult(functionFragment: '_totalSupplyPerToken', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'addAltRewards', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'addRewards', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'balanceOfByAsset', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'balanceOfByAssets', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'balanceOfStored', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'changeGuardian', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'claimAltRewards', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'claimSushi', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'earned', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'exit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'exitSushi', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getGuardian', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getVariableWeights', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'governor', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'pendingCrvRewards', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setApprovals', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setGovernor', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setVoteDelegator', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'stake', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'toggleFunctionPause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'toggleFunctionUnPause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'totalSupplyByAsset', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'totalSupplyStored', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'unstake', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'updateSettings', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'vestedBalanceForAmount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'vestingLastSync', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'votingBalanceOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'votingBalanceOfNow', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'votingFromStakedBalanceOf', data: BytesLike): Result; - - events: {}; -} - -export interface IStakingV2 extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: IStakingV2Interface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>; - - listeners(eventFilter?: TypedEventFilter): Array>; - listeners(eventName?: string): Array; - removeAllListeners(eventFilter: TypedEventFilter): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean] & { isPaused: boolean }>; - - _setProposalVals( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - _totalSupplyPerToken(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - addAltRewards( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - addRewards( - newOOKI: PromiseOrValue, - newStableCoin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - balanceOfByAsset( - token: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { balance: BigNumber }>; - - balanceOfByAssets( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxBalance: BigNumber; - iOOKIBalance: BigNumber; - vBZRXBalance: BigNumber; - LPTokenBalance: BigNumber; - } - >; - - balanceOfStored( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - vestedBalance: BigNumber; - vestingBalance: BigNumber; - } - >; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claim( - restake: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimAltRewards(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - claimSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - exitSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - getGuardian(overrides?: CallOverrides): Promise<[string] & { guardian: string }>; - - getVariableWeights(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber, BigNumber] & { - vBZRXWeight: BigNumber; - iOOKIWeight: BigNumber; - LPTokenWeight: BigNumber; - } - >; - - governor(overrides?: CallOverrides): Promise<[string]>; - - owner(overrides?: CallOverrides): Promise<[string]>; - - pendingCrvRewards( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - setApprovals( - _token: PromiseOrValue, - _spender: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setGovernor( - _governor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setVoteDelegator( - stakingGovernance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - stake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - totalSupplyByAsset(token: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - totalSupplyStored(overrides?: CallOverrides): Promise<[BigNumber] & { supply: BigNumber }>; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - unstake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - updateSettings( - settingsTarget: PromiseOrValue, - callData: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - vestedBalanceForAmount( - tokenBalance: PromiseOrValue, - lastUpdate: PromiseOrValue, - vestingEndTime: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { vested: BigNumber }>; - - vestingLastSync(user: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - votingBalanceOf( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { totalVotes: BigNumber }>; - - votingBalanceOfNow( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { totalVotes: BigNumber }>; - - votingFromStakedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { totalVotes: BigNumber }>; - }; - - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - _setProposalVals( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - _totalSupplyPerToken(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - addAltRewards( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - addRewards( - newOOKI: PromiseOrValue, - newStableCoin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - balanceOfByAsset( - token: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - balanceOfByAssets( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxBalance: BigNumber; - iOOKIBalance: BigNumber; - vBZRXBalance: BigNumber; - LPTokenBalance: BigNumber; - } - >; - - balanceOfStored( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - vestedBalance: BigNumber; - vestingBalance: BigNumber; - } - >; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claim( - restake: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimAltRewards(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - claimSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - exitSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getVariableWeights(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber, BigNumber] & { - vBZRXWeight: BigNumber; - iOOKIWeight: BigNumber; - LPTokenWeight: BigNumber; - } - >; - - governor(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pendingCrvRewards( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - setApprovals( - _token: PromiseOrValue, - _spender: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setGovernor( - _governor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setVoteDelegator( - stakingGovernance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - stake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - totalSupplyByAsset(token: PromiseOrValue, overrides?: CallOverrides): Promise; - - totalSupplyStored(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - unstake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - updateSettings( - settingsTarget: PromiseOrValue, - callData: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - vestedBalanceForAmount( - tokenBalance: PromiseOrValue, - lastUpdate: PromiseOrValue, - vestingEndTime: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - vestingLastSync(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingBalanceOf( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - votingBalanceOfNow(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingFromStakedBalanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - callStatic: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - _setProposalVals( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - _totalSupplyPerToken(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - addAltRewards( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - addRewards( - newOOKI: PromiseOrValue, - newStableCoin: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - balanceOfByAsset( - token: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - balanceOfByAssets( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxBalance: BigNumber; - iOOKIBalance: BigNumber; - vBZRXBalance: BigNumber; - LPTokenBalance: BigNumber; - } - >; - - balanceOfStored( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - vestedBalance: BigNumber; - vestingBalance: BigNumber; - } - >; - - changeGuardian(newGuardian: PromiseOrValue, overrides?: CallOverrides): Promise; - - claim(restake: PromiseOrValue, overrides?: CallOverrides): Promise; - - claimAltRewards(overrides?: CallOverrides): Promise; - - claimSushi(overrides?: CallOverrides): Promise; - - earned( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - exit(overrides?: CallOverrides): Promise; - - exitSushi(overrides?: CallOverrides): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getVariableWeights(overrides?: CallOverrides): Promise< - [BigNumber, BigNumber, BigNumber] & { - vBZRXWeight: BigNumber; - iOOKIWeight: BigNumber; - LPTokenWeight: BigNumber; - } - >; - - governor(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pendingCrvRewards( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - bzrxRewardsEarned: BigNumber; - stableCoinRewardsEarned: BigNumber; - bzrxRewardsVesting: BigNumber; - stableCoinRewardsVesting: BigNumber; - sushiRewardsEarned: BigNumber; - } - >; - - setApprovals( - _token: PromiseOrValue, - _spender: PromiseOrValue, - _value: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - setGovernor(_governor: PromiseOrValue, overrides?: CallOverrides): Promise; - - setVoteDelegator(stakingGovernance: PromiseOrValue, overrides?: CallOverrides): Promise; - - stake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - toggleFunctionPause(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - toggleFunctionUnPause(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - totalSupplyByAsset(token: PromiseOrValue, overrides?: CallOverrides): Promise; - - totalSupplyStored(overrides?: CallOverrides): Promise; - - transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; - - unstake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - updateSettings( - settingsTarget: PromiseOrValue, - callData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - vestedBalanceForAmount( - tokenBalance: PromiseOrValue, - lastUpdate: PromiseOrValue, - vestingEndTime: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - vestingLastSync(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingBalanceOf( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - votingBalanceOfNow(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingFromStakedBalanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; - }; - - filters: {}; - - estimateGas: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - _setProposalVals( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - _totalSupplyPerToken(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - addAltRewards( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - addRewards( - newOOKI: PromiseOrValue, - newStableCoin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - balanceOfByAsset( - token: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - balanceOfByAssets(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - balanceOfStored(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claim( - restake: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimAltRewards(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - claimSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - exitSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getVariableWeights(overrides?: CallOverrides): Promise; - - governor(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pendingCrvRewards(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - setApprovals( - _token: PromiseOrValue, - _spender: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setGovernor( - _governor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setVoteDelegator( - stakingGovernance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - stake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - totalSupplyByAsset(token: PromiseOrValue, overrides?: CallOverrides): Promise; - - totalSupplyStored(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - unstake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - updateSettings( - settingsTarget: PromiseOrValue, - callData: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - vestedBalanceForAmount( - tokenBalance: PromiseOrValue, - lastUpdate: PromiseOrValue, - vestingEndTime: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - vestingLastSync(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingBalanceOf( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - votingBalanceOfNow(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingFromStakedBalanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; - }; - - populateTransaction: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - _setProposalVals( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - _totalSupplyPerToken(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - addAltRewards( - token: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - addRewards( - newOOKI: PromiseOrValue, - newStableCoin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - balanceOfByAsset( - token: PromiseOrValue, - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - balanceOfByAssets(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - balanceOfStored(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claim( - restake: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimAltRewards(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - claimSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - earned(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - exit(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - exitSushi(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getVariableWeights(overrides?: CallOverrides): Promise; - - governor(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pendingCrvRewards(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - setApprovals( - _token: PromiseOrValue, - _spender: PromiseOrValue, - _value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setGovernor( - _governor: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setVoteDelegator( - stakingGovernance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - stake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - totalSupplyByAsset(token: PromiseOrValue, overrides?: CallOverrides): Promise; - - totalSupplyStored(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - unstake( - tokens: PromiseOrValue[], - values: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - updateSettings( - settingsTarget: PromiseOrValue, - callData: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - vestedBalanceForAmount( - tokenBalance: PromiseOrValue, - lastUpdate: PromiseOrValue, - vestingEndTime: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - vestingLastSync(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingBalanceOf( - account: PromiseOrValue, - proposalId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - votingBalanceOfNow(account: PromiseOrValue, overrides?: CallOverrides): Promise; - - votingFromStakedBalanceOf( - account: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - }; -} diff --git a/src/apps/ooki/contracts/ethers/IbZx.ts b/src/apps/ooki/contracts/ethers/IbZx.ts deleted file mode 100644 index a591f7c43..000000000 --- a/src/apps/ooki/contracts/ethers/IbZx.ts +++ /dev/null @@ -1,3357 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from 'ethers'; -import type { FunctionFragment, Result } from '@ethersproject/abi'; -import type { Listener, Provider } from '@ethersproject/providers'; -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; - -export declare namespace IBZx { - export type LoanOpenDataStruct = { - loanId: PromiseOrValue; - principal: PromiseOrValue; - collateral: PromiseOrValue; - }; - - export type LoanOpenDataStructOutput = [string, BigNumber, BigNumber] & { - loanId: string; - principal: BigNumber; - collateral: BigNumber; - }; - - export type LoanReturnDataStruct = { - loanId: PromiseOrValue; - endTimestamp: PromiseOrValue; - loanToken: PromiseOrValue; - collateralToken: PromiseOrValue; - principal: PromiseOrValue; - collateral: PromiseOrValue; - interestOwedPerDay: PromiseOrValue; - interestDepositRemaining: PromiseOrValue; - startRate: PromiseOrValue; - startMargin: PromiseOrValue; - maintenanceMargin: PromiseOrValue; - currentMargin: PromiseOrValue; - maxLoanTerm: PromiseOrValue; - maxLiquidatable: PromiseOrValue; - maxSeizable: PromiseOrValue; - depositValueAsLoanToken: PromiseOrValue; - depositValueAsCollateralToken: PromiseOrValue; - }; - - export type LoanReturnDataStructOutput = [ - string, - BigNumber, - string, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - ] & { - loanId: string; - endTimestamp: BigNumber; - loanToken: string; - collateralToken: string; - principal: BigNumber; - collateral: BigNumber; - interestOwedPerDay: BigNumber; - interestDepositRemaining: BigNumber; - startRate: BigNumber; - startMargin: BigNumber; - maintenanceMargin: BigNumber; - currentMargin: BigNumber; - maxLoanTerm: BigNumber; - maxLiquidatable: BigNumber; - maxSeizable: BigNumber; - depositValueAsLoanToken: BigNumber; - depositValueAsCollateralToken: BigNumber; - }; - - export type LoanParamsStruct = { - id: PromiseOrValue; - active: PromiseOrValue; - owner: PromiseOrValue; - loanToken: PromiseOrValue; - collateralToken: PromiseOrValue; - minInitialMargin: PromiseOrValue; - maintenanceMargin: PromiseOrValue; - maxLoanTerm: PromiseOrValue; - }; - - export type LoanParamsStructOutput = [string, boolean, string, string, string, BigNumber, BigNumber, BigNumber] & { - id: string; - active: boolean; - owner: string; - loanToken: string; - collateralToken: string; - minInitialMargin: BigNumber; - maintenanceMargin: BigNumber; - maxLoanTerm: BigNumber; - }; - - export type LenderInterestStruct = { - principalTotal: PromiseOrValue; - owedPerDay: PromiseOrValue; - owedTotal: PromiseOrValue; - paidTotal: PromiseOrValue; - updatedTimestamp: PromiseOrValue; - }; - - export type LenderInterestStructOutput = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - principalTotal: BigNumber; - owedPerDay: BigNumber; - owedTotal: BigNumber; - paidTotal: BigNumber; - updatedTimestamp: BigNumber; - }; - - export type LoanInterestStruct = { - owedPerDay: PromiseOrValue; - depositTotal: PromiseOrValue; - updatedTimestamp: PromiseOrValue; - }; - - export type LoanInterestStructOutput = [BigNumber, BigNumber, BigNumber] & { - owedPerDay: BigNumber; - depositTotal: BigNumber; - updatedTimestamp: BigNumber; - }; - - export type LoanStruct = { - id: PromiseOrValue; - loanParamsId: PromiseOrValue; - pendingTradesId: PromiseOrValue; - principal: PromiseOrValue; - collateral: PromiseOrValue; - startTimestamp: PromiseOrValue; - endTimestamp: PromiseOrValue; - startMargin: PromiseOrValue; - startRate: PromiseOrValue; - borrower: PromiseOrValue; - lender: PromiseOrValue; - active: PromiseOrValue; - }; - - export type LoanStructOutput = [ - string, - string, - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string, - string, - boolean, - ] & { - id: string; - loanParamsId: string; - pendingTradesId: string; - principal: BigNumber; - collateral: BigNumber; - startTimestamp: BigNumber; - endTimestamp: BigNumber; - startMargin: BigNumber; - startRate: BigNumber; - borrower: string; - lender: string; - active: boolean; - }; -} - -export interface IbZxInterface extends utils.Interface { - functions: { - '_isPaused(bytes4)': FunctionFragment; - 'affiliateFeePercent()': FunctionFragment; - 'borrowOrTradeFromPool(bytes32,bytes32,bool,uint256,address[4],uint256[5],bytes)': FunctionFragment; - 'borrowingFeePercent()': FunctionFragment; - 'borrowingFeeTokensHeld(address)': FunctionFragment; - 'borrowingFeeTokensPaid(address)': FunctionFragment; - 'changeGuardian(address)': FunctionFragment; - 'claimRewards(address)': FunctionFragment; - 'cleanupLoans(address,bytes32[])': FunctionFragment; - 'closeWithDeposit(bytes32,address,uint256)': FunctionFragment; - 'closeWithDepositWithGasToken(bytes32,address,address,uint256)': FunctionFragment; - 'closeWithSwap(bytes32,address,uint256,bool,bytes)': FunctionFragment; - 'closeWithSwapWithGasToken(bytes32,address,address,uint256,bool,bytes)': FunctionFragment; - 'delegatedManagers(bytes32,address)': FunctionFragment; - 'depositCollateral(bytes32,uint256)': FunctionFragment; - 'disableLoanParams(bytes32[])': FunctionFragment; - 'feesController()': FunctionFragment; - 'getActiveLoans(uint256,uint256,bool)': FunctionFragment; - 'getActiveLoansAdvanced(uint256,uint256,bool,bool)': FunctionFragment; - 'getActiveLoansCount()': FunctionFragment; - 'getBorrowAmount(address,address,uint256,uint256,bool)': FunctionFragment; - 'getBorrowAmountByParams(bytes32,uint256)': FunctionFragment; - 'getGuardian()': FunctionFragment; - 'getInterestModelValues(address,bytes32)': FunctionFragment; - 'getLoan(bytes32)': FunctionFragment; - 'getLoanInterestOutstanding(bytes32)': FunctionFragment; - 'getLoanParams(bytes32[])': FunctionFragment; - 'getLoanParamsList(address,uint256,uint256)': FunctionFragment; - 'getLoanPoolsList(uint256,uint256)': FunctionFragment; - 'getLoanPrincipal(bytes32)': FunctionFragment; - 'getPoolLastInterestRate(address)': FunctionFragment; - 'getPoolPrincipalStored(address)': FunctionFragment; - 'getRequiredCollateral(address,address,uint256,uint256,bool)': FunctionFragment; - 'getRequiredCollateralByParams(bytes32,uint256)': FunctionFragment; - 'getSwapExpectedReturn(address,address,uint256,bytes)': FunctionFragment; - 'getSwapExpectedReturn(address,address,address,uint256,bytes)': FunctionFragment; - 'getTWAI(address)': FunctionFragment; - 'getTarget(string)': FunctionFragment; - 'getTotalPrincipal(address,address)': FunctionFragment; - 'getUserLoans(address,uint256,uint256,uint8,bool,bool)': FunctionFragment; - 'getUserLoansCount(address,bool)': FunctionFragment; - 'isLoanPool(address)': FunctionFragment; - 'lenderInterest(address,address)': FunctionFragment; - 'lendingFeePercent()': FunctionFragment; - 'lendingFeeTokensHeld(address)': FunctionFragment; - 'lendingFeeTokensPaid(address)': FunctionFragment; - 'liquidate(bytes32,address,uint256)': FunctionFragment; - 'liquidateWithGasToken(bytes32,address,address,uint256)': FunctionFragment; - 'liquidationIncentivePercent(address,address)': FunctionFragment; - 'loanInterest(bytes32)': FunctionFragment; - 'loanParams(bytes32)': FunctionFragment; - 'loanPoolToUnderlying(address)': FunctionFragment; - 'loans(bytes32)': FunctionFragment; - 'logicTargets(bytes4)': FunctionFragment; - 'maxDisagreement()': FunctionFragment; - 'maxSwapSize()': FunctionFragment; - 'owner()': FunctionFragment; - 'pause(bytes4[])': FunctionFragment; - 'payFlashBorrowFees(address,uint256,uint256)': FunctionFragment; - 'priceFeeds()': FunctionFragment; - 'protocolTokenHeld()': FunctionFragment; - 'protocolTokenPaid()': FunctionFragment; - 'queryFees(address[],uint8)': FunctionFragment; - 'replaceContract(address)': FunctionFragment; - 'rewardsBalanceOf(address)': FunctionFragment; - 'setAffiliateFeePercent(uint256)': FunctionFragment; - 'setBorrowingFeePercent(uint256)': FunctionFragment; - 'setDelegatedManager(bytes32,address,bool)': FunctionFragment; - 'setDepositAmount(bytes32,uint256,uint256)': FunctionFragment; - 'setFeesController(address)': FunctionFragment; - 'setLendingFeePercent(uint256)': FunctionFragment; - 'setLiquidationIncentivePercent(address[],address[],uint256[])': FunctionFragment; - 'setLoanPool(address[],address[])': FunctionFragment; - 'setMaxDisagreement(uint256)': FunctionFragment; - 'setMaxSwapSize(uint256)': FunctionFragment; - 'setPriceFeedContract(address)': FunctionFragment; - 'setSourceBufferPercent(uint256)': FunctionFragment; - 'setSupportedTokens(address[],bool[],bool)': FunctionFragment; - 'setSwapsImplContract(address)': FunctionFragment; - 'setTWAISettings(uint32,uint32)': FunctionFragment; - 'setTargets(string[],address[])': FunctionFragment; - 'setTradingFeePercent(uint256)': FunctionFragment; - 'settleInterest(bytes32)': FunctionFragment; - 'setupLoanParams((bytes32,bool,address,address,address,uint256,uint256,uint256)[])': FunctionFragment; - 'setupLoanPoolTWAI(address)': FunctionFragment; - 'sourceBufferPercent()': FunctionFragment; - 'supportedTokens(address)': FunctionFragment; - 'swapExternal(address,address,address,address,uint256,uint256,bytes)': FunctionFragment; - 'swapExternalWithGasToken(address,address,address,address,address,uint256,uint256,bytes)': FunctionFragment; - 'swapsImpl()': FunctionFragment; - 'toggleFunctionPause(bytes4)': FunctionFragment; - 'toggleFunctionUnPause(bytes4)': FunctionFragment; - 'tradingFeePercent()': FunctionFragment; - 'tradingFeeTokensHeld(address)': FunctionFragment; - 'tradingFeeTokensPaid(address)': FunctionFragment; - 'transferLoan(bytes32,address)': FunctionFragment; - 'transferOwnership(address)': FunctionFragment; - 'underlyingToLoanPool(address)': FunctionFragment; - 'unpause(bytes4[])': FunctionFragment; - 'withdrawCollateral(bytes32,address,uint256)': FunctionFragment; - 'withdrawFees(address[],address,uint8)': FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | '_isPaused' - | 'affiliateFeePercent' - | 'borrowOrTradeFromPool' - | 'borrowingFeePercent' - | 'borrowingFeeTokensHeld' - | 'borrowingFeeTokensPaid' - | 'changeGuardian' - | 'claimRewards' - | 'cleanupLoans' - | 'closeWithDeposit' - | 'closeWithDepositWithGasToken' - | 'closeWithSwap' - | 'closeWithSwapWithGasToken' - | 'delegatedManagers' - | 'depositCollateral' - | 'disableLoanParams' - | 'feesController' - | 'getActiveLoans' - | 'getActiveLoansAdvanced' - | 'getActiveLoansCount' - | 'getBorrowAmount' - | 'getBorrowAmountByParams' - | 'getGuardian' - | 'getInterestModelValues' - | 'getLoan' - | 'getLoanInterestOutstanding' - | 'getLoanParams' - | 'getLoanParamsList' - | 'getLoanPoolsList' - | 'getLoanPrincipal' - | 'getPoolLastInterestRate' - | 'getPoolPrincipalStored' - | 'getRequiredCollateral' - | 'getRequiredCollateralByParams' - | 'getSwapExpectedReturn(address,address,uint256,bytes)' - | 'getSwapExpectedReturn(address,address,address,uint256,bytes)' - | 'getTWAI' - | 'getTarget' - | 'getTotalPrincipal' - | 'getUserLoans' - | 'getUserLoansCount' - | 'isLoanPool' - | 'lenderInterest' - | 'lendingFeePercent' - | 'lendingFeeTokensHeld' - | 'lendingFeeTokensPaid' - | 'liquidate' - | 'liquidateWithGasToken' - | 'liquidationIncentivePercent' - | 'loanInterest' - | 'loanParams' - | 'loanPoolToUnderlying' - | 'loans' - | 'logicTargets' - | 'maxDisagreement' - | 'maxSwapSize' - | 'owner' - | 'pause' - | 'payFlashBorrowFees' - | 'priceFeeds' - | 'protocolTokenHeld' - | 'protocolTokenPaid' - | 'queryFees' - | 'replaceContract' - | 'rewardsBalanceOf' - | 'setAffiliateFeePercent' - | 'setBorrowingFeePercent' - | 'setDelegatedManager' - | 'setDepositAmount' - | 'setFeesController' - | 'setLendingFeePercent' - | 'setLiquidationIncentivePercent' - | 'setLoanPool' - | 'setMaxDisagreement' - | 'setMaxSwapSize' - | 'setPriceFeedContract' - | 'setSourceBufferPercent' - | 'setSupportedTokens' - | 'setSwapsImplContract' - | 'setTWAISettings' - | 'setTargets' - | 'setTradingFeePercent' - | 'settleInterest' - | 'setupLoanParams' - | 'setupLoanPoolTWAI' - | 'sourceBufferPercent' - | 'supportedTokens' - | 'swapExternal' - | 'swapExternalWithGasToken' - | 'swapsImpl' - | 'toggleFunctionPause' - | 'toggleFunctionUnPause' - | 'tradingFeePercent' - | 'tradingFeeTokensHeld' - | 'tradingFeeTokensPaid' - | 'transferLoan' - | 'transferOwnership' - | 'underlyingToLoanPool' - | 'unpause' - | 'withdrawCollateral' - | 'withdrawFees', - ): FunctionFragment; - - encodeFunctionData(functionFragment: '_isPaused', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'affiliateFeePercent', values?: undefined): string; - encodeFunctionData( - functionFragment: 'borrowOrTradeFromPool', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - PromiseOrValue, - ], - ): string; - encodeFunctionData(functionFragment: 'borrowingFeePercent', values?: undefined): string; - encodeFunctionData(functionFragment: 'borrowingFeeTokensHeld', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'borrowingFeeTokensPaid', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'changeGuardian', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'claimRewards', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'cleanupLoans', - values: [PromiseOrValue, PromiseOrValue[]], - ): string; - encodeFunctionData( - functionFragment: 'closeWithDeposit', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'closeWithDepositWithGasToken', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'closeWithSwap', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'closeWithSwapWithGasToken', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'delegatedManagers', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'depositCollateral', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'disableLoanParams', values: [PromiseOrValue[]]): string; - encodeFunctionData(functionFragment: 'feesController', values?: undefined): string; - encodeFunctionData( - functionFragment: 'getActiveLoans', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'getActiveLoansAdvanced', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData(functionFragment: 'getActiveLoansCount', values?: undefined): string; - encodeFunctionData( - functionFragment: 'getBorrowAmount', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'getBorrowAmountByParams', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'getGuardian', values?: undefined): string; - encodeFunctionData( - functionFragment: 'getInterestModelValues', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'getLoan', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'getLoanInterestOutstanding', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'getLoanParams', values: [PromiseOrValue[]]): string; - encodeFunctionData( - functionFragment: 'getLoanParamsList', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'getLoanPoolsList', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'getLoanPrincipal', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'getPoolLastInterestRate', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'getPoolPrincipalStored', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'getRequiredCollateral', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'getRequiredCollateralByParams', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'getSwapExpectedReturn(address,address,uint256,bytes)', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'getSwapExpectedReturn(address,address,address,uint256,bytes)', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData(functionFragment: 'getTWAI', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'getTarget', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'getTotalPrincipal', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'getUserLoans', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'getUserLoansCount', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'isLoanPool', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'lenderInterest', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'lendingFeePercent', values?: undefined): string; - encodeFunctionData(functionFragment: 'lendingFeeTokensHeld', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'lendingFeeTokensPaid', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'liquidate', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'liquidateWithGasToken', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'liquidationIncentivePercent', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'loanInterest', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'loanParams', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'loanPoolToUnderlying', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'loans', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'logicTargets', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'maxDisagreement', values?: undefined): string; - encodeFunctionData(functionFragment: 'maxSwapSize', values?: undefined): string; - encodeFunctionData(functionFragment: 'owner', values?: undefined): string; - encodeFunctionData(functionFragment: 'pause', values: [PromiseOrValue[]]): string; - encodeFunctionData( - functionFragment: 'payFlashBorrowFees', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'priceFeeds', values?: undefined): string; - encodeFunctionData(functionFragment: 'protocolTokenHeld', values?: undefined): string; - encodeFunctionData(functionFragment: 'protocolTokenPaid', values?: undefined): string; - encodeFunctionData( - functionFragment: 'queryFees', - values: [PromiseOrValue[], PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'replaceContract', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'rewardsBalanceOf', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setAffiliateFeePercent', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setBorrowingFeePercent', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'setDelegatedManager', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'setDepositAmount', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'setFeesController', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setLendingFeePercent', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'setLiquidationIncentivePercent', - values: [PromiseOrValue[], PromiseOrValue[], PromiseOrValue[]], - ): string; - encodeFunctionData( - functionFragment: 'setLoanPool', - values: [PromiseOrValue[], PromiseOrValue[]], - ): string; - encodeFunctionData(functionFragment: 'setMaxDisagreement', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setMaxSwapSize', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setPriceFeedContract', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setSourceBufferPercent', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'setSupportedTokens', - values: [PromiseOrValue[], PromiseOrValue[], PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'setSwapsImplContract', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'setTWAISettings', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'setTargets', - values: [PromiseOrValue[], PromiseOrValue[]], - ): string; - encodeFunctionData(functionFragment: 'setTradingFeePercent', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'settleInterest', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'setupLoanParams', values: [IBZx.LoanParamsStruct[]]): string; - encodeFunctionData(functionFragment: 'setupLoanPoolTWAI', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'sourceBufferPercent', values?: undefined): string; - encodeFunctionData(functionFragment: 'supportedTokens', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'swapExternal', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData( - functionFragment: 'swapExternalWithGasToken', - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - ): string; - encodeFunctionData(functionFragment: 'swapsImpl', values?: undefined): string; - encodeFunctionData(functionFragment: 'toggleFunctionPause', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'toggleFunctionUnPause', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'tradingFeePercent', values?: undefined): string; - encodeFunctionData(functionFragment: 'tradingFeeTokensHeld', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'tradingFeeTokensPaid', values: [PromiseOrValue]): string; - encodeFunctionData( - functionFragment: 'transferLoan', - values: [PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'underlyingToLoanPool', values: [PromiseOrValue]): string; - encodeFunctionData(functionFragment: 'unpause', values: [PromiseOrValue[]]): string; - encodeFunctionData( - functionFragment: 'withdrawCollateral', - values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], - ): string; - encodeFunctionData( - functionFragment: 'withdrawFees', - values: [PromiseOrValue[], PromiseOrValue, PromiseOrValue], - ): string; - - decodeFunctionResult(functionFragment: '_isPaused', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'affiliateFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'borrowOrTradeFromPool', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'borrowingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'borrowingFeeTokensHeld', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'borrowingFeeTokensPaid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'changeGuardian', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'claimRewards', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'cleanupLoans', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'closeWithDeposit', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'closeWithDepositWithGasToken', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'closeWithSwap', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'closeWithSwapWithGasToken', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'delegatedManagers', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'depositCollateral', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'disableLoanParams', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'feesController', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getActiveLoans', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getActiveLoansAdvanced', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getActiveLoansCount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getBorrowAmount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getBorrowAmountByParams', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getGuardian', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getInterestModelValues', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoan', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoanInterestOutstanding', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoanParams', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoanParamsList', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoanPoolsList', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getLoanPrincipal', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getPoolLastInterestRate', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getPoolPrincipalStored', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getRequiredCollateral', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getRequiredCollateralByParams', data: BytesLike): Result; - decodeFunctionResult( - functionFragment: 'getSwapExpectedReturn(address,address,uint256,bytes)', - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: 'getSwapExpectedReturn(address,address,address,uint256,bytes)', - data: BytesLike, - ): Result; - decodeFunctionResult(functionFragment: 'getTWAI', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getTarget', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getTotalPrincipal', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getUserLoans', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'getUserLoansCount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'isLoanPool', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'lenderInterest', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'lendingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'lendingFeeTokensHeld', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'lendingFeeTokensPaid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'liquidate', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'liquidateWithGasToken', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'liquidationIncentivePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'loanInterest', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'loanParams', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'loanPoolToUnderlying', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'loans', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'logicTargets', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'maxDisagreement', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'maxSwapSize', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'pause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'payFlashBorrowFees', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'priceFeeds', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'protocolTokenHeld', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'protocolTokenPaid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'queryFees', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'replaceContract', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'rewardsBalanceOf', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setAffiliateFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setBorrowingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setDelegatedManager', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setDepositAmount', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setFeesController', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setLendingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setLiquidationIncentivePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setLoanPool', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setMaxDisagreement', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setMaxSwapSize', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setPriceFeedContract', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setSourceBufferPercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setSupportedTokens', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setSwapsImplContract', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setTWAISettings', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setTargets', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setTradingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'settleInterest', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setupLoanParams', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'setupLoanPoolTWAI', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'sourceBufferPercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'supportedTokens', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'swapExternal', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'swapExternalWithGasToken', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'swapsImpl', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'toggleFunctionPause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'toggleFunctionUnPause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'tradingFeePercent', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'tradingFeeTokensHeld', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'tradingFeeTokensPaid', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'transferLoan', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'underlyingToLoanPool', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'unpause', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'withdrawCollateral', data: BytesLike): Result; - decodeFunctionResult(functionFragment: 'withdrawFees', data: BytesLike): Result; - - events: {}; -} - -export interface IbZx extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: IbZxInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>; - - listeners(eventFilter?: TypedEventFilter): Array>; - listeners(eventName?: string): Array; - removeAllListeners(eventFilter: TypedEventFilter): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean] & { isPaused: boolean }>; - - affiliateFeePercent(overrides?: CallOverrides): Promise<[BigNumber]>; - - borrowOrTradeFromPool( - loanParamsId: PromiseOrValue, - loanId: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - initialMargin: PromiseOrValue, - sentAddresses: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - sentValues: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - loanDataBytes: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - borrowingFeePercent(overrides?: CallOverrides): Promise<[BigNumber]>; - - borrowingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - borrowingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimRewards( - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - cleanupLoans( - loanToken: PromiseOrValue, - loanIds: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDeposit( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDepositWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwap( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwapWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - delegatedManagers( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[boolean]>; - - depositCollateral( - loanId: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - disableLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - feesController(overrides?: CallOverrides): Promise<[string]>; - - getActiveLoans( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [IBZx.LoanReturnDataStructOutput[]] & { - loansData: IBZx.LoanReturnDataStructOutput[]; - } - >; - - getActiveLoansAdvanced( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - isLiquidatable: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [IBZx.LoanReturnDataStructOutput[]] & { - loansData: IBZx.LoanReturnDataStructOutput[]; - } - >; - - getActiveLoansCount(overrides?: CallOverrides): Promise<[BigNumber]>; - - getBorrowAmount( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { borrowAmount: BigNumber }>; - - getBorrowAmountByParams( - loanParamsId: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { borrowAmount: BigNumber }>; - - getGuardian(overrides?: CallOverrides): Promise<[string] & { guardian: string }>; - - getInterestModelValues( - pool: PromiseOrValue, - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - _poolLastUpdateTime: BigNumber; - _poolPrincipalTotal: BigNumber; - _poolInterestTotal: BigNumber; - _poolRatePerTokenStored: BigNumber; - _poolLastInterestRate: BigNumber; - _loanPrincipalTotal: BigNumber; - _loanInterestTotal: BigNumber; - _loanRatePerTokenPaid: BigNumber; - } - >; - - getLoan( - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [IBZx.LoanReturnDataStructOutput] & { - loanData: IBZx.LoanReturnDataStructOutput; - } - >; - - getLoanInterestOutstanding( - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { interest: BigNumber }>; - - getLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise< - [IBZx.LoanParamsStructOutput[]] & { - loanParamsList: IBZx.LoanParamsStructOutput[]; - } - >; - - getLoanParamsList( - owner: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[string[]] & { loanParamsList: string[] }>; - - getLoanPoolsList( - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[string[]] & { loanPoolsList: string[] }>; - - getLoanPrincipal( - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { principal: BigNumber }>; - - getPoolLastInterestRate(pool: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - getPoolPrincipalStored(pool: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - getRequiredCollateral( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - newPrincipal: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { collateralAmountRequired: BigNumber }>; - - getRequiredCollateralByParams( - loanParamsId: PromiseOrValue, - newPrincipal: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { collateralAmountRequired: BigNumber }>; - - 'getSwapExpectedReturn(address,address,uint256,bytes)'( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber]>; - - 'getSwapExpectedReturn(address,address,address,uint256,bytes)'( - trader: PromiseOrValue, - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - payload: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - getTWAI( - pool: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { benchmarkRate: BigNumber }>; - - getTarget(sig: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; - - getTotalPrincipal( - lender: PromiseOrValue, - loanToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber]>; - - getUserLoans( - user: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - loanType: PromiseOrValue, - isLender: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [IBZx.LoanReturnDataStructOutput[]] & { - loansData: IBZx.LoanReturnDataStructOutput[]; - } - >; - - getUserLoansCount( - user: PromiseOrValue, - isLender: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber]>; - - isLoanPool(loanPool: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; - - lenderInterest( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[IBZx.LenderInterestStructOutput]>; - - lendingFeePercent(overrides?: CallOverrides): Promise<[BigNumber]>; - - lendingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - lendingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - liquidate( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidateWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidationIncentivePercent( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber]>; - - loanInterest(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[IBZx.LoanInterestStructOutput]>; - - loanParams(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[IBZx.LoanParamsStructOutput]>; - - loanPoolToUnderlying(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; - - loans(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[IBZx.LoanStructOutput]>; - - logicTargets(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; - - maxDisagreement(overrides?: CallOverrides): Promise<[BigNumber]>; - - maxSwapSize(overrides?: CallOverrides): Promise<[BigNumber]>; - - owner(overrides?: CallOverrides): Promise<[string]>; - - pause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - payFlashBorrowFees( - user: PromiseOrValue, - borrowAmount: PromiseOrValue, - flashBorrowFeePercent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - priceFeeds(overrides?: CallOverrides): Promise<[string]>; - - protocolTokenHeld(overrides?: CallOverrides): Promise<[BigNumber]>; - - protocolTokenPaid(overrides?: CallOverrides): Promise<[BigNumber]>; - - queryFees( - tokens: PromiseOrValue[], - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber[], BigNumber[]] & { - amountsHeld: BigNumber[]; - amountsPaid: BigNumber[]; - } - >; - - replaceContract( - target: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - rewardsBalanceOf( - user: PromiseOrValue, - overrides?: CallOverrides, - ): Promise<[BigNumber] & { rewardsBalance: BigNumber }>; - - setAffiliateFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setBorrowingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDelegatedManager( - loanId: PromiseOrValue, - delegated: PromiseOrValue, - toggle: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDepositAmount( - loanId: PromiseOrValue, - depositValueAsLoanToken: PromiseOrValue, - depositValueAsCollateralToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setFeesController( - newController: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLendingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLiquidationIncentivePercent( - loanTokens: PromiseOrValue[], - collateralTokens: PromiseOrValue[], - amounts: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLoanPool( - pools: PromiseOrValue[], - assets: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxDisagreement( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxSwapSize( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setPriceFeedContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSourceBufferPercent( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSupportedTokens( - addrs: PromiseOrValue[], - toggles: PromiseOrValue[], - withApprovals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSwapsImplContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTWAISettings( - delta: PromiseOrValue, - secondsAgo: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTargets( - sigsArr: PromiseOrValue[], - targetsArr: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTradingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - settleInterest( - loanId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanParams( - loanParamsList: IBZx.LoanParamsStruct[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanPoolTWAI( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - sourceBufferPercent(overrides?: CallOverrides): Promise<[BigNumber]>; - - supportedTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; - - swapExternal( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapExternalWithGasToken( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - gasTokenUser: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapsImpl(overrides?: CallOverrides): Promise<[string]>; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - tradingFeePercent(overrides?: CallOverrides): Promise<[BigNumber]>; - - tradingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - tradingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; - - transferLoan( - loanId: PromiseOrValue, - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - underlyingToLoanPool(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; - - unpause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawCollateral( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - withdrawAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawFees( - tokens: PromiseOrValue[], - receiver: PromiseOrValue, - feeType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - }; - - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - affiliateFeePercent(overrides?: CallOverrides): Promise; - - borrowOrTradeFromPool( - loanParamsId: PromiseOrValue, - loanId: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - initialMargin: PromiseOrValue, - sentAddresses: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - sentValues: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - loanDataBytes: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - borrowingFeePercent(overrides?: CallOverrides): Promise; - - borrowingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - borrowingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimRewards( - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - cleanupLoans( - loanToken: PromiseOrValue, - loanIds: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDeposit( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDepositWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwap( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwapWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - delegatedManagers( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - depositCollateral( - loanId: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - disableLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - feesController(overrides?: CallOverrides): Promise; - - getActiveLoans( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansAdvanced( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - isLiquidatable: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansCount(overrides?: CallOverrides): Promise; - - getBorrowAmount( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getBorrowAmountByParams( - loanParamsId: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getInterestModelValues( - pool: PromiseOrValue, - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - _poolLastUpdateTime: BigNumber; - _poolPrincipalTotal: BigNumber; - _poolInterestTotal: BigNumber; - _poolRatePerTokenStored: BigNumber; - _poolLastInterestRate: BigNumber; - _loanPrincipalTotal: BigNumber; - _loanInterestTotal: BigNumber; - _loanRatePerTokenPaid: BigNumber; - } - >; - - getLoan(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanInterestOutstanding(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - getLoanParamsList( - owner: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPoolsList( - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPrincipal(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolLastInterestRate(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolPrincipalStored(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getRequiredCollateral( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - newPrincipal: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getRequiredCollateralByParams( - loanParamsId: PromiseOrValue, - newPrincipal: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,uint256,bytes)'( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,address,uint256,bytes)'( - trader: PromiseOrValue, - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - payload: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - getTWAI(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTarget(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTotalPrincipal( - lender: PromiseOrValue, - loanToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoans( - user: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - loanType: PromiseOrValue, - isLender: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoansCount( - user: PromiseOrValue, - isLender: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - isLoanPool(loanPool: PromiseOrValue, overrides?: CallOverrides): Promise; - - lenderInterest( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - lendingFeePercent(overrides?: CallOverrides): Promise; - - lendingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - lendingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - liquidate( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidateWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidationIncentivePercent( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - loanInterest(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanParams(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanPoolToUnderlying(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loans(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - logicTargets(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - maxDisagreement(overrides?: CallOverrides): Promise; - - maxSwapSize(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - payFlashBorrowFees( - user: PromiseOrValue, - borrowAmount: PromiseOrValue, - flashBorrowFeePercent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - priceFeeds(overrides?: CallOverrides): Promise; - - protocolTokenHeld(overrides?: CallOverrides): Promise; - - protocolTokenPaid(overrides?: CallOverrides): Promise; - - queryFees( - tokens: PromiseOrValue[], - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber[], BigNumber[]] & { - amountsHeld: BigNumber[]; - amountsPaid: BigNumber[]; - } - >; - - replaceContract( - target: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - rewardsBalanceOf(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - setAffiliateFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setBorrowingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDelegatedManager( - loanId: PromiseOrValue, - delegated: PromiseOrValue, - toggle: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDepositAmount( - loanId: PromiseOrValue, - depositValueAsLoanToken: PromiseOrValue, - depositValueAsCollateralToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setFeesController( - newController: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLendingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLiquidationIncentivePercent( - loanTokens: PromiseOrValue[], - collateralTokens: PromiseOrValue[], - amounts: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLoanPool( - pools: PromiseOrValue[], - assets: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxDisagreement( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxSwapSize( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setPriceFeedContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSourceBufferPercent( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSupportedTokens( - addrs: PromiseOrValue[], - toggles: PromiseOrValue[], - withApprovals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSwapsImplContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTWAISettings( - delta: PromiseOrValue, - secondsAgo: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTargets( - sigsArr: PromiseOrValue[], - targetsArr: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTradingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - settleInterest( - loanId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanParams( - loanParamsList: IBZx.LoanParamsStruct[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanPoolTWAI( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - sourceBufferPercent(overrides?: CallOverrides): Promise; - - supportedTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - swapExternal( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapExternalWithGasToken( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - gasTokenUser: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapsImpl(overrides?: CallOverrides): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - tradingFeePercent(overrides?: CallOverrides): Promise; - - tradingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - tradingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - transferLoan( - loanId: PromiseOrValue, - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - underlyingToLoanPool(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - unpause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawCollateral( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - withdrawAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawFees( - tokens: PromiseOrValue[], - receiver: PromiseOrValue, - feeType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - callStatic: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - affiliateFeePercent(overrides?: CallOverrides): Promise; - - borrowOrTradeFromPool( - loanParamsId: PromiseOrValue, - loanId: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - initialMargin: PromiseOrValue, - sentAddresses: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - sentValues: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - loanDataBytes: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - borrowingFeePercent(overrides?: CallOverrides): Promise; - - borrowingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - borrowingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian(newGuardian: PromiseOrValue, overrides?: CallOverrides): Promise; - - claimRewards(receiver: PromiseOrValue, overrides?: CallOverrides): Promise; - - cleanupLoans( - loanToken: PromiseOrValue, - loanIds: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - closeWithDeposit( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - withdrawAmount: BigNumber; - withdrawToken: string; - } - >; - - closeWithDepositWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - withdrawAmount: BigNumber; - withdrawToken: string; - } - >; - - closeWithSwap( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - withdrawAmount: BigNumber; - withdrawToken: string; - } - >; - - closeWithSwapWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - withdrawAmount: BigNumber; - withdrawToken: string; - } - >; - - delegatedManagers( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - depositCollateral( - loanId: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - disableLoanParams(loanParamsIdList: PromiseOrValue[], overrides?: CallOverrides): Promise; - - feesController(overrides?: CallOverrides): Promise; - - getActiveLoans( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansAdvanced( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - isLiquidatable: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansCount(overrides?: CallOverrides): Promise; - - getBorrowAmount( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getBorrowAmountByParams( - loanParamsId: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getInterestModelValues( - pool: PromiseOrValue, - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { - _poolLastUpdateTime: BigNumber; - _poolPrincipalTotal: BigNumber; - _poolInterestTotal: BigNumber; - _poolRatePerTokenStored: BigNumber; - _poolLastInterestRate: BigNumber; - _loanPrincipalTotal: BigNumber; - _loanInterestTotal: BigNumber; - _loanRatePerTokenPaid: BigNumber; - } - >; - - getLoan(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanInterestOutstanding(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - getLoanParamsList( - owner: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPoolsList( - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPrincipal(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolLastInterestRate(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolPrincipalStored(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getRequiredCollateral( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - newPrincipal: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getRequiredCollateralByParams( - loanParamsId: PromiseOrValue, - newPrincipal: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,uint256,bytes)'( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,address,uint256,bytes)'( - trader: PromiseOrValue, - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - payload: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getTWAI(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTarget(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTotalPrincipal( - lender: PromiseOrValue, - loanToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoans( - user: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - loanType: PromiseOrValue, - isLender: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoansCount( - user: PromiseOrValue, - isLender: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - isLoanPool(loanPool: PromiseOrValue, overrides?: CallOverrides): Promise; - - lenderInterest( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - lendingFeePercent(overrides?: CallOverrides): Promise; - - lendingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - lendingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - liquidate( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - seizedAmount: BigNumber; - seizedToken: string; - } - >; - - liquidateWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber, string] & { - loanCloseAmount: BigNumber; - seizedAmount: BigNumber; - seizedToken: string; - } - >; - - liquidationIncentivePercent( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - loanInterest(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanParams(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanPoolToUnderlying(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loans(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - logicTargets(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - maxDisagreement(overrides?: CallOverrides): Promise; - - maxSwapSize(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pause(sig: PromiseOrValue[], overrides?: CallOverrides): Promise; - - payFlashBorrowFees( - user: PromiseOrValue, - borrowAmount: PromiseOrValue, - flashBorrowFeePercent: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - priceFeeds(overrides?: CallOverrides): Promise; - - protocolTokenHeld(overrides?: CallOverrides): Promise; - - protocolTokenPaid(overrides?: CallOverrides): Promise; - - queryFees( - tokens: PromiseOrValue[], - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber[], BigNumber[]] & { - amountsHeld: BigNumber[]; - amountsPaid: BigNumber[]; - } - >; - - replaceContract(target: PromiseOrValue, overrides?: CallOverrides): Promise; - - rewardsBalanceOf(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - setAffiliateFeePercent(newValue: PromiseOrValue, overrides?: CallOverrides): Promise; - - setBorrowingFeePercent(newValue: PromiseOrValue, overrides?: CallOverrides): Promise; - - setDelegatedManager( - loanId: PromiseOrValue, - delegated: PromiseOrValue, - toggle: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - setDepositAmount( - loanId: PromiseOrValue, - depositValueAsLoanToken: PromiseOrValue, - depositValueAsCollateralToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - setFeesController(newController: PromiseOrValue, overrides?: CallOverrides): Promise; - - setLendingFeePercent(newValue: PromiseOrValue, overrides?: CallOverrides): Promise; - - setLiquidationIncentivePercent( - loanTokens: PromiseOrValue[], - collateralTokens: PromiseOrValue[], - amounts: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - setLoanPool( - pools: PromiseOrValue[], - assets: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - setMaxDisagreement(newAmount: PromiseOrValue, overrides?: CallOverrides): Promise; - - setMaxSwapSize(newAmount: PromiseOrValue, overrides?: CallOverrides): Promise; - - setPriceFeedContract(newContract: PromiseOrValue, overrides?: CallOverrides): Promise; - - setSourceBufferPercent(newAmount: PromiseOrValue, overrides?: CallOverrides): Promise; - - setSupportedTokens( - addrs: PromiseOrValue[], - toggles: PromiseOrValue[], - withApprovals: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - setSwapsImplContract(newContract: PromiseOrValue, overrides?: CallOverrides): Promise; - - setTWAISettings( - delta: PromiseOrValue, - secondsAgo: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - setTargets( - sigsArr: PromiseOrValue[], - targetsArr: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - setTradingFeePercent(newValue: PromiseOrValue, overrides?: CallOverrides): Promise; - - settleInterest(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - setupLoanParams(loanParamsList: IBZx.LoanParamsStruct[], overrides?: CallOverrides): Promise; - - setupLoanPoolTWAI(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - sourceBufferPercent(overrides?: CallOverrides): Promise; - - supportedTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - swapExternal( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - destTokenAmountReceived: BigNumber; - sourceTokenAmountUsed: BigNumber; - } - >; - - swapExternalWithGasToken( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - gasTokenUser: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise< - [BigNumber, BigNumber] & { - destTokenAmountReceived: BigNumber; - sourceTokenAmountUsed: BigNumber; - } - >; - - swapsImpl(overrides?: CallOverrides): Promise; - - toggleFunctionPause(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - toggleFunctionUnPause(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - tradingFeePercent(overrides?: CallOverrides): Promise; - - tradingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - tradingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - transferLoan( - loanId: PromiseOrValue, - newOwner: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; - - underlyingToLoanPool(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - unpause(sig: PromiseOrValue[], overrides?: CallOverrides): Promise; - - withdrawCollateral( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - withdrawAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - withdrawFees( - tokens: PromiseOrValue[], - receiver: PromiseOrValue, - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - }; - - filters: {}; - - estimateGas: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - affiliateFeePercent(overrides?: CallOverrides): Promise; - - borrowOrTradeFromPool( - loanParamsId: PromiseOrValue, - loanId: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - initialMargin: PromiseOrValue, - sentAddresses: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - sentValues: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - loanDataBytes: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - borrowingFeePercent(overrides?: CallOverrides): Promise; - - borrowingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - borrowingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimRewards( - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - cleanupLoans( - loanToken: PromiseOrValue, - loanIds: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDeposit( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDepositWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwap( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwapWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - delegatedManagers( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - depositCollateral( - loanId: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - disableLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - feesController(overrides?: CallOverrides): Promise; - - getActiveLoans( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansAdvanced( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - isLiquidatable: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansCount(overrides?: CallOverrides): Promise; - - getBorrowAmount( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getBorrowAmountByParams( - loanParamsId: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getInterestModelValues( - pool: PromiseOrValue, - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoan(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanInterestOutstanding(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanParams(loanParamsIdList: PromiseOrValue[], overrides?: CallOverrides): Promise; - - getLoanParamsList( - owner: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPoolsList( - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPrincipal(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolLastInterestRate(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolPrincipalStored(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getRequiredCollateral( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - newPrincipal: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getRequiredCollateralByParams( - loanParamsId: PromiseOrValue, - newPrincipal: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,uint256,bytes)'( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,address,uint256,bytes)'( - trader: PromiseOrValue, - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - payload: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - getTWAI(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTarget(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTotalPrincipal( - lender: PromiseOrValue, - loanToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoans( - user: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - loanType: PromiseOrValue, - isLender: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoansCount( - user: PromiseOrValue, - isLender: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - isLoanPool(loanPool: PromiseOrValue, overrides?: CallOverrides): Promise; - - lenderInterest( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - lendingFeePercent(overrides?: CallOverrides): Promise; - - lendingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - lendingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - liquidate( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidateWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidationIncentivePercent( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - loanInterest(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanParams(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanPoolToUnderlying(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loans(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - logicTargets(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - maxDisagreement(overrides?: CallOverrides): Promise; - - maxSwapSize(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - payFlashBorrowFees( - user: PromiseOrValue, - borrowAmount: PromiseOrValue, - flashBorrowFeePercent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - priceFeeds(overrides?: CallOverrides): Promise; - - protocolTokenHeld(overrides?: CallOverrides): Promise; - - protocolTokenPaid(overrides?: CallOverrides): Promise; - - queryFees( - tokens: PromiseOrValue[], - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - replaceContract( - target: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - rewardsBalanceOf(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - setAffiliateFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setBorrowingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDelegatedManager( - loanId: PromiseOrValue, - delegated: PromiseOrValue, - toggle: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDepositAmount( - loanId: PromiseOrValue, - depositValueAsLoanToken: PromiseOrValue, - depositValueAsCollateralToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setFeesController( - newController: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLendingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLiquidationIncentivePercent( - loanTokens: PromiseOrValue[], - collateralTokens: PromiseOrValue[], - amounts: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLoanPool( - pools: PromiseOrValue[], - assets: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxDisagreement( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxSwapSize( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setPriceFeedContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSourceBufferPercent( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSupportedTokens( - addrs: PromiseOrValue[], - toggles: PromiseOrValue[], - withApprovals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSwapsImplContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTWAISettings( - delta: PromiseOrValue, - secondsAgo: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTargets( - sigsArr: PromiseOrValue[], - targetsArr: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTradingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - settleInterest( - loanId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanParams( - loanParamsList: IBZx.LoanParamsStruct[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanPoolTWAI( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - sourceBufferPercent(overrides?: CallOverrides): Promise; - - supportedTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - swapExternal( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapExternalWithGasToken( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - gasTokenUser: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapsImpl(overrides?: CallOverrides): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - tradingFeePercent(overrides?: CallOverrides): Promise; - - tradingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - tradingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - transferLoan( - loanId: PromiseOrValue, - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - underlyingToLoanPool(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - unpause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawCollateral( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - withdrawAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawFees( - tokens: PromiseOrValue[], - receiver: PromiseOrValue, - feeType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - }; - - populateTransaction: { - _isPaused(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - affiliateFeePercent(overrides?: CallOverrides): Promise; - - borrowOrTradeFromPool( - loanParamsId: PromiseOrValue, - loanId: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - initialMargin: PromiseOrValue, - sentAddresses: [PromiseOrValue, PromiseOrValue, PromiseOrValue, PromiseOrValue], - sentValues: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - ], - loanDataBytes: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - borrowingFeePercent(overrides?: CallOverrides): Promise; - - borrowingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - borrowingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - changeGuardian( - newGuardian: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - claimRewards( - receiver: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - cleanupLoans( - loanToken: PromiseOrValue, - loanIds: PromiseOrValue[], - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDeposit( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithDepositWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwap( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - closeWithSwapWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - swapAmount: PromiseOrValue, - returnTokenIsCollateral: PromiseOrValue, - loanDataBytes: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - delegatedManagers( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - depositCollateral( - loanId: PromiseOrValue, - depositAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - disableLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - feesController(overrides?: CallOverrides): Promise; - - getActiveLoans( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansAdvanced( - start: PromiseOrValue, - count: PromiseOrValue, - unsafeOnly: PromiseOrValue, - isLiquidatable: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getActiveLoansCount(overrides?: CallOverrides): Promise; - - getBorrowAmount( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getBorrowAmountByParams( - loanParamsId: PromiseOrValue, - collateralTokenAmount: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getGuardian(overrides?: CallOverrides): Promise; - - getInterestModelValues( - pool: PromiseOrValue, - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoan(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getLoanInterestOutstanding( - loanId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanParams( - loanParamsIdList: PromiseOrValue[], - overrides?: CallOverrides, - ): Promise; - - getLoanParamsList( - owner: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPoolsList( - start: PromiseOrValue, - count: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getLoanPrincipal(loanId: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolLastInterestRate(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getPoolPrincipalStored(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getRequiredCollateral( - loanToken: PromiseOrValue, - collateralToken: PromiseOrValue, - newPrincipal: PromiseOrValue, - marginAmount: PromiseOrValue, - isTorqueLoan: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getRequiredCollateralByParams( - loanParamsId: PromiseOrValue, - newPrincipal: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,uint256,bytes)'( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - 'getSwapExpectedReturn(address,address,address,uint256,bytes)'( - trader: PromiseOrValue, - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - payload: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - getTWAI(pool: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTarget(sig: PromiseOrValue, overrides?: CallOverrides): Promise; - - getTotalPrincipal( - lender: PromiseOrValue, - loanToken: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoans( - user: PromiseOrValue, - start: PromiseOrValue, - count: PromiseOrValue, - loanType: PromiseOrValue, - isLender: PromiseOrValue, - unsafeOnly: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - getUserLoansCount( - user: PromiseOrValue, - isLender: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - isLoanPool(loanPool: PromiseOrValue, overrides?: CallOverrides): Promise; - - lenderInterest( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - lendingFeePercent(overrides?: CallOverrides): Promise; - - lendingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - lendingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - liquidate( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidateWithGasToken( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - gasTokenUser: PromiseOrValue, - closeAmount: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - liquidationIncentivePercent( - arg0: PromiseOrValue, - arg1: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - loanInterest(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanParams(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loanPoolToUnderlying(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - loans(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - logicTargets(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - maxDisagreement(overrides?: CallOverrides): Promise; - - maxSwapSize(overrides?: CallOverrides): Promise; - - owner(overrides?: CallOverrides): Promise; - - pause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - payFlashBorrowFees( - user: PromiseOrValue, - borrowAmount: PromiseOrValue, - flashBorrowFeePercent: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - priceFeeds(overrides?: CallOverrides): Promise; - - protocolTokenHeld(overrides?: CallOverrides): Promise; - - protocolTokenPaid(overrides?: CallOverrides): Promise; - - queryFees( - tokens: PromiseOrValue[], - feeType: PromiseOrValue, - overrides?: CallOverrides, - ): Promise; - - replaceContract( - target: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - rewardsBalanceOf(user: PromiseOrValue, overrides?: CallOverrides): Promise; - - setAffiliateFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setBorrowingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDelegatedManager( - loanId: PromiseOrValue, - delegated: PromiseOrValue, - toggle: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setDepositAmount( - loanId: PromiseOrValue, - depositValueAsLoanToken: PromiseOrValue, - depositValueAsCollateralToken: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setFeesController( - newController: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLendingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLiquidationIncentivePercent( - loanTokens: PromiseOrValue[], - collateralTokens: PromiseOrValue[], - amounts: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setLoanPool( - pools: PromiseOrValue[], - assets: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxDisagreement( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setMaxSwapSize( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setPriceFeedContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSourceBufferPercent( - newAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSupportedTokens( - addrs: PromiseOrValue[], - toggles: PromiseOrValue[], - withApprovals: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setSwapsImplContract( - newContract: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTWAISettings( - delta: PromiseOrValue, - secondsAgo: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTargets( - sigsArr: PromiseOrValue[], - targetsArr: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setTradingFeePercent( - newValue: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - settleInterest( - loanId: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanParams( - loanParamsList: IBZx.LoanParamsStruct[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - setupLoanPoolTWAI( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - sourceBufferPercent(overrides?: CallOverrides): Promise; - - supportedTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - swapExternal( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapExternalWithGasToken( - sourceToken: PromiseOrValue, - destToken: PromiseOrValue, - receiver: PromiseOrValue, - returnToSender: PromiseOrValue, - gasTokenUser: PromiseOrValue, - sourceTokenAmount: PromiseOrValue, - requiredDestTokenAmount: PromiseOrValue, - swapData: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue }, - ): Promise; - - swapsImpl(overrides?: CallOverrides): Promise; - - toggleFunctionPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - toggleFunctionUnPause( - sig: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - tradingFeePercent(overrides?: CallOverrides): Promise; - - tradingFeeTokensHeld(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - tradingFeeTokensPaid(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - transferLoan( - loanId: PromiseOrValue, - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - transferOwnership( - newOwner: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - underlyingToLoanPool(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - - unpause( - sig: PromiseOrValue[], - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawCollateral( - loanId: PromiseOrValue, - receiver: PromiseOrValue, - withdrawAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - - withdrawFees( - tokens: PromiseOrValue[], - receiver: PromiseOrValue, - feeType: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise; - }; -} diff --git a/src/apps/ooki/contracts/ethers/IToken.ts b/src/apps/ooki/contracts/ethers/OokiIToken.ts similarity index 99% rename from src/apps/ooki/contracts/ethers/IToken.ts rename to src/apps/ooki/contracts/ethers/OokiIToken.ts index 14116c625..3e4e533d7 100644 --- a/src/apps/ooki/contracts/ethers/IToken.ts +++ b/src/apps/ooki/contracts/ethers/OokiIToken.ts @@ -32,7 +32,7 @@ export declare namespace IToken { }; } -export interface ITokenInterface extends utils.Interface { +export interface OokiITokenInterface extends utils.Interface { functions: { '_isPaused(bytes4)': FunctionFragment; 'allowance(address,address)': FunctionFragment; @@ -316,12 +316,12 @@ export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEven export type TransferEventFilter = TypedEventFilter; -export interface IToken extends BaseContract { +export interface OokiIToken extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; - interface: ITokenInterface; + interface: OokiITokenInterface; queryFilter( event: TypedEventFilter, diff --git a/src/apps/ooki/contracts/ethers/TokenRegistry.ts b/src/apps/ooki/contracts/ethers/OokiTokenRegistry.ts similarity index 95% rename from src/apps/ooki/contracts/ethers/TokenRegistry.ts rename to src/apps/ooki/contracts/ethers/OokiTokenRegistry.ts index 0487da4b6..b56428812 100644 --- a/src/apps/ooki/contracts/ethers/TokenRegistry.ts +++ b/src/apps/ooki/contracts/ethers/OokiTokenRegistry.ts @@ -27,7 +27,7 @@ export declare namespace TokenRegistry { }; } -export interface TokenRegistryInterface extends utils.Interface { +export interface OokiTokenRegistryInterface extends utils.Interface { functions: { 'bZxContract()': FunctionFragment; 'getTokens(uint256,uint256)': FunctionFragment; @@ -47,12 +47,12 @@ export interface TokenRegistryInterface extends utils.Interface { events: {}; } -export interface TokenRegistry extends BaseContract { +export interface OokiTokenRegistry extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; - interface: TokenRegistryInterface; + interface: OokiTokenRegistryInterface; queryFilter( event: TypedEventFilter, diff --git a/src/apps/ooki/contracts/ethers/factories/IPriceFeeds__factory.ts b/src/apps/ooki/contracts/ethers/factories/IPriceFeeds__factory.ts deleted file mode 100644 index 95740e799..000000000 --- a/src/apps/ooki/contracts/ethers/factories/IPriceFeeds__factory.ts +++ /dev/null @@ -1,340 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import type { IPriceFeeds, IPriceFeedsInterface } from '../IPriceFeeds'; - -const _abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'Token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'amountInEth', - outputs: [ - { - internalType: 'uint256', - name: 'ethAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'destAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxSlippage', - type: 'uint256', - }, - ], - name: 'checkPriceDisagreement', - outputs: [ - { - internalType: 'uint256', - name: 'sourceToDestSwapRate', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'loanAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralAmount', - type: 'uint256', - }, - ], - name: 'getCurrentMargin', - outputs: [ - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralToLoanRate', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'loanAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralAmount', - type: 'uint256', - }, - ], - name: 'getCurrentMarginAndCollateralSize', - outputs: [ - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralInEthAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'payToken', - type: 'address', - }, - ], - name: 'getFastGasPrice', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'loanAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - ], - name: 'getMaxDrawdown', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - ], - name: 'queryPrecision', - outputs: [ - { - internalType: 'uint256', - name: 'precision', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - ], - name: 'queryRate', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'precision', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256', - }, - ], - name: 'queryReturn', - outputs: [ - { - internalType: 'uint256', - name: 'destAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'loanAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateralAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - ], - name: 'shouldLiquidate', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, -]; - -export class IPriceFeeds__factory { - static readonly abi = _abi; - static createInterface(): IPriceFeedsInterface { - return new utils.Interface(_abi) as IPriceFeedsInterface; - } - static connect(address: string, signerOrProvider: Signer | Provider): IPriceFeeds { - return new Contract(address, _abi, signerOrProvider) as IPriceFeeds; - } -} diff --git a/src/apps/ooki/contracts/ethers/factories/IStakingV2__factory.ts b/src/apps/ooki/contracts/ethers/factories/IStakingV2__factory.ts deleted file mode 100644 index 1d7cafeb3..000000000 --- a/src/apps/ooki/contracts/ethers/factories/IStakingV2__factory.ts +++ /dev/null @@ -1,684 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import type { IStakingV2, IStakingV2Interface } from '../IStakingV2'; - -const _abi = [ - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: '_isPaused', - outputs: [ - { - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'proposalId', - type: 'uint256', - }, - ], - name: '_setProposalVals', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: '_totalSupplyPerToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'addAltRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newOOKI', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'newStableCoin', - type: 'uint256', - }, - ], - name: 'addRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOfByAsset', - outputs: [ - { - internalType: 'uint256', - name: 'balance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOfByAssets', - outputs: [ - { - internalType: 'uint256', - name: 'bzrxBalance', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'iOOKIBalance', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'vBZRXBalance', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'LPTokenBalance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOfStored', - outputs: [ - { - internalType: 'uint256', - name: 'vestedBalance', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'vestingBalance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newGuardian', - type: 'address', - }, - ], - name: 'changeGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'restake', - type: 'bool', - }, - ], - name: 'claim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'claimAltRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'claimSushi', - outputs: [ - { - internalType: 'uint256', - name: 'sushiRewardsEarned', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'earned', - outputs: [ - { - internalType: 'uint256', - name: 'bzrxRewardsEarned', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stableCoinRewardsEarned', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bzrxRewardsVesting', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stableCoinRewardsVesting', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sushiRewardsEarned', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'exit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'exitSushi', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getGuardian', - outputs: [ - { - internalType: 'address', - name: 'guardian', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getVariableWeights', - outputs: [ - { - internalType: 'uint256', - name: 'vBZRXWeight', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'iOOKIWeight', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'LPTokenWeight', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'governor', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'pendingCrvRewards', - outputs: [ - { - internalType: 'uint256', - name: 'bzrxRewardsEarned', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stableCoinRewardsEarned', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bzrxRewardsVesting', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'stableCoinRewardsVesting', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sushiRewardsEarned', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_token', - type: 'address', - }, - { - internalType: 'address', - name: '_spender', - type: 'address', - }, - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - ], - name: 'setApprovals', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_governor', - type: 'address', - }, - ], - name: 'setGovernor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'stakingGovernance', - type: 'address', - }, - ], - name: 'setVoteDelegator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'tokens', - type: 'address[]', - }, - { - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]', - }, - ], - name: 'stake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: 'toggleFunctionPause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: 'toggleFunctionUnPause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'totalSupplyByAsset', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupplyStored', - outputs: [ - { - internalType: 'uint256', - name: 'supply', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'tokens', - type: 'address[]', - }, - { - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]', - }, - ], - name: 'unstake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'settingsTarget', - type: 'address', - }, - { - internalType: 'bytes', - name: 'callData', - type: 'bytes', - }, - ], - name: 'updateSettings', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenBalance', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastUpdate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'vestingEndTime', - type: 'uint256', - }, - ], - name: 'vestedBalanceForAmount', - outputs: [ - { - internalType: 'uint256', - name: 'vested', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - ], - name: 'vestingLastSync', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'proposalId', - type: 'uint256', - }, - ], - name: 'votingBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: 'totalVotes', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'votingBalanceOfNow', - outputs: [ - { - internalType: 'uint256', - name: 'totalVotes', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'votingFromStakedBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: 'totalVotes', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -]; - -export class IStakingV2__factory { - static readonly abi = _abi; - static createInterface(): IStakingV2Interface { - return new utils.Interface(_abi) as IStakingV2Interface; - } - static connect(address: string, signerOrProvider: Signer | Provider): IStakingV2 { - return new Contract(address, _abi, signerOrProvider) as IStakingV2; - } -} diff --git a/src/apps/ooki/contracts/ethers/factories/IbZx__factory.ts b/src/apps/ooki/contracts/ethers/factories/IbZx__factory.ts deleted file mode 100644 index 7ec675666..000000000 --- a/src/apps/ooki/contracts/ethers/factories/IbZx__factory.ts +++ /dev/null @@ -1,2851 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import type { IbZx, IbZxInterface } from '../IbZx'; - -const _abi = [ - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: '_isPaused', - outputs: [ - { - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'affiliateFeePercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanParamsId', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'bool', - name: 'isTorqueLoan', - type: 'bool', - }, - { - internalType: 'uint256', - name: 'initialMargin', - type: 'uint256', - }, - { - internalType: 'address[4]', - name: 'sentAddresses', - type: 'address[4]', - }, - { - internalType: 'uint256[5]', - name: 'sentValues', - type: 'uint256[5]', - }, - { - internalType: 'bytes', - name: 'loanDataBytes', - type: 'bytes', - }, - ], - name: 'borrowOrTradeFromPool', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanOpenData', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'borrowingFeePercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'borrowingFeeTokensHeld', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'borrowingFeeTokensPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newGuardian', - type: 'address', - }, - ], - name: 'changeGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'claimRewards', - outputs: [ - { - internalType: 'uint256', - name: 'claimAmount', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'bytes32[]', - name: 'loanIds', - type: 'bytes32[]', - }, - ], - name: 'cleanupLoans', - outputs: [ - { - internalType: 'uint256', - name: 'totalPrincipalIn', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'uint256', - name: 'depositAmount', - type: 'uint256', - }, - ], - name: 'closeWithDeposit', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'withdrawAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'withdrawToken', - type: 'address', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'gasTokenUser', - type: 'address', - }, - { - internalType: 'uint256', - name: 'depositAmount', - type: 'uint256', - }, - ], - name: 'closeWithDepositWithGasToken', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'withdrawAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'withdrawToken', - type: 'address', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'uint256', - name: 'swapAmount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'returnTokenIsCollateral', - type: 'bool', - }, - { - internalType: 'bytes', - name: 'loanDataBytes', - type: 'bytes', - }, - ], - name: 'closeWithSwap', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'withdrawAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'withdrawToken', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'gasTokenUser', - type: 'address', - }, - { - internalType: 'uint256', - name: 'swapAmount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'returnTokenIsCollateral', - type: 'bool', - }, - { - internalType: 'bytes', - name: 'loanDataBytes', - type: 'bytes', - }, - ], - name: 'closeWithSwapWithGasToken', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'withdrawAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'withdrawToken', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'delegatedManagers', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'depositAmount', - type: 'uint256', - }, - ], - name: 'depositCollateral', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32[]', - name: 'loanParamsIdList', - type: 'bytes32[]', - }, - ], - name: 'disableLoanParams', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'feesController', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'start', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'unsafeOnly', - type: 'bool', - }, - ], - name: 'getActiveLoans', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint96', - name: 'endTimestamp', - type: 'uint96', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestOwedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestDepositRemaining', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidatable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxSeizable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsLoanToken', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsCollateralToken', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanReturnData[]', - name: 'loansData', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'start', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'unsafeOnly', - type: 'bool', - }, - { - internalType: 'bool', - name: 'isLiquidatable', - type: 'bool', - }, - ], - name: 'getActiveLoansAdvanced', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint96', - name: 'endTimestamp', - type: 'uint96', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestOwedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestDepositRemaining', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidatable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxSeizable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsLoanToken', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsCollateralToken', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanReturnData[]', - name: 'loansData', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getActiveLoansCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'collateralTokenAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marginAmount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isTorqueLoan', - type: 'bool', - }, - ], - name: 'getBorrowAmount', - outputs: [ - { - internalType: 'uint256', - name: 'borrowAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanParamsId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'collateralTokenAmount', - type: 'uint256', - }, - ], - name: 'getBorrowAmountByParams', - outputs: [ - { - internalType: 'uint256', - name: 'borrowAmount', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGuardian', - outputs: [ - { - internalType: 'address', - name: 'guardian', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - ], - name: 'getInterestModelValues', - outputs: [ - { - internalType: 'uint256', - name: '_poolLastUpdateTime', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_poolPrincipalTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_poolInterestTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_poolRatePerTokenStored', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_poolLastInterestRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_loanPrincipalTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_loanInterestTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_loanRatePerTokenPaid', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - ], - name: 'getLoan', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint96', - name: 'endTimestamp', - type: 'uint96', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestOwedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestDepositRemaining', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidatable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxSeizable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsLoanToken', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsCollateralToken', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanReturnData', - name: 'loanData', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - ], - name: 'getLoanInterestOutstanding', - outputs: [ - { - internalType: 'uint256', - name: 'interest', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32[]', - name: 'loanParamsIdList', - type: 'bytes32[]', - }, - ], - name: 'getLoanParams', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'bool', - name: 'active', - type: 'bool', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'minInitialMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanParams[]', - name: 'loanParamsList', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'uint256', - name: 'start', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - ], - name: 'getLoanParamsList', - outputs: [ - { - internalType: 'bytes32[]', - name: 'loanParamsList', - type: 'bytes32[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'start', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - ], - name: 'getLoanPoolsList', - outputs: [ - { - internalType: 'address[]', - name: 'loanPoolsList', - type: 'address[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - ], - name: 'getLoanPrincipal', - outputs: [ - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolLastInterestRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolPrincipalStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'newPrincipal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'marginAmount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isTorqueLoan', - type: 'bool', - }, - ], - name: 'getRequiredCollateral', - outputs: [ - { - internalType: 'uint256', - name: 'collateralAmountRequired', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanParamsId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'newPrincipal', - type: 'uint256', - }, - ], - name: 'getRequiredCollateralByParams', - outputs: [ - { - internalType: 'uint256', - name: 'collateralAmountRequired', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'swapData', - type: 'bytes', - }, - ], - name: 'getSwapExpectedReturn', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'trader', - type: 'address', - }, - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'payload', - type: 'bytes', - }, - ], - name: 'getSwapExpectedReturn', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getTWAI', - outputs: [ - { - internalType: 'uint256', - name: 'benchmarkRate', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: 'sig', - type: 'string', - }, - ], - name: 'getTarget', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'lender', - type: 'address', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - ], - name: 'getTotalPrincipal', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - { - internalType: 'uint256', - name: 'start', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'count', - type: 'uint256', - }, - { - internalType: 'enum IBZx.LoanType', - name: 'loanType', - type: 'uint8', - }, - { - internalType: 'bool', - name: 'isLender', - type: 'bool', - }, - { - internalType: 'bool', - name: 'unsafeOnly', - type: 'bool', - }, - ], - name: 'getUserLoans', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint96', - name: 'endTimestamp', - type: 'uint96', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestOwedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'interestDepositRemaining', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startRate', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'currentMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLiquidatable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxSeizable', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsLoanToken', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsCollateralToken', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanReturnData[]', - name: 'loansData', - type: 'tuple[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - { - internalType: 'bool', - name: 'isLender', - type: 'bool', - }, - ], - name: 'getUserLoansCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'loanPool', - type: 'address', - }, - ], - name: 'isLoanPool', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'lenderInterest', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'principalTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'owedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'owedTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'paidTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'updatedTimestamp', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LenderInterest', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lendingFeePercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'lendingFeeTokensHeld', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'lendingFeeTokensPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'uint256', - name: 'closeAmount', - type: 'uint256', - }, - ], - name: 'liquidate', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'seizedAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'seizedToken', - type: 'address', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'gasTokenUser', - type: 'address', - }, - { - internalType: 'uint256', - name: 'closeAmount', - type: 'uint256', - }, - ], - name: 'liquidateWithGasToken', - outputs: [ - { - internalType: 'uint256', - name: 'loanCloseAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'seizedAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'seizedToken', - type: 'address', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'liquidationIncentivePercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'loanInterest', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'owedPerDay', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositTotal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'updatedTimestamp', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanInterest', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'loanParams', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'bool', - name: 'active', - type: 'bool', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'minInitialMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanParams', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'loanPoolToUnderlying', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - name: 'loans', - outputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'loanParamsId', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'pendingTradesId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'principal', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'collateral', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startTimestamp', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTimestamp', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'startRate', - type: 'uint256', - }, - { - internalType: 'address', - name: 'borrower', - type: 'address', - }, - { - internalType: 'address', - name: 'lender', - type: 'address', - }, - { - internalType: 'bool', - name: 'active', - type: 'bool', - }, - ], - internalType: 'struct IBZx.Loan', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: '', - type: 'bytes4', - }, - ], - name: 'logicTargets', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxDisagreement', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxSwapSize', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4[]', - name: 'sig', - type: 'bytes4[]', - }, - ], - name: 'pause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - { - internalType: 'uint256', - name: 'borrowAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'flashBorrowFeePercent', - type: 'uint256', - }, - ], - name: 'payFlashBorrowFees', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'priceFeeds', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'protocolTokenHeld', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'protocolTokenPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'tokens', - type: 'address[]', - }, - { - internalType: 'enum IBZx.FeeClaimType', - name: 'feeType', - type: 'uint8', - }, - ], - name: 'queryFees', - outputs: [ - { - internalType: 'uint256[]', - name: 'amountsHeld', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: 'amountsPaid', - type: 'uint256[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'target', - type: 'address', - }, - ], - name: 'replaceContract', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - ], - name: 'rewardsBalanceOf', - outputs: [ - { - internalType: 'uint256', - name: 'rewardsBalance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newValue', - type: 'uint256', - }, - ], - name: 'setAffiliateFeePercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newValue', - type: 'uint256', - }, - ], - name: 'setBorrowingFeePercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'delegated', - type: 'address', - }, - { - internalType: 'bool', - name: 'toggle', - type: 'bool', - }, - ], - name: 'setDelegatedManager', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'depositValueAsLoanToken', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositValueAsCollateralToken', - type: 'uint256', - }, - ], - name: 'setDepositAmount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newController', - type: 'address', - }, - ], - name: 'setFeesController', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newValue', - type: 'uint256', - }, - ], - name: 'setLendingFeePercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'loanTokens', - type: 'address[]', - }, - { - internalType: 'address[]', - name: 'collateralTokens', - type: 'address[]', - }, - { - internalType: 'uint256[]', - name: 'amounts', - type: 'uint256[]', - }, - ], - name: 'setLiquidationIncentivePercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'pools', - type: 'address[]', - }, - { - internalType: 'address[]', - name: 'assets', - type: 'address[]', - }, - ], - name: 'setLoanPool', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newAmount', - type: 'uint256', - }, - ], - name: 'setMaxDisagreement', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newAmount', - type: 'uint256', - }, - ], - name: 'setMaxSwapSize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newContract', - type: 'address', - }, - ], - name: 'setPriceFeedContract', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newAmount', - type: 'uint256', - }, - ], - name: 'setSourceBufferPercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'addrs', - type: 'address[]', - }, - { - internalType: 'bool[]', - name: 'toggles', - type: 'bool[]', - }, - { - internalType: 'bool', - name: 'withApprovals', - type: 'bool', - }, - ], - name: 'setSupportedTokens', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newContract', - type: 'address', - }, - ], - name: 'setSwapsImplContract', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint32', - name: 'delta', - type: 'uint32', - }, - { - internalType: 'uint32', - name: 'secondsAgo', - type: 'uint32', - }, - ], - name: 'setTWAISettings', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string[]', - name: 'sigsArr', - type: 'string[]', - }, - { - internalType: 'address[]', - name: 'targetsArr', - type: 'address[]', - }, - ], - name: 'setTargets', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newValue', - type: 'uint256', - }, - ], - name: 'setTradingFeePercent', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - ], - name: 'settleInterest', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - internalType: 'bool', - name: 'active', - type: 'bool', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'loanToken', - type: 'address', - }, - { - internalType: 'address', - name: 'collateralToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'minInitialMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maintenanceMargin', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'maxLoanTerm', - type: 'uint256', - }, - ], - internalType: 'struct IBZx.LoanParams[]', - name: 'loanParamsList', - type: 'tuple[]', - }, - ], - name: 'setupLoanParams', - outputs: [ - { - internalType: 'bytes32[]', - name: 'loanParamsIdList', - type: 'bytes32[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'setupLoanPoolTWAI', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'sourceBufferPercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'supportedTokens', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'returnToSender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'requiredDestTokenAmount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'swapData', - type: 'bytes', - }, - ], - name: 'swapExternal', - outputs: [ - { - internalType: 'uint256', - name: 'destTokenAmountReceived', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmountUsed', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sourceToken', - type: 'address', - }, - { - internalType: 'address', - name: 'destToken', - type: 'address', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'returnToSender', - type: 'address', - }, - { - internalType: 'address', - name: 'gasTokenUser', - type: 'address', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'requiredDestTokenAmount', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'swapData', - type: 'bytes', - }, - ], - name: 'swapExternalWithGasToken', - outputs: [ - { - internalType: 'uint256', - name: 'destTokenAmountReceived', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'sourceTokenAmountUsed', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'swapsImpl', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: 'toggleFunctionPause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'sig', - type: 'bytes4', - }, - ], - name: 'toggleFunctionUnPause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'tradingFeePercent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'tradingFeeTokensHeld', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'tradingFeeTokensPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferLoan', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'underlyingToLoanPool', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4[]', - name: 'sig', - type: 'bytes4[]', - }, - ], - name: 'unpause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'loanId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'uint256', - name: 'withdrawAmount', - type: 'uint256', - }, - ], - name: 'withdrawCollateral', - outputs: [ - { - internalType: 'uint256', - name: 'actualWithdrawAmount', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'tokens', - type: 'address[]', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'enum IBZx.FeeClaimType', - name: 'feeType', - type: 'uint8', - }, - ], - name: 'withdrawFees', - outputs: [ - { - internalType: 'uint256[]', - name: 'amounts', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -]; - -export class IbZx__factory { - static readonly abi = _abi; - static createInterface(): IbZxInterface { - return new utils.Interface(_abi) as IbZxInterface; - } - static connect(address: string, signerOrProvider: Signer | Provider): IbZx { - return new Contract(address, _abi, signerOrProvider) as IbZx; - } -} diff --git a/src/apps/ooki/contracts/ethers/factories/IToken__factory.ts b/src/apps/ooki/contracts/ethers/factories/OokiIToken__factory.ts similarity index 98% rename from src/apps/ooki/contracts/ethers/factories/IToken__factory.ts rename to src/apps/ooki/contracts/ethers/factories/OokiIToken__factory.ts index 830adfd12..82083c3f6 100644 --- a/src/apps/ooki/contracts/ethers/factories/IToken__factory.ts +++ b/src/apps/ooki/contracts/ethers/factories/OokiIToken__factory.ts @@ -4,7 +4,7 @@ import { Contract, Signer, utils } from 'ethers'; import type { Provider } from '@ethersproject/providers'; -import type { IToken, ITokenInterface } from '../IToken'; +import type { OokiIToken, OokiITokenInterface } from '../OokiIToken'; const _abi = [ { @@ -963,12 +963,12 @@ const _abi = [ }, ]; -export class IToken__factory { +export class OokiIToken__factory { static readonly abi = _abi; - static createInterface(): ITokenInterface { - return new utils.Interface(_abi) as ITokenInterface; + static createInterface(): OokiITokenInterface { + return new utils.Interface(_abi) as OokiITokenInterface; } - static connect(address: string, signerOrProvider: Signer | Provider): IToken { - return new Contract(address, _abi, signerOrProvider) as IToken; + static connect(address: string, signerOrProvider: Signer | Provider): OokiIToken { + return new Contract(address, _abi, signerOrProvider) as OokiIToken; } } diff --git a/src/apps/ooki/contracts/ethers/factories/TokenRegistry__factory.ts b/src/apps/ooki/contracts/ethers/factories/OokiTokenRegistry__factory.ts similarity index 82% rename from src/apps/ooki/contracts/ethers/factories/TokenRegistry__factory.ts rename to src/apps/ooki/contracts/ethers/factories/OokiTokenRegistry__factory.ts index 2be4863e8..c73cc6d55 100644 --- a/src/apps/ooki/contracts/ethers/factories/TokenRegistry__factory.ts +++ b/src/apps/ooki/contracts/ethers/factories/OokiTokenRegistry__factory.ts @@ -4,7 +4,7 @@ import { Signer, utils, Contract, ContractFactory, Overrides } from 'ethers'; import type { Provider, TransactionRequest } from '@ethersproject/providers'; import type { PromiseOrValue } from '../common'; -import type { TokenRegistry, TokenRegistryInterface } from '../TokenRegistry'; +import type { OokiTokenRegistry, OokiTokenRegistryInterface } from '../OokiTokenRegistry'; const _abi = [ { @@ -65,13 +65,13 @@ const _abi = [ const _bytecode = '0x608060405234801561001057600080fd5b50610584806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063494cfc6c1461003b578063995363d314610064575b600080fd5b61004e610049366004610388565b610079565b60405161005b919061047f565b60405180910390f35b61006c610263565b60405161005b9190610471565b60405163402946b960e01b8152606090819073d8ee69652e4e4838f2531732a46d1f7f584f0b7f90819063402946b9906100b99088908890600401610497565b60006040518083038186803b1580156100d157600080fd5b505afa1580156100e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261010d9190810190610353565b9150815160405190808252806020026020018201604052801561014a57816020015b61013761027b565b81526020019060019003908161012f5790505b50925060005b825181101561025a5782818151811061016557fe5b602002602001015184828151811061017957fe5b6020026020010151600001906001600160a01b031690816001600160a01b031681525050816001600160a01b0316638dc48ba58483815181106101b857fe5b60200260200101516040518263ffffffff1660e01b81526004016101dc9190610471565b60206040518083038186803b1580156101f457600080fd5b505afa158015610208573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061022c919081019061032d565b84828151811061023857fe5b6020908102919091018101516001600160a01b03909216910152600101610150565b50505092915050565b73d8ee69652e4e4838f2531732a46d1f7f584f0b7f81565b604080518082019091526000808252602082015290565b805161029d81610521565b92915050565b600082601f8301126102b457600080fd5b81516102c76102c2826104d9565b6104b2565b915081818352602084019350602081019050838560208402820111156102ec57600080fd5b60005b8381101561031857816103028882610292565b84525060209283019291909101906001016102ef565b5050505092915050565b803561029d81610538565b60006020828403121561033f57600080fd5b600061034b8484610292565b949350505050565b60006020828403121561036557600080fd5b815167ffffffffffffffff81111561037c57600080fd5b61034b848285016102a3565b6000806040838503121561039b57600080fd5b60006103a78585610322565b92505060206103b885828601610322565b9150509250929050565b60006103ce838361043e565b505060400190565b6103df8161050d565b82525050565b60006103f082610500565b6103fa8185610504565b9350610405836104fa565b8060005b8381101561043357815161041d88826103c2565b9750610428836104fa565b925050600101610409565b509495945050505050565b8051604083019061044f84826103d6565b50602082015161046260208501826103d6565b50505050565b6103df8161051e565b6020810161029d82846103d6565b6020808252810161049081846103e5565b9392505050565b604081016104a58285610468565b6104906020830184610468565b60405181810167ffffffffffffffff811182821017156104d157600080fd5b604052919050565b600067ffffffffffffffff8211156104f057600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b60006001600160a01b03821661029d565b90565b61052a8161050d565b811461053557600080fd5b50565b61052a8161051e56fea365627a7a723158203260bcfc77e5180e08a775831e585a36b277ffe8841390ee264eb73756e59bfb6c6578706572696d656e74616cf564736f6c63430005110040'; -type TokenRegistryConstructorParams = [signer?: Signer] | ConstructorParameters; +type OokiTokenRegistryConstructorParams = [signer?: Signer] | ConstructorParameters; -const isSuperArgs = (xs: TokenRegistryConstructorParams): xs is ConstructorParameters => +const isSuperArgs = (xs: OokiTokenRegistryConstructorParams): xs is ConstructorParameters => xs.length > 1; -export class TokenRegistry__factory extends ContractFactory { - constructor(...args: TokenRegistryConstructorParams) { +export class OokiTokenRegistry__factory extends ContractFactory { + constructor(...args: OokiTokenRegistryConstructorParams) { if (isSuperArgs(args)) { super(...args); } else { @@ -79,25 +79,25 @@ export class TokenRegistry__factory extends ContractFactory { } } - override deploy(overrides?: Overrides & { from?: PromiseOrValue }): Promise { - return super.deploy(overrides || {}) as Promise; + override deploy(overrides?: Overrides & { from?: PromiseOrValue }): Promise { + return super.deploy(overrides || {}) as Promise; } override getDeployTransaction(overrides?: Overrides & { from?: PromiseOrValue }): TransactionRequest { return super.getDeployTransaction(overrides || {}); } - override attach(address: string): TokenRegistry { - return super.attach(address) as TokenRegistry; + override attach(address: string): OokiTokenRegistry { + return super.attach(address) as OokiTokenRegistry; } - override connect(signer: Signer): TokenRegistry__factory { - return super.connect(signer) as TokenRegistry__factory; + override connect(signer: Signer): OokiTokenRegistry__factory { + return super.connect(signer) as OokiTokenRegistry__factory; } static readonly bytecode = _bytecode; static readonly abi = _abi; - static createInterface(): TokenRegistryInterface { - return new utils.Interface(_abi) as TokenRegistryInterface; + static createInterface(): OokiTokenRegistryInterface { + return new utils.Interface(_abi) as OokiTokenRegistryInterface; } - static connect(address: string, signerOrProvider: Signer | Provider): TokenRegistry { - return new Contract(address, _abi, signerOrProvider) as TokenRegistry; + static connect(address: string, signerOrProvider: Signer | Provider): OokiTokenRegistry { + return new Contract(address, _abi, signerOrProvider) as OokiTokenRegistry; } } diff --git a/src/apps/ooki/contracts/ethers/factories/index.ts b/src/apps/ooki/contracts/ethers/factories/index.ts index 2675c0e29..aea9a7d48 100644 --- a/src/apps/ooki/contracts/ethers/factories/index.ts +++ b/src/apps/ooki/contracts/ethers/factories/index.ts @@ -1,8 +1,5 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export { IPriceFeeds__factory } from './IPriceFeeds__factory'; -export { IStakingV2__factory } from './IStakingV2__factory'; -export { IToken__factory } from './IToken__factory'; -export { IbZx__factory } from './IbZx__factory'; -export { TokenRegistry__factory } from './TokenRegistry__factory'; +export { OokiIToken__factory } from './OokiIToken__factory'; +export { OokiTokenRegistry__factory } from './OokiTokenRegistry__factory'; diff --git a/src/apps/ooki/contracts/ethers/index.ts b/src/apps/ooki/contracts/ethers/index.ts index bda7cf947..dea80c465 100644 --- a/src/apps/ooki/contracts/ethers/index.ts +++ b/src/apps/ooki/contracts/ethers/index.ts @@ -1,14 +1,8 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -export type { IPriceFeeds } from './IPriceFeeds'; -export type { IStakingV2 } from './IStakingV2'; -export type { IToken } from './IToken'; -export type { IbZx } from './IbZx'; -export type { TokenRegistry } from './TokenRegistry'; +export type { OokiIToken } from './OokiIToken'; +export type { OokiTokenRegistry } from './OokiTokenRegistry'; export * as factories from './factories'; -export { IPriceFeeds__factory } from './factories/IPriceFeeds__factory'; -export { IStakingV2__factory } from './factories/IStakingV2__factory'; -export { IToken__factory } from './factories/IToken__factory'; -export { IbZx__factory } from './factories/IbZx__factory'; -export { TokenRegistry__factory } from './factories/TokenRegistry__factory'; +export { OokiIToken__factory } from './factories/OokiIToken__factory'; +export { OokiTokenRegistry__factory } from './factories/OokiTokenRegistry__factory'; diff --git a/src/apps/ooki/contracts/index.ts b/src/apps/ooki/contracts/index.ts index 660b10aca..407480d8a 100644 --- a/src/apps/ooki/contracts/index.ts +++ b/src/apps/ooki/contracts/index.ts @@ -4,11 +4,8 @@ import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { ContractFactory } from '~contract/contracts'; import { Network } from '~types/network.interface'; -import { IPriceFeeds__factory } from './ethers'; -import { IStakingV2__factory } from './ethers'; -import { IToken__factory } from './ethers'; -import { IbZx__factory } from './ethers'; -import { TokenRegistry__factory } from './ethers'; +import { OokiIToken__factory } from './ethers'; +import { OokiTokenRegistry__factory } from './ethers'; // eslint-disable-next-line type ContractOpts = { address: string; network: Network }; @@ -19,25 +16,13 @@ export class OokiContractFactory extends ContractFactory { super((network: Network) => appToolkit.getNetworkProvider(network)); } - iPriceFeeds({ address, network }: ContractOpts) { - return IPriceFeeds__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + ookiIToken({ address, network }: ContractOpts) { + return OokiIToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } - iStakingV2({ address, network }: ContractOpts) { - return IStakingV2__factory.connect(address, this.appToolkit.getNetworkProvider(network)); - } - iToken({ address, network }: ContractOpts) { - return IToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); - } - ibZx({ address, network }: ContractOpts) { - return IbZx__factory.connect(address, this.appToolkit.getNetworkProvider(network)); - } - tokenRegistry({ address, network }: ContractOpts) { - return TokenRegistry__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + ookiTokenRegistry({ address, network }: ContractOpts) { + return OokiTokenRegistry__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } } -export type { IPriceFeeds } from './ethers'; -export type { IStakingV2 } from './ethers'; -export type { IToken } from './ethers'; -export type { IbZx } from './ethers'; -export type { TokenRegistry } from './ethers'; +export type { OokiIToken } from './ethers'; +export type { OokiTokenRegistry } from './ethers'; diff --git a/src/apps/ooki/ethereum/ooki.lend.token-fetcher.ts b/src/apps/ooki/ethereum/ooki.lend.token-fetcher.ts index ee2febf5d..017e6598f 100644 --- a/src/apps/ooki/ethereum/ooki.lend.token-fetcher.ts +++ b/src/apps/ooki/ethereum/ooki.lend.token-fetcher.ts @@ -1,90 +1,61 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { AppTokenPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; -import { compact } from 'lodash'; -import { OokiContractFactory, TokenRegistry, IbZx, IToken } from '../contracts'; -import { OOKI_DEFINITION } from '../ooki.definition'; -import { ContractType } from '~position/contract.interface'; -import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; -import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; -import type { - BigNumber -} from 'ethers' +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; +import { + GetDataPropsParams, + GetPricePerShareParams, + GetUnderlyingTokensParams, +} from '~position/template/app-token.template.types'; +import { OokiContractFactory, OokiIToken } from '../contracts'; -const appId = OOKI_DEFINITION.id; -const groupId = OOKI_DEFINITION.groups.lend.id; -const network = Network.ETHEREUM_MAINNET; +@PositionTemplate() +export class EthereumOokiLendTokenFetcher extends AppTokenTemplatePositionFetcher { + groupLabel = 'Lending'; -@Register.TokenPositionFetcher({ appId, groupId, network }) -export class EthereumOokiOokiTokenFetcher implements PositionFetcher { - constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(OokiContractFactory) private readonly contractFactory: OokiContractFactory, - ) {} - - async getPositions() { - const multicall = this.appToolkit.getMulticall(network); - const baseTokens = await this.appToolkit.getBaseTokenPrices(network); - const registryContract = this.contractFactory.tokenRegistry({ - network, - address: '0xf0E474592B455579Fe580D610b846BdBb529C6F7', - }); - - const tokenAddresses = await registryContract.getTokens(0, 100); + tokenRegistryAddress = '0xf0e474592b455579fe580d610b846bdbb529c6f7'; - const tokens = await Promise.all( - tokenAddresses.map(async v => { - const tokenAddress = v.asset - const itokenAddress = v.token - const iTokenContract = this.contractFactory.iToken({ network, address: itokenAddress }) - const tokenContract = this.appToolkit.globalContracts.erc20({ network, address: tokenAddress }) - - const underlyingToken = baseTokens.find(v => v.address.toLowerCase() === tokenAddress.toLowerCase()) - if(!underlyingToken) - return null - const [symbol, decimals, supplyRaw, tokenPrice] = await Promise.all([ - multicall.wrap(iTokenContract).symbol(), - multicall.wrap(tokenContract).decimals(), - multicall.wrap(iTokenContract).totalSupply(), - multicall.wrap(iTokenContract).tokenPrice(), - ]); - const supply = Number(supplyRaw) / 10 ** decimals; - const liquidity = underlyingToken.price * supply; - const token: AppTokenPosition = { - type: ContractType.APP_TOKEN, - appId, - groupId, - address: itokenAddress, - tokens: [underlyingToken], - price: underlyingToken.price, - pricePerShare: Number(tokenPrice) / 10 ** 18, - symbol, - decimals, - supply, - network, - dataProps: { - supply - }, - displayProps: { - label: symbol, - images: [getTokenImg(itokenAddress)], - statsItems: [ - { - label: 'Liquidity', - value: buildDollarDisplayItem(liquidity), - }, - ], - }, - }; - - return token; - }), - ); - return compact(tokens); - } -} \ No newline at end of file + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(OokiContractFactory) protected readonly contractFactory: OokiContractFactory, + ) { + super(appToolkit); + } + + getContract(address: string): OokiIToken { + return this.contractFactory.ookiIToken({ address, network: this.network }); + } + + async getAddresses(): Promise { + const registryContract = this.contractFactory.ookiTokenRegistry({ + network: this.network, + address: this.tokenRegistryAddress, + }); + + const tokenAddresses = await registryContract.getTokens(0, 100); + return tokenAddresses.map(v => v.token); + } + + getUnderlyingTokenAddresses({ contract }: GetUnderlyingTokensParams) { + return contract.loanTokenAddress(); + } + + async getPricePerShare({ contract }: GetPricePerShareParams) { + const exchangeRateRaw = await contract.tokenPrice(); + return Number(exchangeRateRaw) / 10 ** 18; + } + + getLiquidity({ appToken }: GetDataPropsParams) { + return appToken.supply * appToken.price; + } + + getReserves({ appToken }: GetDataPropsParams) { + return [appToken.pricePerShare[0] * appToken.supply]; + } + + getApy(_params: GetDataPropsParams) { + return 0; + } +} diff --git a/src/apps/ooki/ooki.definition.ts b/src/apps/ooki/ooki.definition.ts index a0af8871d..bcfff7da9 100644 --- a/src/apps/ooki/ooki.definition.ts +++ b/src/apps/ooki/ooki.definition.ts @@ -10,7 +10,11 @@ export const OOKI_DEFINITION = appDefinition({ url: 'https://ooki.com/', groups: { - lend: { id: 'lend', type: GroupType.TOKEN, label: 'Lend' }, + lend: { + id: 'lend', + type: GroupType.TOKEN, + label: 'Lending', + }, }, tags: [ @@ -26,10 +30,6 @@ export const OOKI_DEFINITION = appDefinition({ supportedNetworks: { [Network.ETHEREUM_MAINNET]: [AppAction.VIEW], -// [Network.POLYGON_MAINNET]: [AppAction.VIEW], -// [Network.OPTIMISM_MAINNET]: [AppAction.VIEW], -// [Network.BINANCE_SMART_CHAIN_MAINNET]: [AppAction.VIEW], -// [Network.ARBITRUM_MAINNET]: [AppAction.VIEW], }, primaryColor: '#fff', diff --git a/src/apps/ooki/ooki.module.ts b/src/apps/ooki/ooki.module.ts index d845ec660..6794f64ad 100644 --- a/src/apps/ooki/ooki.module.ts +++ b/src/apps/ooki/ooki.module.ts @@ -2,11 +2,11 @@ import { Register } from '~app-toolkit/decorators'; import { AbstractApp } from '~app/app.dynamic-module'; import { OokiContractFactory } from './contracts'; -import { EthereumOokiOokiTokenFetcher } from './ethereum/ooki.lend.token-fetcher'; +import { EthereumOokiLendTokenFetcher } from './ethereum/ooki.lend.token-fetcher'; import { OokiAppDefinition, OOKI_DEFINITION } from './ooki.definition'; @Register.AppModule({ appId: OOKI_DEFINITION.id, - providers: [EthereumOokiOokiTokenFetcher, OokiAppDefinition, OokiContractFactory], + providers: [EthereumOokiLendTokenFetcher, OokiAppDefinition, OokiContractFactory], }) export class OokiAppModule extends AbstractApp() {}