impermax-sdk 1.1.49 → 1.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/abis/contracts/LendingVaultWatcher01.json +4076 -0
  2. package/lib/config/contracts/lending-vault-watcher.d.ts +2 -0
  3. package/lib/config/contracts/lending-vault-watcher.js +20 -0
  4. package/lib/config/subgraphs.d.ts +1 -0
  5. package/lib/config/subgraphs.js +17 -1
  6. package/lib/index.d.ts +2 -1
  7. package/lib/index.js +4 -2
  8. package/lib/offchain/account/lendingPool/offchainAccountBorrowable.js +1 -0
  9. package/lib/offchain/account/offchainAccount.d.ts +3 -2
  10. package/lib/offchain/account/offchainAccount.js +5 -0
  11. package/lib/offchain/account/offchainAccountLendingVault.d.ts +3 -0
  12. package/lib/offchain/account/offchainAccountLendingVault.js +27 -3
  13. package/lib/offchain/offchain.d.ts +13 -1
  14. package/lib/offchain/offchain.js +11 -1
  15. package/lib/offchain/offchainInitializer.d.ts +11 -1
  16. package/lib/offchain/offchainInitializer.js +79 -1
  17. package/lib/offchain/offchainLendingVault.d.ts +6 -5
  18. package/lib/offchain/offchainLendingVault.js +38 -51
  19. package/lib/offchain/offchainPoolToken.d.ts +1 -0
  20. package/lib/offchain/offchainPoolToken.js +6 -0
  21. package/lib/offchain/offchainTypes.d.ts +26 -14
  22. package/lib/offchain/query.d.ts +2 -0
  23. package/lib/offchain/query.js +43 -1
  24. package/lib/onchain/account/lendingPool/onchainAccountCollateral.js +3 -3
  25. package/lib/onchain/account/onchainAccountLendingVault.js +1 -2
  26. package/lib/onchain/account/onchainAccountPoolToken.js +2 -2
  27. package/lib/onchain/onchainContractsHelper.d.ts +1 -0
  28. package/lib/onchain/onchainContractsHelper.js +2 -0
  29. package/lib/onchain/onchainLendingVault.d.ts +1 -0
  30. package/lib/onchain/onchainLendingVault.js +11 -1
  31. package/package.json +1 -1
@@ -0,0 +1,4076 @@
1
+ {
2
+ "contractName": "LendingVaultWatcher01",
3
+ "abi": [
4
+ {
5
+ "constant": true,
6
+ "inputs": [
7
+ {
8
+ "internalType": "address",
9
+ "name": "vault",
10
+ "type": "address"
11
+ }
12
+ ],
13
+ "name": "getAvailableLiquidity",
14
+ "outputs": [
15
+ {
16
+ "internalType": "uint256",
17
+ "name": "availableLiquidity",
18
+ "type": "uint256"
19
+ }
20
+ ],
21
+ "payable": false,
22
+ "stateMutability": "view",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "constant": false,
27
+ "inputs": [
28
+ {
29
+ "internalType": "address",
30
+ "name": "vault",
31
+ "type": "address"
32
+ }
33
+ ],
34
+ "name": "getSupplyRate",
35
+ "outputs": [
36
+ {
37
+ "internalType": "uint256",
38
+ "name": "supplyRate",
39
+ "type": "uint256"
40
+ }
41
+ ],
42
+ "payable": false,
43
+ "stateMutability": "nonpayable",
44
+ "type": "function"
45
+ },
46
+ {
47
+ "constant": false,
48
+ "inputs": [
49
+ {
50
+ "internalType": "address",
51
+ "name": "vault",
52
+ "type": "address"
53
+ }
54
+ ],
55
+ "name": "getOptimizedSupplyRate",
56
+ "outputs": [
57
+ {
58
+ "internalType": "uint256",
59
+ "name": "supplyRate",
60
+ "type": "uint256"
61
+ }
62
+ ],
63
+ "payable": false,
64
+ "stateMutability": "nonpayable",
65
+ "type": "function"
66
+ }
67
+ ],
68
+ "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"getAvailableLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"availableLiquidity\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"getOptimizedSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"supplyRate\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"getSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"supplyRate\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/lending-vault/contracts/LendingVaultWatcher01.sol\":\"LendingVaultWatcher01\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/lending-vault/contracts/LendingVaultWatcher01.sol\":{\"keccak256\":\"0x47b8290c4a6f8e4a19ea135af8e7b7efe6441bc65f6e0564d4aabc4398e0490b\",\"urls\":[\"bzz-raw://6f42da5483824f48232cbccb1763b646747842b4247558d4507f2e53de66dd9d\",\"dweb:/ipfs/QmRXfErPcUkWpAb5JGWx9fZd14R1B6gwPuqHiwRtqSKCZS\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/interfaces/IBorrowable.sol\":{\"keccak256\":\"0x16a157ab22e3d76a6cf0dd89f55d6426abd8b15ac641ce318e3fa22e7dd1284b\",\"urls\":[\"bzz-raw://368476ee8b1e9d5287cbac49ceaae1e230e4ab95426a00141fbd43b6477d2928\",\"dweb:/ipfs/QmPN3cm2TJUJG3tXa6zCeCWrcitjPP6SofwHpygaiQJ9CV\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0xa791b279660ee5eb66ebd4f23b539055d178ae24677f3a164567441ecfdcf73a\",\"urls\":[\"bzz-raw://06f36f585a8b82eb388ccccc4e8c483718a99a07f5f12d3217afc254ab139a68\",\"dweb:/ipfs/Qmedr3aAH6F3ZTgZJ3enoP92ZD8yNwiCStwtGknNXhiK8v\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/interfaces/ILendingVaultV1.sol\":{\"keccak256\":\"0x4d503639d3bcba12b26b242fd7c52f5d42aba27198e11b1fdb8fcf7a493bd73e\",\"urls\":[\"bzz-raw://92ac6bf03b4fae2bab6c7bf3dfe531ba316949f9ac8627803156a13e3e1c6193\",\"dweb:/ipfs/QmWVGJ7s5nFisbu2U6r8HFKz9SbBYt57Fo2vSGpVXT1t9h\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/libraries/BorrowableObject.sol\":{\"keccak256\":\"0x790eeb8085672f212955931e2284400aa2ba17ddb7252f9133e223408b78e52b\",\"urls\":[\"bzz-raw://c5bd67e39acb35a55386bff4cfcee38ba93665ac0d27e120fb2eb2100827e4a0\",\"dweb:/ipfs/QmeEfXmQNzQsU5Aa1MsEa764g6fr6ETfU2QTCGwzsiguzA\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/libraries/Math.sol\":{\"keccak256\":\"0x5297e26a19ef161089a31dc07d25278a9e01079b01b6ec21f5c67314f5382311\",\"urls\":[\"bzz-raw://04ee152f6769d58d8356b54dde3d581e6f66b723c441566b83c5634e44b995c9\",\"dweb:/ipfs/QmaMPQGgMvPLG6yP6wyN1BUCbhXTdd8XgRynjcEs1bxWA8\"]},\"/C/Users/simor/Desktop/lending-vault/contracts/libraries/SafeMath.sol\":{\"keccak256\":\"0x4157aad389a53736773565deb44bc988da84652d5be28c8395594eb4d0ede443\",\"urls\":[\"bzz-raw://5c050de3edf14e6fdba42928dfe64956ca27f994207b1c3b1bb7a5908bef670c\",\"dweb:/ipfs/QmQja5y84B7oDGnVPpBesWUQQJbaW26VhTtAhBRqaZ8XCa\"]}},\"version\":1}",
69
+ "bytecode": "0x608060405234801561001057600080fd5b50610f6d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063266e2bd8146100465780633d1cdd851461008b5780636b5441a9146100be575b600080fd5b6100796004803603602081101561005c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100f1565b60408051918252519081900360200190f35b610079600480360360208110156100a157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661033f565b610079600480360360208110156100d457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610345565b6000808273ffffffffffffffffffffffffffffffffffffffff1663821beaf56040518163ffffffff1660e01b815260040160206040518083038186803b15801561013a57600080fd5b505afa15801561014e573d6000803e3d6000fd5b505050506040513d602081101561016457600080fd5b5051604080517f6f307dc3000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff861691636f307dc3916004808301926020929190829003018186803b1580156101d257600080fd5b505afa1580156101e6573d6000803e3d6000fd5b505050506040513d60208110156101fc57600080fd5b5051905060005b828110156103375760008573ffffffffffffffffffffffffffffffffffffffff1663ade37c13836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d602081101561028857600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80841660048301529151929350908516916370a0823191602480820192602092909190829003018186803b1580156102fd57600080fd5b505afa158015610311573d6000803e3d6000fd5b505050506040513d602081101561032757600080fd5b5051949094019350600101610203565b505050919050565b50600090565b6000808273ffffffffffffffffffffffffffffffffffffffff1663821beaf56040518163ffffffff1660e01b815260040160206040518083038186803b15801561038e57600080fd5b505afa1580156103a2573d6000803e3d6000fd5b505050506040513d60208110156103b857600080fd5b50519050600080805b8381101561047c5760008673ffffffffffffffffffffffffffffffffffffffff1663ade37c13836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561041c57600080fd5b505afa158015610430573d6000803e3d6000fd5b505050506040513d602081101561044657600080fd5b50519050610452610ea7565b61045c8289610492565b61014081015160a0909101519586019502939093019250506001016103c1565b5081818161048657fe5b0493505050505b919050565b61049a610ea7565b8273ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104e257600080fd5b505af11580156104f6573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff16633ba0b9a96040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561054457600080fd5b505af1158015610558573d6000803e3d6000fd5b505050506040513d602081101561056e57600080fd5b5051604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff8716916318160ddd916004808301926020929190829003018186803b1580156105dc57600080fd5b505afa1580156105f0573d6000803e3d6000fd5b505050506040513d602081101561060657600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529151929350600092918816916370a0823191602480820192602092909190829003018186803b15801561067e57600080fd5b505afa158015610692573d6000803e3d6000fd5b505050506040513d60208110156106a857600080fd5b5051905060006106be838363ffffffff610a2e16565b90506040518061016001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018873ffffffffffffffffffffffffffffffffffffffff166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b15801561073457600080fd5b505afa158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b5051815260200161078d670de0b6b3a7640000610781858963ffffffff610a7716565b9063ffffffff610aea16565b81526020016107ae670de0b6b3a7640000610781868963ffffffff610a7716565b81526020016107cf670de0b6b3a7640000610781868963ffffffff610a7716565b81526020018873ffffffffffffffffffffffffffffffffffffffff166391b427456040518163ffffffff1660e01b815260040160206040518083038186803b15801561081a57600080fd5b505afa15801561082e573d6000803e3d6000fd5b505050506040513d602081101561084457600080fd5b50518152604080517f1aebf12f000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692631aebf12f9260048083019392829003018186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d60208110156108da57600080fd5b50518152604080517f4322b714000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692634322b7149260048083019392829003018186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b50518152604080517f5b2b9d1a000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692635b2b9d1a9260048083019392829003018186803b1580156109dc57600080fd5b505afa1580156109f0573d6000803e3d6000fd5b505050506040513d6020811015610a0657600080fd5b5051815260006020909101529450610a1d85610b2c565b610140860152505050505b92915050565b6000610a7083836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250610c4e565b9392505050565b600082610a8657506000610a28565b82820282848281610a9357fe5b0414610a70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610f186021913960400191505060405180910390fd5b6000610a7083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610cff565b600080610b3883610d7e565b90508260e00151811015610bb45760e0830151600090610b6a9061078184670de0b6b3a764000063ffffffff610a7716565b9050610bac670de0b6b3a7640000610781610b8487610dbe565b610ba0670de0b6b3a7640000610781878063ffffffff610a7716565b9063ffffffff610a7716565b925050610c48565b610c45670de0b6b3a7640000610781610bcc86610dbe565b610ba0670de0b6b3a7640000610c39610bf460018b6101200151610a2e90919063ffffffff16565b610ba0610c168c60e00151670de0b6b3a7640000610a2e90919063ffffffff16565b610781670de0b6b3a7640000610ba08f60e001518e610a2e90919063ffffffff16565b9063ffffffff610e1616565b91505b50919050565b60008184841115610cf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610cbc578181015183820152602001610ca4565b50505050905090810190601f168015610ce95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315610cbc578181015183820152602001610ca4565b506000838581610d7457fe5b0495945050505050565b600080610d8a83610e8a565b905080610d9b57600091505061048d565b610c4581610781670de0b6b3a76400008660400151610a7790919063ffffffff16565b6000610a28670de0b6b3a7640000610781610def856101000151670de0b6b3a7640000610a2e90919063ffffffff16565b610ba0670de0b6b3a76400006107818860c001518960e00151610a7790919063ffffffff16565b600082820183811015610a7057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610a288260a001518360600151610e1690919063ffffffff16565b604051806101600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158202fae90389ac75e954df857f1c641815fa72d45504b066c9be5056c979681995f64736f6c63430005100032",
70
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063266e2bd8146100465780633d1cdd851461008b5780636b5441a9146100be575b600080fd5b6100796004803603602081101561005c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100f1565b60408051918252519081900360200190f35b610079600480360360208110156100a157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661033f565b610079600480360360208110156100d457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610345565b6000808273ffffffffffffffffffffffffffffffffffffffff1663821beaf56040518163ffffffff1660e01b815260040160206040518083038186803b15801561013a57600080fd5b505afa15801561014e573d6000803e3d6000fd5b505050506040513d602081101561016457600080fd5b5051604080517f6f307dc3000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff861691636f307dc3916004808301926020929190829003018186803b1580156101d257600080fd5b505afa1580156101e6573d6000803e3d6000fd5b505050506040513d60208110156101fc57600080fd5b5051905060005b828110156103375760008573ffffffffffffffffffffffffffffffffffffffff1663ade37c13836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d602081101561028857600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80841660048301529151929350908516916370a0823191602480820192602092909190829003018186803b1580156102fd57600080fd5b505afa158015610311573d6000803e3d6000fd5b505050506040513d602081101561032757600080fd5b5051949094019350600101610203565b505050919050565b50600090565b6000808273ffffffffffffffffffffffffffffffffffffffff1663821beaf56040518163ffffffff1660e01b815260040160206040518083038186803b15801561038e57600080fd5b505afa1580156103a2573d6000803e3d6000fd5b505050506040513d60208110156103b857600080fd5b50519050600080805b8381101561047c5760008673ffffffffffffffffffffffffffffffffffffffff1663ade37c13836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561041c57600080fd5b505afa158015610430573d6000803e3d6000fd5b505050506040513d602081101561044657600080fd5b50519050610452610ea7565b61045c8289610492565b61014081015160a0909101519586019502939093019250506001016103c1565b5081818161048657fe5b0493505050505b919050565b61049a610ea7565b8273ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104e257600080fd5b505af11580156104f6573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff16633ba0b9a96040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561054457600080fd5b505af1158015610558573d6000803e3d6000fd5b505050506040513d602081101561056e57600080fd5b5051604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff8716916318160ddd916004808301926020929190829003018186803b1580156105dc57600080fd5b505afa1580156105f0573d6000803e3d6000fd5b505050506040513d602081101561060657600080fd5b5051604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529151929350600092918816916370a0823191602480820192602092909190829003018186803b15801561067e57600080fd5b505afa158015610692573d6000803e3d6000fd5b505050506040513d60208110156106a857600080fd5b5051905060006106be838363ffffffff610a2e16565b90506040518061016001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018873ffffffffffffffffffffffffffffffffffffffff166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b15801561073457600080fd5b505afa158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b5051815260200161078d670de0b6b3a7640000610781858963ffffffff610a7716565b9063ffffffff610aea16565b81526020016107ae670de0b6b3a7640000610781868963ffffffff610a7716565b81526020016107cf670de0b6b3a7640000610781868963ffffffff610a7716565b81526020018873ffffffffffffffffffffffffffffffffffffffff166391b427456040518163ffffffff1660e01b815260040160206040518083038186803b15801561081a57600080fd5b505afa15801561082e573d6000803e3d6000fd5b505050506040513d602081101561084457600080fd5b50518152604080517f1aebf12f000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692631aebf12f9260048083019392829003018186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d60208110156108da57600080fd5b50518152604080517f4322b714000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692634322b7149260048083019392829003018186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b50518152604080517f5b2b9d1a000000000000000000000000000000000000000000000000000000008152905160209283019273ffffffffffffffffffffffffffffffffffffffff8c1692635b2b9d1a9260048083019392829003018186803b1580156109dc57600080fd5b505afa1580156109f0573d6000803e3d6000fd5b505050506040513d6020811015610a0657600080fd5b5051815260006020909101529450610a1d85610b2c565b610140860152505050505b92915050565b6000610a7083836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250610c4e565b9392505050565b600082610a8657506000610a28565b82820282848281610a9357fe5b0414610a70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610f186021913960400191505060405180910390fd5b6000610a7083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610cff565b600080610b3883610d7e565b90508260e00151811015610bb45760e0830151600090610b6a9061078184670de0b6b3a764000063ffffffff610a7716565b9050610bac670de0b6b3a7640000610781610b8487610dbe565b610ba0670de0b6b3a7640000610781878063ffffffff610a7716565b9063ffffffff610a7716565b925050610c48565b610c45670de0b6b3a7640000610781610bcc86610dbe565b610ba0670de0b6b3a7640000610c39610bf460018b6101200151610a2e90919063ffffffff16565b610ba0610c168c60e00151670de0b6b3a7640000610a2e90919063ffffffff16565b610781670de0b6b3a7640000610ba08f60e001518e610a2e90919063ffffffff16565b9063ffffffff610e1616565b91505b50919050565b60008184841115610cf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610cbc578181015183820152602001610ca4565b50505050905090810190601f168015610ce95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315610cbc578181015183820152602001610ca4565b506000838581610d7457fe5b0495945050505050565b600080610d8a83610e8a565b905080610d9b57600091505061048d565b610c4581610781670de0b6b3a76400008660400151610a7790919063ffffffff16565b6000610a28670de0b6b3a7640000610781610def856101000151670de0b6b3a7640000610a2e90919063ffffffff16565b610ba0670de0b6b3a76400006107818860c001518960e00151610a7790919063ffffffff16565b600082820183811015610a7057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610a288260a001518360600151610e1690919063ffffffff16565b604051806101600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158202fae90389ac75e954df857f1c641815fa72d45504b066c9be5056c979681995f64736f6c63430005100032",
71
+ "sourceMap": "189:1387:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;189:1387:7;;;;;;;",
72
+ "deployedSourceMap": "189:1387:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;189:1387:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;312:422;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;312:422:7;;;;:::i;:::-;;;;;;;;;;;;;;;;1475:98;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1475:98:7;;;;:::i;739:731::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;739:731:7;;;;:::i;312:422::-;381:23;411:22;452:5;436:43;;;:45;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;436:45:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;436:45:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;436:45:7;507:35;;;;;;;;436:45;;-1:-1:-1;486:18:7;;507:33;;;;;;:35;;;;;436:45;;507:35;;;;;;;:33;:35;;;5:2:-1;;;;30:1;27;20:12;5:2;507:35:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;507:35:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;507:35:7;;-1:-1:-1;552:6:7;547:183;568:17;564:1;:21;547:183;;;598:18;635:5;619:34;;;654:1;619:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;619:37:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;619:37:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;619:37:7;684:40;;;;;;:28;:40;;;;;;;;;619:37;;-1:-1:-1;684:28:7;;;;;;:40;;;;;619:37;;684:40;;;;;;;;:28;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;684:40:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;684:40:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;684:40:7;662:62;;;;;-1:-1:-1;587:3:7;;547:183;;;;312:422;;;;;:::o;1475:98::-;-1:-1:-1;1540:15:7;;1475:98::o;739:731::-;795:15;817:22;858:5;842:43;;;:45;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;842:45:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;842:45:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;842:45:7;;-1:-1:-1;892:24:7;;;952:459;973:17;969:1;:21;952:459;;;1003:18;1040:5;1024:34;;;1059:1;1024:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1024:37:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1024:37:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1024:37:7;;-1:-1:-1;1067:51:7;;:::i;:::-;1121:62;1164:10;1177:5;1121:30;:62::i;:::-;1211:33;;;;1272:28;;;;;1306:37;;;;1374:31;1349:56;;;;;-1:-1:-1;;992:3:7;;952:459;;;;1446:19;1422:21;:43;;;;;;1415:50;;;;;739:731;;;;:::o;879:1151:17:-;974:28;;:::i;:::-;1009:18;:23;;;:25;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1009:25:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1009:25:17;;;;1039:17;1059:18;:31;;;:33;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1059:33:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1059:33:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1059:33:17;1124:32;;;;;;;;1059:33;;-1:-1:-1;1097:24:17;;1124:30;;;;;;:32;;;;;1059:33;;1124:32;;;;;;;:30;:32;;;5:2:-1;;;;30:1;27;20:12;5:2;1124:32:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1124:32:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1124:32:17;1188:42;;;;;;:28;:42;;;;;;;;;1124:32;;-1:-1:-1;1161:24:17;;1188:28;;;;;;:42;;;;;1124:32;;1188:42;;;;;;;;:28;:42;;;5:2:-1;;;;30:1;27;20:12;5:2;1188:42:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1188:42:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1188:42:17;;-1:-1:-1;1235:27:17;1265:44;:19;1188:42;1265:44;:23;:44;:::i;:::-;1235:74;;1327:619;;;;;;;;1364:18;1327:619;;;;;;1402:12;1327:619;;;;1434:18;:31;;;:33;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1434:33:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1434:33:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1434:33:17;1327:619;;1434:33;1327:619;1489:50;1534:4;1489:40;:22;1516:12;1489:40;:26;:40;:::i;:::-;:44;:50;:44;:50;:::i;:::-;1327:619;;;;1565:47;1607:4;1565:37;:19;1589:12;1565:37;:23;:37;:::i;:47::-;1327:619;;;;1631:47;1673:4;1631:37;:19;1655:12;1631:37;:23;:37;:::i;:47::-;1327:619;;;;1700:18;:33;;;:35;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1700:35:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1700:35:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1700:35:17;1327:619;;1762:40;;;;;;;;1700:35;1327:619;;;;1762:38;;;;;;:40;;;;;1700:35;1762:40;;;;;:38;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;1762:40:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1762:40:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1762:40:17;1327:619;;1823:34;;;;;;;;1762:40;1327:619;;;;1823:32;;;;;;:34;;;;;1762:40;1823:34;;;;;:32;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;1823:34:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1823:34:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1823:34:17;1327:619;;1879:36;;;;;;;;1823:34;1327:619;;;;1879:34;;;;;;:36;;;;;1823:34;1879:36;;;;;:34;:36;;;5:2:-1;;;;30:1;27;20:12;5:2;1879:36:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1879:36:17;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1879:36:17;1327:619;;1939:1;1879:36;1327:619;;;;1314:632;-1:-1:-1;1981:22:17;1314:632;1981:10;:22::i;:::-;1951:27;;;:52;-1:-1:-1;;;;879:1151:17;;;;;:::o;1879:137:19:-;1937:7;1964:44;1968:1;1971;1964:44;;;;;;;;;;;;;;;;;:3;:44::i;:::-;1957:51;1879:137;-1:-1:-1;;;1879:137:19:o;2740:471::-;2798:7;3043:6;3039:47;;-1:-1:-1;3073:1:19;3066:8;;3039:47;3110:5;;;3114:1;3110;:5;:1;3134:5;;;;;:10;3126:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4398:132;4456:7;4483:39;4487:1;4490;4483:39;;;;;;;;;;;;;;;;;:3;:39::i;2667:613:17:-;2740:9;2756:21;2780:27;2796:10;2780:15;:27::i;:::-;2756:51;;2835:10;:30;;;2816:16;:49;2812:464;;;2917:30;;;;2873:10;;2886:62;;:26;:16;2907:4;2886:26;:20;:26;:::i;:62::-;2873:75;;2961:62;3018:4;2961:52;2992:20;3001:10;2992:8;:20::i;:::-;2961:26;2982:4;2961:16;2971:5;;2961:16;:9;:16;:::i;:26::-;:30;:52;:30;:52;:::i;:62::-;2954:69;;2812:464;;;;3048:222;3265:4;3048:212;3239:20;3248:10;3239:8;:20::i;:::-;3048:180;3223:4;3048:164;3179:32;3209:1;3179:10;:25;;;:29;;:32;;;;:::i;:::-;3048:120;3121:46;3136:10;:30;;;3126:4;3121:14;;:46;;;;:::i;:::-;3048:68;3111:4;3048:52;3069:10;:30;;;3048:16;:20;;:52;;;;:::i;:164::-;:174;:180;:174;:180;:::i;:222::-;3041:229;;2812:464;2667:613;;;;:::o;2305:192:19:-;2391:7;2427:12;2419:6;;;;2411:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2411:29:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2463:5:19;;;2305:192::o;5018:345::-;5104:7;5206:12;5199:5;5191:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;5191:28:19;;5230:9;5246:1;5242;:5;;;;;;;5018:345;-1:-1:-1;;;;;5018:345:19:o;2190:236:17:-;2268:4;2279:17;2299:23;2311:10;2299:11;:23::i;:::-;2279:43;-1:-1:-1;2331:17:17;2327:31;;2357:1;2350:8;;;;;2327:31;2370:51;2408:12;2370:33;2398:4;2370:10;:23;;;:27;;:33;;;;:::i;2431:231::-;2502:4;2520:137;2652:4;2520:127;2606:40;2621:10;:24;;;2611:4;2606:14;;:40;;;;:::i;:::-;2520:76;2591:4;2520:66;2560:10;:25;;;2520:10;:30;;;:39;;:66;;;;:::i;986:181:19:-;1044:7;1076:5;;;1100:6;;;;1092:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2035:150:17;2109:4;2127:53;2157:10;:22;;;2127:10;:25;;;:29;;:53;;;;:::i;189:1387:7:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
73
+ "source": "pragma solidity =0.5.16;\r\n\r\nimport \"./interfaces/ILendingVaultV1.sol\";\r\nimport \"./interfaces/IERC20.sol\";\r\nimport \"./libraries/SafeMath.sol\";\r\nimport \"./libraries/BorrowableObject.sol\";\r\n\r\ncontract LendingVaultWatcher01 {\t\r\n\tusing SafeMath for uint;\r\n\tusing BorrowableObject for BorrowableObject.Borrowable;\r\n\r\n\tfunction getAvailableLiquidity(address vault) external view returns (uint availableLiquidity) {\r\n\t\tuint borrowablesLength = ILendingVaultV1(vault).getBorrowablesLength();\r\n\t\taddress underlying = ILendingVaultV1(vault).underlying();\r\n\t\tfor (uint i = 0; i < borrowablesLength; i++) {\r\n\t\t\taddress borrowable = ILendingVaultV1(vault).borrowables(i);\r\n\t\t\tavailableLiquidity += IERC20(underlying).balanceOf(borrowable);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getSupplyRate(address vault) external returns (uint supplyRate) {\r\n\t\tuint borrowablesLength = ILendingVaultV1(vault).getBorrowablesLength();\r\n\t\tuint totalSuppliedAmount;\r\n\t\tuint totalProfitsPerSecond;\r\n\t\tfor (uint i = 0; i < borrowablesLength; i++) {\r\n\t\t\taddress borrowable = ILendingVaultV1(vault).borrowables(i);\r\n\t\t\tBorrowableObject.Borrowable memory borrowableObject = BorrowableObject.newBorrowable(IBorrowable(borrowable), vault);\r\n\t\t\tuint borrowableRate = borrowableObject.cachedSupplyRate;\r\n\t\t\tuint suppliedAmount = borrowableObject.ownedSupply;\r\n\t\t\ttotalSuppliedAmount += suppliedAmount;\r\n\t\t\ttotalProfitsPerSecond += borrowableRate * suppliedAmount;\r\n\t\t}\r\n\t\treturn totalProfitsPerSecond / totalSuppliedAmount;\r\n\t}\r\n\r\n\tfunction getOptimizedSupplyRate(address vault) external returns (uint supplyRate) {\r\n\t\t// TODO\r\n\t}\r\n}",
74
+ "sourcePath": "C:/Users/simor/Desktop/lending-vault/contracts/LendingVaultWatcher01.sol",
75
+ "ast": {
76
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/LendingVaultWatcher01.sol",
77
+ "exportedSymbols": {
78
+ "LendingVaultWatcher01": [
79
+ 2416
80
+ ]
81
+ },
82
+ "id": 2417,
83
+ "nodeType": "SourceUnit",
84
+ "nodes": [
85
+ {
86
+ "id": 2264,
87
+ "literals": [
88
+ "solidity",
89
+ "=",
90
+ "0.5",
91
+ ".16"
92
+ ],
93
+ "nodeType": "PragmaDirective",
94
+ "src": "0:24:7"
95
+ },
96
+ {
97
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/interfaces/ILendingVaultV1.sol",
98
+ "file": "./interfaces/ILendingVaultV1.sol",
99
+ "id": 2265,
100
+ "nodeType": "ImportDirective",
101
+ "scope": 2417,
102
+ "sourceUnit": 3619,
103
+ "src": "28:42:7",
104
+ "symbolAliases": [],
105
+ "unitAlias": ""
106
+ },
107
+ {
108
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/interfaces/IERC20.sol",
109
+ "file": "./interfaces/IERC20.sol",
110
+ "id": 2266,
111
+ "nodeType": "ImportDirective",
112
+ "scope": 2417,
113
+ "sourceUnit": 3290,
114
+ "src": "72:33:7",
115
+ "symbolAliases": [],
116
+ "unitAlias": ""
117
+ },
118
+ {
119
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/libraries/SafeMath.sol",
120
+ "file": "./libraries/SafeMath.sol",
121
+ "id": 2267,
122
+ "nodeType": "ImportDirective",
123
+ "scope": 2417,
124
+ "sourceUnit": 5086,
125
+ "src": "107:34:7",
126
+ "symbolAliases": [],
127
+ "unitAlias": ""
128
+ },
129
+ {
130
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/libraries/BorrowableObject.sol",
131
+ "file": "./libraries/BorrowableObject.sol",
132
+ "id": 2268,
133
+ "nodeType": "ImportDirective",
134
+ "scope": 2417,
135
+ "sourceUnit": 4760,
136
+ "src": "143:42:7",
137
+ "symbolAliases": [],
138
+ "unitAlias": ""
139
+ },
140
+ {
141
+ "baseContracts": [],
142
+ "contractDependencies": [],
143
+ "contractKind": "contract",
144
+ "documentation": null,
145
+ "fullyImplemented": true,
146
+ "id": 2416,
147
+ "linearizedBaseContracts": [
148
+ 2416
149
+ ],
150
+ "name": "LendingVaultWatcher01",
151
+ "nodeType": "ContractDefinition",
152
+ "nodes": [
153
+ {
154
+ "id": 2271,
155
+ "libraryName": {
156
+ "contractScope": null,
157
+ "id": 2269,
158
+ "name": "SafeMath",
159
+ "nodeType": "UserDefinedTypeName",
160
+ "referencedDeclaration": 5085,
161
+ "src": "231:8:7",
162
+ "typeDescriptions": {
163
+ "typeIdentifier": "t_contract$_SafeMath_$5085",
164
+ "typeString": "library SafeMath"
165
+ }
166
+ },
167
+ "nodeType": "UsingForDirective",
168
+ "src": "225:24:7",
169
+ "typeName": {
170
+ "id": 2270,
171
+ "name": "uint",
172
+ "nodeType": "ElementaryTypeName",
173
+ "src": "244:4:7",
174
+ "typeDescriptions": {
175
+ "typeIdentifier": "t_uint256",
176
+ "typeString": "uint256"
177
+ }
178
+ }
179
+ },
180
+ {
181
+ "id": 2274,
182
+ "libraryName": {
183
+ "contractScope": null,
184
+ "id": 2272,
185
+ "name": "BorrowableObject",
186
+ "nodeType": "UserDefinedTypeName",
187
+ "referencedDeclaration": 4759,
188
+ "src": "258:16:7",
189
+ "typeDescriptions": {
190
+ "typeIdentifier": "t_contract$_BorrowableObject_$4759",
191
+ "typeString": "library BorrowableObject"
192
+ }
193
+ },
194
+ "nodeType": "UsingForDirective",
195
+ "src": "252:55:7",
196
+ "typeName": {
197
+ "contractScope": null,
198
+ "id": 2273,
199
+ "name": "BorrowableObject.Borrowable",
200
+ "nodeType": "UserDefinedTypeName",
201
+ "referencedDeclaration": 4259,
202
+ "src": "279:27:7",
203
+ "typeDescriptions": {
204
+ "typeIdentifier": "t_struct$_Borrowable_$4259_storage_ptr",
205
+ "typeString": "struct BorrowableObject.Borrowable"
206
+ }
207
+ }
208
+ },
209
+ {
210
+ "body": {
211
+ "id": 2327,
212
+ "nodeType": "Block",
213
+ "src": "406:328:7",
214
+ "statements": [
215
+ {
216
+ "assignments": [
217
+ 2282
218
+ ],
219
+ "declarations": [
220
+ {
221
+ "constant": false,
222
+ "id": 2282,
223
+ "name": "borrowablesLength",
224
+ "nodeType": "VariableDeclaration",
225
+ "scope": 2327,
226
+ "src": "411:22:7",
227
+ "stateVariable": false,
228
+ "storageLocation": "default",
229
+ "typeDescriptions": {
230
+ "typeIdentifier": "t_uint256",
231
+ "typeString": "uint256"
232
+ },
233
+ "typeName": {
234
+ "id": 2281,
235
+ "name": "uint",
236
+ "nodeType": "ElementaryTypeName",
237
+ "src": "411:4:7",
238
+ "typeDescriptions": {
239
+ "typeIdentifier": "t_uint256",
240
+ "typeString": "uint256"
241
+ }
242
+ },
243
+ "value": null,
244
+ "visibility": "internal"
245
+ }
246
+ ],
247
+ "id": 2288,
248
+ "initialValue": {
249
+ "argumentTypes": null,
250
+ "arguments": [],
251
+ "expression": {
252
+ "argumentTypes": [],
253
+ "expression": {
254
+ "argumentTypes": null,
255
+ "arguments": [
256
+ {
257
+ "argumentTypes": null,
258
+ "id": 2284,
259
+ "name": "vault",
260
+ "nodeType": "Identifier",
261
+ "overloadedDeclarations": [],
262
+ "referencedDeclaration": 2276,
263
+ "src": "452:5:7",
264
+ "typeDescriptions": {
265
+ "typeIdentifier": "t_address",
266
+ "typeString": "address"
267
+ }
268
+ }
269
+ ],
270
+ "expression": {
271
+ "argumentTypes": [
272
+ {
273
+ "typeIdentifier": "t_address",
274
+ "typeString": "address"
275
+ }
276
+ ],
277
+ "id": 2283,
278
+ "name": "ILendingVaultV1",
279
+ "nodeType": "Identifier",
280
+ "overloadedDeclarations": [],
281
+ "referencedDeclaration": 3618,
282
+ "src": "436:15:7",
283
+ "typeDescriptions": {
284
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
285
+ "typeString": "type(contract ILendingVaultV1)"
286
+ }
287
+ },
288
+ "id": 2285,
289
+ "isConstant": false,
290
+ "isLValue": false,
291
+ "isPure": false,
292
+ "kind": "typeConversion",
293
+ "lValueRequested": false,
294
+ "names": [],
295
+ "nodeType": "FunctionCall",
296
+ "src": "436:22:7",
297
+ "typeDescriptions": {
298
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
299
+ "typeString": "contract ILendingVaultV1"
300
+ }
301
+ },
302
+ "id": 2286,
303
+ "isConstant": false,
304
+ "isLValue": false,
305
+ "isPure": false,
306
+ "lValueRequested": false,
307
+ "memberName": "getBorrowablesLength",
308
+ "nodeType": "MemberAccess",
309
+ "referencedDeclaration": 3549,
310
+ "src": "436:43:7",
311
+ "typeDescriptions": {
312
+ "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
313
+ "typeString": "function () view external returns (uint256)"
314
+ }
315
+ },
316
+ "id": 2287,
317
+ "isConstant": false,
318
+ "isLValue": false,
319
+ "isPure": false,
320
+ "kind": "functionCall",
321
+ "lValueRequested": false,
322
+ "names": [],
323
+ "nodeType": "FunctionCall",
324
+ "src": "436:45:7",
325
+ "typeDescriptions": {
326
+ "typeIdentifier": "t_uint256",
327
+ "typeString": "uint256"
328
+ }
329
+ },
330
+ "nodeType": "VariableDeclarationStatement",
331
+ "src": "411:70:7"
332
+ },
333
+ {
334
+ "assignments": [
335
+ 2290
336
+ ],
337
+ "declarations": [
338
+ {
339
+ "constant": false,
340
+ "id": 2290,
341
+ "name": "underlying",
342
+ "nodeType": "VariableDeclaration",
343
+ "scope": 2327,
344
+ "src": "486:18:7",
345
+ "stateVariable": false,
346
+ "storageLocation": "default",
347
+ "typeDescriptions": {
348
+ "typeIdentifier": "t_address",
349
+ "typeString": "address"
350
+ },
351
+ "typeName": {
352
+ "id": 2289,
353
+ "name": "address",
354
+ "nodeType": "ElementaryTypeName",
355
+ "src": "486:7:7",
356
+ "stateMutability": "nonpayable",
357
+ "typeDescriptions": {
358
+ "typeIdentifier": "t_address",
359
+ "typeString": "address"
360
+ }
361
+ },
362
+ "value": null,
363
+ "visibility": "internal"
364
+ }
365
+ ],
366
+ "id": 2296,
367
+ "initialValue": {
368
+ "argumentTypes": null,
369
+ "arguments": [],
370
+ "expression": {
371
+ "argumentTypes": [],
372
+ "expression": {
373
+ "argumentTypes": null,
374
+ "arguments": [
375
+ {
376
+ "argumentTypes": null,
377
+ "id": 2292,
378
+ "name": "vault",
379
+ "nodeType": "Identifier",
380
+ "overloadedDeclarations": [],
381
+ "referencedDeclaration": 2276,
382
+ "src": "523:5:7",
383
+ "typeDescriptions": {
384
+ "typeIdentifier": "t_address",
385
+ "typeString": "address"
386
+ }
387
+ }
388
+ ],
389
+ "expression": {
390
+ "argumentTypes": [
391
+ {
392
+ "typeIdentifier": "t_address",
393
+ "typeString": "address"
394
+ }
395
+ ],
396
+ "id": 2291,
397
+ "name": "ILendingVaultV1",
398
+ "nodeType": "Identifier",
399
+ "overloadedDeclarations": [],
400
+ "referencedDeclaration": 3618,
401
+ "src": "507:15:7",
402
+ "typeDescriptions": {
403
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
404
+ "typeString": "type(contract ILendingVaultV1)"
405
+ }
406
+ },
407
+ "id": 2293,
408
+ "isConstant": false,
409
+ "isLValue": false,
410
+ "isPure": false,
411
+ "kind": "typeConversion",
412
+ "lValueRequested": false,
413
+ "names": [],
414
+ "nodeType": "FunctionCall",
415
+ "src": "507:22:7",
416
+ "typeDescriptions": {
417
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
418
+ "typeString": "contract ILendingVaultV1"
419
+ }
420
+ },
421
+ "id": 2294,
422
+ "isConstant": false,
423
+ "isLValue": false,
424
+ "isPure": false,
425
+ "lValueRequested": false,
426
+ "memberName": "underlying",
427
+ "nodeType": "MemberAccess",
428
+ "referencedDeclaration": 3443,
429
+ "src": "507:33:7",
430
+ "typeDescriptions": {
431
+ "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
432
+ "typeString": "function () view external returns (address)"
433
+ }
434
+ },
435
+ "id": 2295,
436
+ "isConstant": false,
437
+ "isLValue": false,
438
+ "isPure": false,
439
+ "kind": "functionCall",
440
+ "lValueRequested": false,
441
+ "names": [],
442
+ "nodeType": "FunctionCall",
443
+ "src": "507:35:7",
444
+ "typeDescriptions": {
445
+ "typeIdentifier": "t_address",
446
+ "typeString": "address"
447
+ }
448
+ },
449
+ "nodeType": "VariableDeclarationStatement",
450
+ "src": "486:56:7"
451
+ },
452
+ {
453
+ "body": {
454
+ "id": 2325,
455
+ "nodeType": "Block",
456
+ "src": "592:138:7",
457
+ "statements": [
458
+ {
459
+ "assignments": [
460
+ 2308
461
+ ],
462
+ "declarations": [
463
+ {
464
+ "constant": false,
465
+ "id": 2308,
466
+ "name": "borrowable",
467
+ "nodeType": "VariableDeclaration",
468
+ "scope": 2325,
469
+ "src": "598:18:7",
470
+ "stateVariable": false,
471
+ "storageLocation": "default",
472
+ "typeDescriptions": {
473
+ "typeIdentifier": "t_address",
474
+ "typeString": "address"
475
+ },
476
+ "typeName": {
477
+ "id": 2307,
478
+ "name": "address",
479
+ "nodeType": "ElementaryTypeName",
480
+ "src": "598:7:7",
481
+ "stateMutability": "nonpayable",
482
+ "typeDescriptions": {
483
+ "typeIdentifier": "t_address",
484
+ "typeString": "address"
485
+ }
486
+ },
487
+ "value": null,
488
+ "visibility": "internal"
489
+ }
490
+ ],
491
+ "id": 2315,
492
+ "initialValue": {
493
+ "argumentTypes": null,
494
+ "arguments": [
495
+ {
496
+ "argumentTypes": null,
497
+ "id": 2313,
498
+ "name": "i",
499
+ "nodeType": "Identifier",
500
+ "overloadedDeclarations": [],
501
+ "referencedDeclaration": 2298,
502
+ "src": "654:1:7",
503
+ "typeDescriptions": {
504
+ "typeIdentifier": "t_uint256",
505
+ "typeString": "uint256"
506
+ }
507
+ }
508
+ ],
509
+ "expression": {
510
+ "argumentTypes": [
511
+ {
512
+ "typeIdentifier": "t_uint256",
513
+ "typeString": "uint256"
514
+ }
515
+ ],
516
+ "expression": {
517
+ "argumentTypes": null,
518
+ "arguments": [
519
+ {
520
+ "argumentTypes": null,
521
+ "id": 2310,
522
+ "name": "vault",
523
+ "nodeType": "Identifier",
524
+ "overloadedDeclarations": [],
525
+ "referencedDeclaration": 2276,
526
+ "src": "635:5:7",
527
+ "typeDescriptions": {
528
+ "typeIdentifier": "t_address",
529
+ "typeString": "address"
530
+ }
531
+ }
532
+ ],
533
+ "expression": {
534
+ "argumentTypes": [
535
+ {
536
+ "typeIdentifier": "t_address",
537
+ "typeString": "address"
538
+ }
539
+ ],
540
+ "id": 2309,
541
+ "name": "ILendingVaultV1",
542
+ "nodeType": "Identifier",
543
+ "overloadedDeclarations": [],
544
+ "referencedDeclaration": 3618,
545
+ "src": "619:15:7",
546
+ "typeDescriptions": {
547
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
548
+ "typeString": "type(contract ILendingVaultV1)"
549
+ }
550
+ },
551
+ "id": 2311,
552
+ "isConstant": false,
553
+ "isLValue": false,
554
+ "isPure": false,
555
+ "kind": "typeConversion",
556
+ "lValueRequested": false,
557
+ "names": [],
558
+ "nodeType": "FunctionCall",
559
+ "src": "619:22:7",
560
+ "typeDescriptions": {
561
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
562
+ "typeString": "contract ILendingVaultV1"
563
+ }
564
+ },
565
+ "id": 2312,
566
+ "isConstant": false,
567
+ "isLValue": false,
568
+ "isPure": false,
569
+ "lValueRequested": false,
570
+ "memberName": "borrowables",
571
+ "nodeType": "MemberAccess",
572
+ "referencedDeclaration": 3535,
573
+ "src": "619:34:7",
574
+ "typeDescriptions": {
575
+ "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
576
+ "typeString": "function (uint256) view external returns (address)"
577
+ }
578
+ },
579
+ "id": 2314,
580
+ "isConstant": false,
581
+ "isLValue": false,
582
+ "isPure": false,
583
+ "kind": "functionCall",
584
+ "lValueRequested": false,
585
+ "names": [],
586
+ "nodeType": "FunctionCall",
587
+ "src": "619:37:7",
588
+ "typeDescriptions": {
589
+ "typeIdentifier": "t_address",
590
+ "typeString": "address"
591
+ }
592
+ },
593
+ "nodeType": "VariableDeclarationStatement",
594
+ "src": "598:58:7"
595
+ },
596
+ {
597
+ "expression": {
598
+ "argumentTypes": null,
599
+ "id": 2323,
600
+ "isConstant": false,
601
+ "isLValue": false,
602
+ "isPure": false,
603
+ "lValueRequested": false,
604
+ "leftHandSide": {
605
+ "argumentTypes": null,
606
+ "id": 2316,
607
+ "name": "availableLiquidity",
608
+ "nodeType": "Identifier",
609
+ "overloadedDeclarations": [],
610
+ "referencedDeclaration": 2279,
611
+ "src": "662:18:7",
612
+ "typeDescriptions": {
613
+ "typeIdentifier": "t_uint256",
614
+ "typeString": "uint256"
615
+ }
616
+ },
617
+ "nodeType": "Assignment",
618
+ "operator": "+=",
619
+ "rightHandSide": {
620
+ "argumentTypes": null,
621
+ "arguments": [
622
+ {
623
+ "argumentTypes": null,
624
+ "id": 2321,
625
+ "name": "borrowable",
626
+ "nodeType": "Identifier",
627
+ "overloadedDeclarations": [],
628
+ "referencedDeclaration": 2308,
629
+ "src": "713:10:7",
630
+ "typeDescriptions": {
631
+ "typeIdentifier": "t_address",
632
+ "typeString": "address"
633
+ }
634
+ }
635
+ ],
636
+ "expression": {
637
+ "argumentTypes": [
638
+ {
639
+ "typeIdentifier": "t_address",
640
+ "typeString": "address"
641
+ }
642
+ ],
643
+ "expression": {
644
+ "argumentTypes": null,
645
+ "arguments": [
646
+ {
647
+ "argumentTypes": null,
648
+ "id": 2318,
649
+ "name": "underlying",
650
+ "nodeType": "Identifier",
651
+ "overloadedDeclarations": [],
652
+ "referencedDeclaration": 2290,
653
+ "src": "691:10:7",
654
+ "typeDescriptions": {
655
+ "typeIdentifier": "t_address",
656
+ "typeString": "address"
657
+ }
658
+ }
659
+ ],
660
+ "expression": {
661
+ "argumentTypes": [
662
+ {
663
+ "typeIdentifier": "t_address",
664
+ "typeString": "address"
665
+ }
666
+ ],
667
+ "id": 2317,
668
+ "name": "IERC20",
669
+ "nodeType": "Identifier",
670
+ "overloadedDeclarations": [],
671
+ "referencedDeclaration": 3289,
672
+ "src": "684:6:7",
673
+ "typeDescriptions": {
674
+ "typeIdentifier": "t_type$_t_contract$_IERC20_$3289_$",
675
+ "typeString": "type(contract IERC20)"
676
+ }
677
+ },
678
+ "id": 2319,
679
+ "isConstant": false,
680
+ "isLValue": false,
681
+ "isPure": false,
682
+ "kind": "typeConversion",
683
+ "lValueRequested": false,
684
+ "names": [],
685
+ "nodeType": "FunctionCall",
686
+ "src": "684:18:7",
687
+ "typeDescriptions": {
688
+ "typeIdentifier": "t_contract$_IERC20_$3289",
689
+ "typeString": "contract IERC20"
690
+ }
691
+ },
692
+ "id": 2320,
693
+ "isConstant": false,
694
+ "isLValue": false,
695
+ "isPure": false,
696
+ "lValueRequested": false,
697
+ "memberName": "balanceOf",
698
+ "nodeType": "MemberAccess",
699
+ "referencedDeclaration": 3250,
700
+ "src": "684:28:7",
701
+ "typeDescriptions": {
702
+ "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
703
+ "typeString": "function (address) view external returns (uint256)"
704
+ }
705
+ },
706
+ "id": 2322,
707
+ "isConstant": false,
708
+ "isLValue": false,
709
+ "isPure": false,
710
+ "kind": "functionCall",
711
+ "lValueRequested": false,
712
+ "names": [],
713
+ "nodeType": "FunctionCall",
714
+ "src": "684:40:7",
715
+ "typeDescriptions": {
716
+ "typeIdentifier": "t_uint256",
717
+ "typeString": "uint256"
718
+ }
719
+ },
720
+ "src": "662:62:7",
721
+ "typeDescriptions": {
722
+ "typeIdentifier": "t_uint256",
723
+ "typeString": "uint256"
724
+ }
725
+ },
726
+ "id": 2324,
727
+ "nodeType": "ExpressionStatement",
728
+ "src": "662:62:7"
729
+ }
730
+ ]
731
+ },
732
+ "condition": {
733
+ "argumentTypes": null,
734
+ "commonType": {
735
+ "typeIdentifier": "t_uint256",
736
+ "typeString": "uint256"
737
+ },
738
+ "id": 2303,
739
+ "isConstant": false,
740
+ "isLValue": false,
741
+ "isPure": false,
742
+ "lValueRequested": false,
743
+ "leftExpression": {
744
+ "argumentTypes": null,
745
+ "id": 2301,
746
+ "name": "i",
747
+ "nodeType": "Identifier",
748
+ "overloadedDeclarations": [],
749
+ "referencedDeclaration": 2298,
750
+ "src": "564:1:7",
751
+ "typeDescriptions": {
752
+ "typeIdentifier": "t_uint256",
753
+ "typeString": "uint256"
754
+ }
755
+ },
756
+ "nodeType": "BinaryOperation",
757
+ "operator": "<",
758
+ "rightExpression": {
759
+ "argumentTypes": null,
760
+ "id": 2302,
761
+ "name": "borrowablesLength",
762
+ "nodeType": "Identifier",
763
+ "overloadedDeclarations": [],
764
+ "referencedDeclaration": 2282,
765
+ "src": "568:17:7",
766
+ "typeDescriptions": {
767
+ "typeIdentifier": "t_uint256",
768
+ "typeString": "uint256"
769
+ }
770
+ },
771
+ "src": "564:21:7",
772
+ "typeDescriptions": {
773
+ "typeIdentifier": "t_bool",
774
+ "typeString": "bool"
775
+ }
776
+ },
777
+ "id": 2326,
778
+ "initializationExpression": {
779
+ "assignments": [
780
+ 2298
781
+ ],
782
+ "declarations": [
783
+ {
784
+ "constant": false,
785
+ "id": 2298,
786
+ "name": "i",
787
+ "nodeType": "VariableDeclaration",
788
+ "scope": 2326,
789
+ "src": "552:6:7",
790
+ "stateVariable": false,
791
+ "storageLocation": "default",
792
+ "typeDescriptions": {
793
+ "typeIdentifier": "t_uint256",
794
+ "typeString": "uint256"
795
+ },
796
+ "typeName": {
797
+ "id": 2297,
798
+ "name": "uint",
799
+ "nodeType": "ElementaryTypeName",
800
+ "src": "552:4:7",
801
+ "typeDescriptions": {
802
+ "typeIdentifier": "t_uint256",
803
+ "typeString": "uint256"
804
+ }
805
+ },
806
+ "value": null,
807
+ "visibility": "internal"
808
+ }
809
+ ],
810
+ "id": 2300,
811
+ "initialValue": {
812
+ "argumentTypes": null,
813
+ "hexValue": "30",
814
+ "id": 2299,
815
+ "isConstant": false,
816
+ "isLValue": false,
817
+ "isPure": true,
818
+ "kind": "number",
819
+ "lValueRequested": false,
820
+ "nodeType": "Literal",
821
+ "src": "561:1:7",
822
+ "subdenomination": null,
823
+ "typeDescriptions": {
824
+ "typeIdentifier": "t_rational_0_by_1",
825
+ "typeString": "int_const 0"
826
+ },
827
+ "value": "0"
828
+ },
829
+ "nodeType": "VariableDeclarationStatement",
830
+ "src": "552:10:7"
831
+ },
832
+ "loopExpression": {
833
+ "expression": {
834
+ "argumentTypes": null,
835
+ "id": 2305,
836
+ "isConstant": false,
837
+ "isLValue": false,
838
+ "isPure": false,
839
+ "lValueRequested": false,
840
+ "nodeType": "UnaryOperation",
841
+ "operator": "++",
842
+ "prefix": false,
843
+ "src": "587:3:7",
844
+ "subExpression": {
845
+ "argumentTypes": null,
846
+ "id": 2304,
847
+ "name": "i",
848
+ "nodeType": "Identifier",
849
+ "overloadedDeclarations": [],
850
+ "referencedDeclaration": 2298,
851
+ "src": "587:1:7",
852
+ "typeDescriptions": {
853
+ "typeIdentifier": "t_uint256",
854
+ "typeString": "uint256"
855
+ }
856
+ },
857
+ "typeDescriptions": {
858
+ "typeIdentifier": "t_uint256",
859
+ "typeString": "uint256"
860
+ }
861
+ },
862
+ "id": 2306,
863
+ "nodeType": "ExpressionStatement",
864
+ "src": "587:3:7"
865
+ },
866
+ "nodeType": "ForStatement",
867
+ "src": "547:183:7"
868
+ }
869
+ ]
870
+ },
871
+ "documentation": null,
872
+ "id": 2328,
873
+ "implemented": true,
874
+ "kind": "function",
875
+ "modifiers": [],
876
+ "name": "getAvailableLiquidity",
877
+ "nodeType": "FunctionDefinition",
878
+ "parameters": {
879
+ "id": 2277,
880
+ "nodeType": "ParameterList",
881
+ "parameters": [
882
+ {
883
+ "constant": false,
884
+ "id": 2276,
885
+ "name": "vault",
886
+ "nodeType": "VariableDeclaration",
887
+ "scope": 2328,
888
+ "src": "343:13:7",
889
+ "stateVariable": false,
890
+ "storageLocation": "default",
891
+ "typeDescriptions": {
892
+ "typeIdentifier": "t_address",
893
+ "typeString": "address"
894
+ },
895
+ "typeName": {
896
+ "id": 2275,
897
+ "name": "address",
898
+ "nodeType": "ElementaryTypeName",
899
+ "src": "343:7:7",
900
+ "stateMutability": "nonpayable",
901
+ "typeDescriptions": {
902
+ "typeIdentifier": "t_address",
903
+ "typeString": "address"
904
+ }
905
+ },
906
+ "value": null,
907
+ "visibility": "internal"
908
+ }
909
+ ],
910
+ "src": "342:15:7"
911
+ },
912
+ "returnParameters": {
913
+ "id": 2280,
914
+ "nodeType": "ParameterList",
915
+ "parameters": [
916
+ {
917
+ "constant": false,
918
+ "id": 2279,
919
+ "name": "availableLiquidity",
920
+ "nodeType": "VariableDeclaration",
921
+ "scope": 2328,
922
+ "src": "381:23:7",
923
+ "stateVariable": false,
924
+ "storageLocation": "default",
925
+ "typeDescriptions": {
926
+ "typeIdentifier": "t_uint256",
927
+ "typeString": "uint256"
928
+ },
929
+ "typeName": {
930
+ "id": 2278,
931
+ "name": "uint",
932
+ "nodeType": "ElementaryTypeName",
933
+ "src": "381:4:7",
934
+ "typeDescriptions": {
935
+ "typeIdentifier": "t_uint256",
936
+ "typeString": "uint256"
937
+ }
938
+ },
939
+ "value": null,
940
+ "visibility": "internal"
941
+ }
942
+ ],
943
+ "src": "380:25:7"
944
+ },
945
+ "scope": 2416,
946
+ "src": "312:422:7",
947
+ "stateMutability": "view",
948
+ "superFunction": null,
949
+ "visibility": "external"
950
+ },
951
+ {
952
+ "body": {
953
+ "id": 2406,
954
+ "nodeType": "Block",
955
+ "src": "812:658:7",
956
+ "statements": [
957
+ {
958
+ "assignments": [
959
+ 2336
960
+ ],
961
+ "declarations": [
962
+ {
963
+ "constant": false,
964
+ "id": 2336,
965
+ "name": "borrowablesLength",
966
+ "nodeType": "VariableDeclaration",
967
+ "scope": 2406,
968
+ "src": "817:22:7",
969
+ "stateVariable": false,
970
+ "storageLocation": "default",
971
+ "typeDescriptions": {
972
+ "typeIdentifier": "t_uint256",
973
+ "typeString": "uint256"
974
+ },
975
+ "typeName": {
976
+ "id": 2335,
977
+ "name": "uint",
978
+ "nodeType": "ElementaryTypeName",
979
+ "src": "817:4:7",
980
+ "typeDescriptions": {
981
+ "typeIdentifier": "t_uint256",
982
+ "typeString": "uint256"
983
+ }
984
+ },
985
+ "value": null,
986
+ "visibility": "internal"
987
+ }
988
+ ],
989
+ "id": 2342,
990
+ "initialValue": {
991
+ "argumentTypes": null,
992
+ "arguments": [],
993
+ "expression": {
994
+ "argumentTypes": [],
995
+ "expression": {
996
+ "argumentTypes": null,
997
+ "arguments": [
998
+ {
999
+ "argumentTypes": null,
1000
+ "id": 2338,
1001
+ "name": "vault",
1002
+ "nodeType": "Identifier",
1003
+ "overloadedDeclarations": [],
1004
+ "referencedDeclaration": 2330,
1005
+ "src": "858:5:7",
1006
+ "typeDescriptions": {
1007
+ "typeIdentifier": "t_address",
1008
+ "typeString": "address"
1009
+ }
1010
+ }
1011
+ ],
1012
+ "expression": {
1013
+ "argumentTypes": [
1014
+ {
1015
+ "typeIdentifier": "t_address",
1016
+ "typeString": "address"
1017
+ }
1018
+ ],
1019
+ "id": 2337,
1020
+ "name": "ILendingVaultV1",
1021
+ "nodeType": "Identifier",
1022
+ "overloadedDeclarations": [],
1023
+ "referencedDeclaration": 3618,
1024
+ "src": "842:15:7",
1025
+ "typeDescriptions": {
1026
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
1027
+ "typeString": "type(contract ILendingVaultV1)"
1028
+ }
1029
+ },
1030
+ "id": 2339,
1031
+ "isConstant": false,
1032
+ "isLValue": false,
1033
+ "isPure": false,
1034
+ "kind": "typeConversion",
1035
+ "lValueRequested": false,
1036
+ "names": [],
1037
+ "nodeType": "FunctionCall",
1038
+ "src": "842:22:7",
1039
+ "typeDescriptions": {
1040
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
1041
+ "typeString": "contract ILendingVaultV1"
1042
+ }
1043
+ },
1044
+ "id": 2340,
1045
+ "isConstant": false,
1046
+ "isLValue": false,
1047
+ "isPure": false,
1048
+ "lValueRequested": false,
1049
+ "memberName": "getBorrowablesLength",
1050
+ "nodeType": "MemberAccess",
1051
+ "referencedDeclaration": 3549,
1052
+ "src": "842:43:7",
1053
+ "typeDescriptions": {
1054
+ "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
1055
+ "typeString": "function () view external returns (uint256)"
1056
+ }
1057
+ },
1058
+ "id": 2341,
1059
+ "isConstant": false,
1060
+ "isLValue": false,
1061
+ "isPure": false,
1062
+ "kind": "functionCall",
1063
+ "lValueRequested": false,
1064
+ "names": [],
1065
+ "nodeType": "FunctionCall",
1066
+ "src": "842:45:7",
1067
+ "typeDescriptions": {
1068
+ "typeIdentifier": "t_uint256",
1069
+ "typeString": "uint256"
1070
+ }
1071
+ },
1072
+ "nodeType": "VariableDeclarationStatement",
1073
+ "src": "817:70:7"
1074
+ },
1075
+ {
1076
+ "assignments": [
1077
+ 2344
1078
+ ],
1079
+ "declarations": [
1080
+ {
1081
+ "constant": false,
1082
+ "id": 2344,
1083
+ "name": "totalSuppliedAmount",
1084
+ "nodeType": "VariableDeclaration",
1085
+ "scope": 2406,
1086
+ "src": "892:24:7",
1087
+ "stateVariable": false,
1088
+ "storageLocation": "default",
1089
+ "typeDescriptions": {
1090
+ "typeIdentifier": "t_uint256",
1091
+ "typeString": "uint256"
1092
+ },
1093
+ "typeName": {
1094
+ "id": 2343,
1095
+ "name": "uint",
1096
+ "nodeType": "ElementaryTypeName",
1097
+ "src": "892:4:7",
1098
+ "typeDescriptions": {
1099
+ "typeIdentifier": "t_uint256",
1100
+ "typeString": "uint256"
1101
+ }
1102
+ },
1103
+ "value": null,
1104
+ "visibility": "internal"
1105
+ }
1106
+ ],
1107
+ "id": 2345,
1108
+ "initialValue": null,
1109
+ "nodeType": "VariableDeclarationStatement",
1110
+ "src": "892:24:7"
1111
+ },
1112
+ {
1113
+ "assignments": [
1114
+ 2347
1115
+ ],
1116
+ "declarations": [
1117
+ {
1118
+ "constant": false,
1119
+ "id": 2347,
1120
+ "name": "totalProfitsPerSecond",
1121
+ "nodeType": "VariableDeclaration",
1122
+ "scope": 2406,
1123
+ "src": "921:26:7",
1124
+ "stateVariable": false,
1125
+ "storageLocation": "default",
1126
+ "typeDescriptions": {
1127
+ "typeIdentifier": "t_uint256",
1128
+ "typeString": "uint256"
1129
+ },
1130
+ "typeName": {
1131
+ "id": 2346,
1132
+ "name": "uint",
1133
+ "nodeType": "ElementaryTypeName",
1134
+ "src": "921:4:7",
1135
+ "typeDescriptions": {
1136
+ "typeIdentifier": "t_uint256",
1137
+ "typeString": "uint256"
1138
+ }
1139
+ },
1140
+ "value": null,
1141
+ "visibility": "internal"
1142
+ }
1143
+ ],
1144
+ "id": 2348,
1145
+ "initialValue": null,
1146
+ "nodeType": "VariableDeclarationStatement",
1147
+ "src": "921:26:7"
1148
+ },
1149
+ {
1150
+ "body": {
1151
+ "id": 2400,
1152
+ "nodeType": "Block",
1153
+ "src": "997:414:7",
1154
+ "statements": [
1155
+ {
1156
+ "assignments": [
1157
+ 2360
1158
+ ],
1159
+ "declarations": [
1160
+ {
1161
+ "constant": false,
1162
+ "id": 2360,
1163
+ "name": "borrowable",
1164
+ "nodeType": "VariableDeclaration",
1165
+ "scope": 2400,
1166
+ "src": "1003:18:7",
1167
+ "stateVariable": false,
1168
+ "storageLocation": "default",
1169
+ "typeDescriptions": {
1170
+ "typeIdentifier": "t_address",
1171
+ "typeString": "address"
1172
+ },
1173
+ "typeName": {
1174
+ "id": 2359,
1175
+ "name": "address",
1176
+ "nodeType": "ElementaryTypeName",
1177
+ "src": "1003:7:7",
1178
+ "stateMutability": "nonpayable",
1179
+ "typeDescriptions": {
1180
+ "typeIdentifier": "t_address",
1181
+ "typeString": "address"
1182
+ }
1183
+ },
1184
+ "value": null,
1185
+ "visibility": "internal"
1186
+ }
1187
+ ],
1188
+ "id": 2367,
1189
+ "initialValue": {
1190
+ "argumentTypes": null,
1191
+ "arguments": [
1192
+ {
1193
+ "argumentTypes": null,
1194
+ "id": 2365,
1195
+ "name": "i",
1196
+ "nodeType": "Identifier",
1197
+ "overloadedDeclarations": [],
1198
+ "referencedDeclaration": 2350,
1199
+ "src": "1059:1:7",
1200
+ "typeDescriptions": {
1201
+ "typeIdentifier": "t_uint256",
1202
+ "typeString": "uint256"
1203
+ }
1204
+ }
1205
+ ],
1206
+ "expression": {
1207
+ "argumentTypes": [
1208
+ {
1209
+ "typeIdentifier": "t_uint256",
1210
+ "typeString": "uint256"
1211
+ }
1212
+ ],
1213
+ "expression": {
1214
+ "argumentTypes": null,
1215
+ "arguments": [
1216
+ {
1217
+ "argumentTypes": null,
1218
+ "id": 2362,
1219
+ "name": "vault",
1220
+ "nodeType": "Identifier",
1221
+ "overloadedDeclarations": [],
1222
+ "referencedDeclaration": 2330,
1223
+ "src": "1040:5:7",
1224
+ "typeDescriptions": {
1225
+ "typeIdentifier": "t_address",
1226
+ "typeString": "address"
1227
+ }
1228
+ }
1229
+ ],
1230
+ "expression": {
1231
+ "argumentTypes": [
1232
+ {
1233
+ "typeIdentifier": "t_address",
1234
+ "typeString": "address"
1235
+ }
1236
+ ],
1237
+ "id": 2361,
1238
+ "name": "ILendingVaultV1",
1239
+ "nodeType": "Identifier",
1240
+ "overloadedDeclarations": [],
1241
+ "referencedDeclaration": 3618,
1242
+ "src": "1024:15:7",
1243
+ "typeDescriptions": {
1244
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
1245
+ "typeString": "type(contract ILendingVaultV1)"
1246
+ }
1247
+ },
1248
+ "id": 2363,
1249
+ "isConstant": false,
1250
+ "isLValue": false,
1251
+ "isPure": false,
1252
+ "kind": "typeConversion",
1253
+ "lValueRequested": false,
1254
+ "names": [],
1255
+ "nodeType": "FunctionCall",
1256
+ "src": "1024:22:7",
1257
+ "typeDescriptions": {
1258
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
1259
+ "typeString": "contract ILendingVaultV1"
1260
+ }
1261
+ },
1262
+ "id": 2364,
1263
+ "isConstant": false,
1264
+ "isLValue": false,
1265
+ "isPure": false,
1266
+ "lValueRequested": false,
1267
+ "memberName": "borrowables",
1268
+ "nodeType": "MemberAccess",
1269
+ "referencedDeclaration": 3535,
1270
+ "src": "1024:34:7",
1271
+ "typeDescriptions": {
1272
+ "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
1273
+ "typeString": "function (uint256) view external returns (address)"
1274
+ }
1275
+ },
1276
+ "id": 2366,
1277
+ "isConstant": false,
1278
+ "isLValue": false,
1279
+ "isPure": false,
1280
+ "kind": "functionCall",
1281
+ "lValueRequested": false,
1282
+ "names": [],
1283
+ "nodeType": "FunctionCall",
1284
+ "src": "1024:37:7",
1285
+ "typeDescriptions": {
1286
+ "typeIdentifier": "t_address",
1287
+ "typeString": "address"
1288
+ }
1289
+ },
1290
+ "nodeType": "VariableDeclarationStatement",
1291
+ "src": "1003:58:7"
1292
+ },
1293
+ {
1294
+ "assignments": [
1295
+ 2371
1296
+ ],
1297
+ "declarations": [
1298
+ {
1299
+ "constant": false,
1300
+ "id": 2371,
1301
+ "name": "borrowableObject",
1302
+ "nodeType": "VariableDeclaration",
1303
+ "scope": 2400,
1304
+ "src": "1067:51:7",
1305
+ "stateVariable": false,
1306
+ "storageLocation": "memory",
1307
+ "typeDescriptions": {
1308
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
1309
+ "typeString": "struct BorrowableObject.Borrowable"
1310
+ },
1311
+ "typeName": {
1312
+ "contractScope": null,
1313
+ "id": 2370,
1314
+ "name": "BorrowableObject.Borrowable",
1315
+ "nodeType": "UserDefinedTypeName",
1316
+ "referencedDeclaration": 4259,
1317
+ "src": "1067:27:7",
1318
+ "typeDescriptions": {
1319
+ "typeIdentifier": "t_struct$_Borrowable_$4259_storage_ptr",
1320
+ "typeString": "struct BorrowableObject.Borrowable"
1321
+ }
1322
+ },
1323
+ "value": null,
1324
+ "visibility": "internal"
1325
+ }
1326
+ ],
1327
+ "id": 2379,
1328
+ "initialValue": {
1329
+ "argumentTypes": null,
1330
+ "arguments": [
1331
+ {
1332
+ "argumentTypes": null,
1333
+ "arguments": [
1334
+ {
1335
+ "argumentTypes": null,
1336
+ "id": 2375,
1337
+ "name": "borrowable",
1338
+ "nodeType": "Identifier",
1339
+ "overloadedDeclarations": [],
1340
+ "referencedDeclaration": 2360,
1341
+ "src": "1164:10:7",
1342
+ "typeDescriptions": {
1343
+ "typeIdentifier": "t_address",
1344
+ "typeString": "address"
1345
+ }
1346
+ }
1347
+ ],
1348
+ "expression": {
1349
+ "argumentTypes": [
1350
+ {
1351
+ "typeIdentifier": "t_address",
1352
+ "typeString": "address"
1353
+ }
1354
+ ],
1355
+ "id": 2374,
1356
+ "name": "IBorrowable",
1357
+ "nodeType": "Identifier",
1358
+ "overloadedDeclarations": [],
1359
+ "referencedDeclaration": 3205,
1360
+ "src": "1152:11:7",
1361
+ "typeDescriptions": {
1362
+ "typeIdentifier": "t_type$_t_contract$_IBorrowable_$3205_$",
1363
+ "typeString": "type(contract IBorrowable)"
1364
+ }
1365
+ },
1366
+ "id": 2376,
1367
+ "isConstant": false,
1368
+ "isLValue": false,
1369
+ "isPure": false,
1370
+ "kind": "typeConversion",
1371
+ "lValueRequested": false,
1372
+ "names": [],
1373
+ "nodeType": "FunctionCall",
1374
+ "src": "1152:23:7",
1375
+ "typeDescriptions": {
1376
+ "typeIdentifier": "t_contract$_IBorrowable_$3205",
1377
+ "typeString": "contract IBorrowable"
1378
+ }
1379
+ },
1380
+ {
1381
+ "argumentTypes": null,
1382
+ "id": 2377,
1383
+ "name": "vault",
1384
+ "nodeType": "Identifier",
1385
+ "overloadedDeclarations": [],
1386
+ "referencedDeclaration": 2330,
1387
+ "src": "1177:5:7",
1388
+ "typeDescriptions": {
1389
+ "typeIdentifier": "t_address",
1390
+ "typeString": "address"
1391
+ }
1392
+ }
1393
+ ],
1394
+ "expression": {
1395
+ "argumentTypes": [
1396
+ {
1397
+ "typeIdentifier": "t_contract$_IBorrowable_$3205",
1398
+ "typeString": "contract IBorrowable"
1399
+ },
1400
+ {
1401
+ "typeIdentifier": "t_address",
1402
+ "typeString": "address"
1403
+ }
1404
+ ],
1405
+ "expression": {
1406
+ "argumentTypes": null,
1407
+ "id": 2372,
1408
+ "name": "BorrowableObject",
1409
+ "nodeType": "Identifier",
1410
+ "overloadedDeclarations": [],
1411
+ "referencedDeclaration": 4759,
1412
+ "src": "1121:16:7",
1413
+ "typeDescriptions": {
1414
+ "typeIdentifier": "t_type$_t_contract$_BorrowableObject_$4759_$",
1415
+ "typeString": "type(library BorrowableObject)"
1416
+ }
1417
+ },
1418
+ "id": 2373,
1419
+ "isConstant": false,
1420
+ "isLValue": false,
1421
+ "isPure": false,
1422
+ "lValueRequested": false,
1423
+ "memberName": "newBorrowable",
1424
+ "nodeType": "MemberAccess",
1425
+ "referencedDeclaration": 4354,
1426
+ "src": "1121:30:7",
1427
+ "typeDescriptions": {
1428
+ "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IBorrowable_$3205_$_t_address_$returns$_t_struct$_Borrowable_$4259_memory_ptr_$",
1429
+ "typeString": "function (contract IBorrowable,address) returns (struct BorrowableObject.Borrowable memory)"
1430
+ }
1431
+ },
1432
+ "id": 2378,
1433
+ "isConstant": false,
1434
+ "isLValue": false,
1435
+ "isPure": false,
1436
+ "kind": "functionCall",
1437
+ "lValueRequested": false,
1438
+ "names": [],
1439
+ "nodeType": "FunctionCall",
1440
+ "src": "1121:62:7",
1441
+ "typeDescriptions": {
1442
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
1443
+ "typeString": "struct BorrowableObject.Borrowable memory"
1444
+ }
1445
+ },
1446
+ "nodeType": "VariableDeclarationStatement",
1447
+ "src": "1067:116:7"
1448
+ },
1449
+ {
1450
+ "assignments": [
1451
+ 2381
1452
+ ],
1453
+ "declarations": [
1454
+ {
1455
+ "constant": false,
1456
+ "id": 2381,
1457
+ "name": "borrowableRate",
1458
+ "nodeType": "VariableDeclaration",
1459
+ "scope": 2400,
1460
+ "src": "1189:19:7",
1461
+ "stateVariable": false,
1462
+ "storageLocation": "default",
1463
+ "typeDescriptions": {
1464
+ "typeIdentifier": "t_uint256",
1465
+ "typeString": "uint256"
1466
+ },
1467
+ "typeName": {
1468
+ "id": 2380,
1469
+ "name": "uint",
1470
+ "nodeType": "ElementaryTypeName",
1471
+ "src": "1189:4:7",
1472
+ "typeDescriptions": {
1473
+ "typeIdentifier": "t_uint256",
1474
+ "typeString": "uint256"
1475
+ }
1476
+ },
1477
+ "value": null,
1478
+ "visibility": "internal"
1479
+ }
1480
+ ],
1481
+ "id": 2384,
1482
+ "initialValue": {
1483
+ "argumentTypes": null,
1484
+ "expression": {
1485
+ "argumentTypes": null,
1486
+ "id": 2382,
1487
+ "name": "borrowableObject",
1488
+ "nodeType": "Identifier",
1489
+ "overloadedDeclarations": [],
1490
+ "referencedDeclaration": 2371,
1491
+ "src": "1211:16:7",
1492
+ "typeDescriptions": {
1493
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
1494
+ "typeString": "struct BorrowableObject.Borrowable memory"
1495
+ }
1496
+ },
1497
+ "id": 2383,
1498
+ "isConstant": false,
1499
+ "isLValue": true,
1500
+ "isPure": false,
1501
+ "lValueRequested": false,
1502
+ "memberName": "cachedSupplyRate",
1503
+ "nodeType": "MemberAccess",
1504
+ "referencedDeclaration": 4258,
1505
+ "src": "1211:33:7",
1506
+ "typeDescriptions": {
1507
+ "typeIdentifier": "t_uint256",
1508
+ "typeString": "uint256"
1509
+ }
1510
+ },
1511
+ "nodeType": "VariableDeclarationStatement",
1512
+ "src": "1189:55:7"
1513
+ },
1514
+ {
1515
+ "assignments": [
1516
+ 2386
1517
+ ],
1518
+ "declarations": [
1519
+ {
1520
+ "constant": false,
1521
+ "id": 2386,
1522
+ "name": "suppliedAmount",
1523
+ "nodeType": "VariableDeclaration",
1524
+ "scope": 2400,
1525
+ "src": "1250:19:7",
1526
+ "stateVariable": false,
1527
+ "storageLocation": "default",
1528
+ "typeDescriptions": {
1529
+ "typeIdentifier": "t_uint256",
1530
+ "typeString": "uint256"
1531
+ },
1532
+ "typeName": {
1533
+ "id": 2385,
1534
+ "name": "uint",
1535
+ "nodeType": "ElementaryTypeName",
1536
+ "src": "1250:4:7",
1537
+ "typeDescriptions": {
1538
+ "typeIdentifier": "t_uint256",
1539
+ "typeString": "uint256"
1540
+ }
1541
+ },
1542
+ "value": null,
1543
+ "visibility": "internal"
1544
+ }
1545
+ ],
1546
+ "id": 2389,
1547
+ "initialValue": {
1548
+ "argumentTypes": null,
1549
+ "expression": {
1550
+ "argumentTypes": null,
1551
+ "id": 2387,
1552
+ "name": "borrowableObject",
1553
+ "nodeType": "Identifier",
1554
+ "overloadedDeclarations": [],
1555
+ "referencedDeclaration": 2371,
1556
+ "src": "1272:16:7",
1557
+ "typeDescriptions": {
1558
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
1559
+ "typeString": "struct BorrowableObject.Borrowable memory"
1560
+ }
1561
+ },
1562
+ "id": 2388,
1563
+ "isConstant": false,
1564
+ "isLValue": true,
1565
+ "isPure": false,
1566
+ "lValueRequested": false,
1567
+ "memberName": "ownedSupply",
1568
+ "nodeType": "MemberAccess",
1569
+ "referencedDeclaration": 4248,
1570
+ "src": "1272:28:7",
1571
+ "typeDescriptions": {
1572
+ "typeIdentifier": "t_uint256",
1573
+ "typeString": "uint256"
1574
+ }
1575
+ },
1576
+ "nodeType": "VariableDeclarationStatement",
1577
+ "src": "1250:50:7"
1578
+ },
1579
+ {
1580
+ "expression": {
1581
+ "argumentTypes": null,
1582
+ "id": 2392,
1583
+ "isConstant": false,
1584
+ "isLValue": false,
1585
+ "isPure": false,
1586
+ "lValueRequested": false,
1587
+ "leftHandSide": {
1588
+ "argumentTypes": null,
1589
+ "id": 2390,
1590
+ "name": "totalSuppliedAmount",
1591
+ "nodeType": "Identifier",
1592
+ "overloadedDeclarations": [],
1593
+ "referencedDeclaration": 2344,
1594
+ "src": "1306:19:7",
1595
+ "typeDescriptions": {
1596
+ "typeIdentifier": "t_uint256",
1597
+ "typeString": "uint256"
1598
+ }
1599
+ },
1600
+ "nodeType": "Assignment",
1601
+ "operator": "+=",
1602
+ "rightHandSide": {
1603
+ "argumentTypes": null,
1604
+ "id": 2391,
1605
+ "name": "suppliedAmount",
1606
+ "nodeType": "Identifier",
1607
+ "overloadedDeclarations": [],
1608
+ "referencedDeclaration": 2386,
1609
+ "src": "1329:14:7",
1610
+ "typeDescriptions": {
1611
+ "typeIdentifier": "t_uint256",
1612
+ "typeString": "uint256"
1613
+ }
1614
+ },
1615
+ "src": "1306:37:7",
1616
+ "typeDescriptions": {
1617
+ "typeIdentifier": "t_uint256",
1618
+ "typeString": "uint256"
1619
+ }
1620
+ },
1621
+ "id": 2393,
1622
+ "nodeType": "ExpressionStatement",
1623
+ "src": "1306:37:7"
1624
+ },
1625
+ {
1626
+ "expression": {
1627
+ "argumentTypes": null,
1628
+ "id": 2398,
1629
+ "isConstant": false,
1630
+ "isLValue": false,
1631
+ "isPure": false,
1632
+ "lValueRequested": false,
1633
+ "leftHandSide": {
1634
+ "argumentTypes": null,
1635
+ "id": 2394,
1636
+ "name": "totalProfitsPerSecond",
1637
+ "nodeType": "Identifier",
1638
+ "overloadedDeclarations": [],
1639
+ "referencedDeclaration": 2347,
1640
+ "src": "1349:21:7",
1641
+ "typeDescriptions": {
1642
+ "typeIdentifier": "t_uint256",
1643
+ "typeString": "uint256"
1644
+ }
1645
+ },
1646
+ "nodeType": "Assignment",
1647
+ "operator": "+=",
1648
+ "rightHandSide": {
1649
+ "argumentTypes": null,
1650
+ "commonType": {
1651
+ "typeIdentifier": "t_uint256",
1652
+ "typeString": "uint256"
1653
+ },
1654
+ "id": 2397,
1655
+ "isConstant": false,
1656
+ "isLValue": false,
1657
+ "isPure": false,
1658
+ "lValueRequested": false,
1659
+ "leftExpression": {
1660
+ "argumentTypes": null,
1661
+ "id": 2395,
1662
+ "name": "borrowableRate",
1663
+ "nodeType": "Identifier",
1664
+ "overloadedDeclarations": [],
1665
+ "referencedDeclaration": 2381,
1666
+ "src": "1374:14:7",
1667
+ "typeDescriptions": {
1668
+ "typeIdentifier": "t_uint256",
1669
+ "typeString": "uint256"
1670
+ }
1671
+ },
1672
+ "nodeType": "BinaryOperation",
1673
+ "operator": "*",
1674
+ "rightExpression": {
1675
+ "argumentTypes": null,
1676
+ "id": 2396,
1677
+ "name": "suppliedAmount",
1678
+ "nodeType": "Identifier",
1679
+ "overloadedDeclarations": [],
1680
+ "referencedDeclaration": 2386,
1681
+ "src": "1391:14:7",
1682
+ "typeDescriptions": {
1683
+ "typeIdentifier": "t_uint256",
1684
+ "typeString": "uint256"
1685
+ }
1686
+ },
1687
+ "src": "1374:31:7",
1688
+ "typeDescriptions": {
1689
+ "typeIdentifier": "t_uint256",
1690
+ "typeString": "uint256"
1691
+ }
1692
+ },
1693
+ "src": "1349:56:7",
1694
+ "typeDescriptions": {
1695
+ "typeIdentifier": "t_uint256",
1696
+ "typeString": "uint256"
1697
+ }
1698
+ },
1699
+ "id": 2399,
1700
+ "nodeType": "ExpressionStatement",
1701
+ "src": "1349:56:7"
1702
+ }
1703
+ ]
1704
+ },
1705
+ "condition": {
1706
+ "argumentTypes": null,
1707
+ "commonType": {
1708
+ "typeIdentifier": "t_uint256",
1709
+ "typeString": "uint256"
1710
+ },
1711
+ "id": 2355,
1712
+ "isConstant": false,
1713
+ "isLValue": false,
1714
+ "isPure": false,
1715
+ "lValueRequested": false,
1716
+ "leftExpression": {
1717
+ "argumentTypes": null,
1718
+ "id": 2353,
1719
+ "name": "i",
1720
+ "nodeType": "Identifier",
1721
+ "overloadedDeclarations": [],
1722
+ "referencedDeclaration": 2350,
1723
+ "src": "969:1:7",
1724
+ "typeDescriptions": {
1725
+ "typeIdentifier": "t_uint256",
1726
+ "typeString": "uint256"
1727
+ }
1728
+ },
1729
+ "nodeType": "BinaryOperation",
1730
+ "operator": "<",
1731
+ "rightExpression": {
1732
+ "argumentTypes": null,
1733
+ "id": 2354,
1734
+ "name": "borrowablesLength",
1735
+ "nodeType": "Identifier",
1736
+ "overloadedDeclarations": [],
1737
+ "referencedDeclaration": 2336,
1738
+ "src": "973:17:7",
1739
+ "typeDescriptions": {
1740
+ "typeIdentifier": "t_uint256",
1741
+ "typeString": "uint256"
1742
+ }
1743
+ },
1744
+ "src": "969:21:7",
1745
+ "typeDescriptions": {
1746
+ "typeIdentifier": "t_bool",
1747
+ "typeString": "bool"
1748
+ }
1749
+ },
1750
+ "id": 2401,
1751
+ "initializationExpression": {
1752
+ "assignments": [
1753
+ 2350
1754
+ ],
1755
+ "declarations": [
1756
+ {
1757
+ "constant": false,
1758
+ "id": 2350,
1759
+ "name": "i",
1760
+ "nodeType": "VariableDeclaration",
1761
+ "scope": 2401,
1762
+ "src": "957:6:7",
1763
+ "stateVariable": false,
1764
+ "storageLocation": "default",
1765
+ "typeDescriptions": {
1766
+ "typeIdentifier": "t_uint256",
1767
+ "typeString": "uint256"
1768
+ },
1769
+ "typeName": {
1770
+ "id": 2349,
1771
+ "name": "uint",
1772
+ "nodeType": "ElementaryTypeName",
1773
+ "src": "957:4:7",
1774
+ "typeDescriptions": {
1775
+ "typeIdentifier": "t_uint256",
1776
+ "typeString": "uint256"
1777
+ }
1778
+ },
1779
+ "value": null,
1780
+ "visibility": "internal"
1781
+ }
1782
+ ],
1783
+ "id": 2352,
1784
+ "initialValue": {
1785
+ "argumentTypes": null,
1786
+ "hexValue": "30",
1787
+ "id": 2351,
1788
+ "isConstant": false,
1789
+ "isLValue": false,
1790
+ "isPure": true,
1791
+ "kind": "number",
1792
+ "lValueRequested": false,
1793
+ "nodeType": "Literal",
1794
+ "src": "966:1:7",
1795
+ "subdenomination": null,
1796
+ "typeDescriptions": {
1797
+ "typeIdentifier": "t_rational_0_by_1",
1798
+ "typeString": "int_const 0"
1799
+ },
1800
+ "value": "0"
1801
+ },
1802
+ "nodeType": "VariableDeclarationStatement",
1803
+ "src": "957:10:7"
1804
+ },
1805
+ "loopExpression": {
1806
+ "expression": {
1807
+ "argumentTypes": null,
1808
+ "id": 2357,
1809
+ "isConstant": false,
1810
+ "isLValue": false,
1811
+ "isPure": false,
1812
+ "lValueRequested": false,
1813
+ "nodeType": "UnaryOperation",
1814
+ "operator": "++",
1815
+ "prefix": false,
1816
+ "src": "992:3:7",
1817
+ "subExpression": {
1818
+ "argumentTypes": null,
1819
+ "id": 2356,
1820
+ "name": "i",
1821
+ "nodeType": "Identifier",
1822
+ "overloadedDeclarations": [],
1823
+ "referencedDeclaration": 2350,
1824
+ "src": "992:1:7",
1825
+ "typeDescriptions": {
1826
+ "typeIdentifier": "t_uint256",
1827
+ "typeString": "uint256"
1828
+ }
1829
+ },
1830
+ "typeDescriptions": {
1831
+ "typeIdentifier": "t_uint256",
1832
+ "typeString": "uint256"
1833
+ }
1834
+ },
1835
+ "id": 2358,
1836
+ "nodeType": "ExpressionStatement",
1837
+ "src": "992:3:7"
1838
+ },
1839
+ "nodeType": "ForStatement",
1840
+ "src": "952:459:7"
1841
+ },
1842
+ {
1843
+ "expression": {
1844
+ "argumentTypes": null,
1845
+ "commonType": {
1846
+ "typeIdentifier": "t_uint256",
1847
+ "typeString": "uint256"
1848
+ },
1849
+ "id": 2404,
1850
+ "isConstant": false,
1851
+ "isLValue": false,
1852
+ "isPure": false,
1853
+ "lValueRequested": false,
1854
+ "leftExpression": {
1855
+ "argumentTypes": null,
1856
+ "id": 2402,
1857
+ "name": "totalProfitsPerSecond",
1858
+ "nodeType": "Identifier",
1859
+ "overloadedDeclarations": [],
1860
+ "referencedDeclaration": 2347,
1861
+ "src": "1422:21:7",
1862
+ "typeDescriptions": {
1863
+ "typeIdentifier": "t_uint256",
1864
+ "typeString": "uint256"
1865
+ }
1866
+ },
1867
+ "nodeType": "BinaryOperation",
1868
+ "operator": "/",
1869
+ "rightExpression": {
1870
+ "argumentTypes": null,
1871
+ "id": 2403,
1872
+ "name": "totalSuppliedAmount",
1873
+ "nodeType": "Identifier",
1874
+ "overloadedDeclarations": [],
1875
+ "referencedDeclaration": 2344,
1876
+ "src": "1446:19:7",
1877
+ "typeDescriptions": {
1878
+ "typeIdentifier": "t_uint256",
1879
+ "typeString": "uint256"
1880
+ }
1881
+ },
1882
+ "src": "1422:43:7",
1883
+ "typeDescriptions": {
1884
+ "typeIdentifier": "t_uint256",
1885
+ "typeString": "uint256"
1886
+ }
1887
+ },
1888
+ "functionReturnParameters": 2334,
1889
+ "id": 2405,
1890
+ "nodeType": "Return",
1891
+ "src": "1415:50:7"
1892
+ }
1893
+ ]
1894
+ },
1895
+ "documentation": null,
1896
+ "id": 2407,
1897
+ "implemented": true,
1898
+ "kind": "function",
1899
+ "modifiers": [],
1900
+ "name": "getSupplyRate",
1901
+ "nodeType": "FunctionDefinition",
1902
+ "parameters": {
1903
+ "id": 2331,
1904
+ "nodeType": "ParameterList",
1905
+ "parameters": [
1906
+ {
1907
+ "constant": false,
1908
+ "id": 2330,
1909
+ "name": "vault",
1910
+ "nodeType": "VariableDeclaration",
1911
+ "scope": 2407,
1912
+ "src": "762:13:7",
1913
+ "stateVariable": false,
1914
+ "storageLocation": "default",
1915
+ "typeDescriptions": {
1916
+ "typeIdentifier": "t_address",
1917
+ "typeString": "address"
1918
+ },
1919
+ "typeName": {
1920
+ "id": 2329,
1921
+ "name": "address",
1922
+ "nodeType": "ElementaryTypeName",
1923
+ "src": "762:7:7",
1924
+ "stateMutability": "nonpayable",
1925
+ "typeDescriptions": {
1926
+ "typeIdentifier": "t_address",
1927
+ "typeString": "address"
1928
+ }
1929
+ },
1930
+ "value": null,
1931
+ "visibility": "internal"
1932
+ }
1933
+ ],
1934
+ "src": "761:15:7"
1935
+ },
1936
+ "returnParameters": {
1937
+ "id": 2334,
1938
+ "nodeType": "ParameterList",
1939
+ "parameters": [
1940
+ {
1941
+ "constant": false,
1942
+ "id": 2333,
1943
+ "name": "supplyRate",
1944
+ "nodeType": "VariableDeclaration",
1945
+ "scope": 2407,
1946
+ "src": "795:15:7",
1947
+ "stateVariable": false,
1948
+ "storageLocation": "default",
1949
+ "typeDescriptions": {
1950
+ "typeIdentifier": "t_uint256",
1951
+ "typeString": "uint256"
1952
+ },
1953
+ "typeName": {
1954
+ "id": 2332,
1955
+ "name": "uint",
1956
+ "nodeType": "ElementaryTypeName",
1957
+ "src": "795:4:7",
1958
+ "typeDescriptions": {
1959
+ "typeIdentifier": "t_uint256",
1960
+ "typeString": "uint256"
1961
+ }
1962
+ },
1963
+ "value": null,
1964
+ "visibility": "internal"
1965
+ }
1966
+ ],
1967
+ "src": "794:17:7"
1968
+ },
1969
+ "scope": 2416,
1970
+ "src": "739:731:7",
1971
+ "stateMutability": "nonpayable",
1972
+ "superFunction": null,
1973
+ "visibility": "external"
1974
+ },
1975
+ {
1976
+ "body": {
1977
+ "id": 2414,
1978
+ "nodeType": "Block",
1979
+ "src": "1557:16:7",
1980
+ "statements": []
1981
+ },
1982
+ "documentation": null,
1983
+ "id": 2415,
1984
+ "implemented": true,
1985
+ "kind": "function",
1986
+ "modifiers": [],
1987
+ "name": "getOptimizedSupplyRate",
1988
+ "nodeType": "FunctionDefinition",
1989
+ "parameters": {
1990
+ "id": 2410,
1991
+ "nodeType": "ParameterList",
1992
+ "parameters": [
1993
+ {
1994
+ "constant": false,
1995
+ "id": 2409,
1996
+ "name": "vault",
1997
+ "nodeType": "VariableDeclaration",
1998
+ "scope": 2415,
1999
+ "src": "1507:13:7",
2000
+ "stateVariable": false,
2001
+ "storageLocation": "default",
2002
+ "typeDescriptions": {
2003
+ "typeIdentifier": "t_address",
2004
+ "typeString": "address"
2005
+ },
2006
+ "typeName": {
2007
+ "id": 2408,
2008
+ "name": "address",
2009
+ "nodeType": "ElementaryTypeName",
2010
+ "src": "1507:7:7",
2011
+ "stateMutability": "nonpayable",
2012
+ "typeDescriptions": {
2013
+ "typeIdentifier": "t_address",
2014
+ "typeString": "address"
2015
+ }
2016
+ },
2017
+ "value": null,
2018
+ "visibility": "internal"
2019
+ }
2020
+ ],
2021
+ "src": "1506:15:7"
2022
+ },
2023
+ "returnParameters": {
2024
+ "id": 2413,
2025
+ "nodeType": "ParameterList",
2026
+ "parameters": [
2027
+ {
2028
+ "constant": false,
2029
+ "id": 2412,
2030
+ "name": "supplyRate",
2031
+ "nodeType": "VariableDeclaration",
2032
+ "scope": 2415,
2033
+ "src": "1540:15:7",
2034
+ "stateVariable": false,
2035
+ "storageLocation": "default",
2036
+ "typeDescriptions": {
2037
+ "typeIdentifier": "t_uint256",
2038
+ "typeString": "uint256"
2039
+ },
2040
+ "typeName": {
2041
+ "id": 2411,
2042
+ "name": "uint",
2043
+ "nodeType": "ElementaryTypeName",
2044
+ "src": "1540:4:7",
2045
+ "typeDescriptions": {
2046
+ "typeIdentifier": "t_uint256",
2047
+ "typeString": "uint256"
2048
+ }
2049
+ },
2050
+ "value": null,
2051
+ "visibility": "internal"
2052
+ }
2053
+ ],
2054
+ "src": "1539:17:7"
2055
+ },
2056
+ "scope": 2416,
2057
+ "src": "1475:98:7",
2058
+ "stateMutability": "nonpayable",
2059
+ "superFunction": null,
2060
+ "visibility": "external"
2061
+ }
2062
+ ],
2063
+ "scope": 2417,
2064
+ "src": "189:1387:7"
2065
+ }
2066
+ ],
2067
+ "src": "0:1576:7"
2068
+ },
2069
+ "legacyAST": {
2070
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/LendingVaultWatcher01.sol",
2071
+ "exportedSymbols": {
2072
+ "LendingVaultWatcher01": [
2073
+ 2416
2074
+ ]
2075
+ },
2076
+ "id": 2417,
2077
+ "nodeType": "SourceUnit",
2078
+ "nodes": [
2079
+ {
2080
+ "id": 2264,
2081
+ "literals": [
2082
+ "solidity",
2083
+ "=",
2084
+ "0.5",
2085
+ ".16"
2086
+ ],
2087
+ "nodeType": "PragmaDirective",
2088
+ "src": "0:24:7"
2089
+ },
2090
+ {
2091
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/interfaces/ILendingVaultV1.sol",
2092
+ "file": "./interfaces/ILendingVaultV1.sol",
2093
+ "id": 2265,
2094
+ "nodeType": "ImportDirective",
2095
+ "scope": 2417,
2096
+ "sourceUnit": 3619,
2097
+ "src": "28:42:7",
2098
+ "symbolAliases": [],
2099
+ "unitAlias": ""
2100
+ },
2101
+ {
2102
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/interfaces/IERC20.sol",
2103
+ "file": "./interfaces/IERC20.sol",
2104
+ "id": 2266,
2105
+ "nodeType": "ImportDirective",
2106
+ "scope": 2417,
2107
+ "sourceUnit": 3290,
2108
+ "src": "72:33:7",
2109
+ "symbolAliases": [],
2110
+ "unitAlias": ""
2111
+ },
2112
+ {
2113
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/libraries/SafeMath.sol",
2114
+ "file": "./libraries/SafeMath.sol",
2115
+ "id": 2267,
2116
+ "nodeType": "ImportDirective",
2117
+ "scope": 2417,
2118
+ "sourceUnit": 5086,
2119
+ "src": "107:34:7",
2120
+ "symbolAliases": [],
2121
+ "unitAlias": ""
2122
+ },
2123
+ {
2124
+ "absolutePath": "/C/Users/simor/Desktop/lending-vault/contracts/libraries/BorrowableObject.sol",
2125
+ "file": "./libraries/BorrowableObject.sol",
2126
+ "id": 2268,
2127
+ "nodeType": "ImportDirective",
2128
+ "scope": 2417,
2129
+ "sourceUnit": 4760,
2130
+ "src": "143:42:7",
2131
+ "symbolAliases": [],
2132
+ "unitAlias": ""
2133
+ },
2134
+ {
2135
+ "baseContracts": [],
2136
+ "contractDependencies": [],
2137
+ "contractKind": "contract",
2138
+ "documentation": null,
2139
+ "fullyImplemented": true,
2140
+ "id": 2416,
2141
+ "linearizedBaseContracts": [
2142
+ 2416
2143
+ ],
2144
+ "name": "LendingVaultWatcher01",
2145
+ "nodeType": "ContractDefinition",
2146
+ "nodes": [
2147
+ {
2148
+ "id": 2271,
2149
+ "libraryName": {
2150
+ "contractScope": null,
2151
+ "id": 2269,
2152
+ "name": "SafeMath",
2153
+ "nodeType": "UserDefinedTypeName",
2154
+ "referencedDeclaration": 5085,
2155
+ "src": "231:8:7",
2156
+ "typeDescriptions": {
2157
+ "typeIdentifier": "t_contract$_SafeMath_$5085",
2158
+ "typeString": "library SafeMath"
2159
+ }
2160
+ },
2161
+ "nodeType": "UsingForDirective",
2162
+ "src": "225:24:7",
2163
+ "typeName": {
2164
+ "id": 2270,
2165
+ "name": "uint",
2166
+ "nodeType": "ElementaryTypeName",
2167
+ "src": "244:4:7",
2168
+ "typeDescriptions": {
2169
+ "typeIdentifier": "t_uint256",
2170
+ "typeString": "uint256"
2171
+ }
2172
+ }
2173
+ },
2174
+ {
2175
+ "id": 2274,
2176
+ "libraryName": {
2177
+ "contractScope": null,
2178
+ "id": 2272,
2179
+ "name": "BorrowableObject",
2180
+ "nodeType": "UserDefinedTypeName",
2181
+ "referencedDeclaration": 4759,
2182
+ "src": "258:16:7",
2183
+ "typeDescriptions": {
2184
+ "typeIdentifier": "t_contract$_BorrowableObject_$4759",
2185
+ "typeString": "library BorrowableObject"
2186
+ }
2187
+ },
2188
+ "nodeType": "UsingForDirective",
2189
+ "src": "252:55:7",
2190
+ "typeName": {
2191
+ "contractScope": null,
2192
+ "id": 2273,
2193
+ "name": "BorrowableObject.Borrowable",
2194
+ "nodeType": "UserDefinedTypeName",
2195
+ "referencedDeclaration": 4259,
2196
+ "src": "279:27:7",
2197
+ "typeDescriptions": {
2198
+ "typeIdentifier": "t_struct$_Borrowable_$4259_storage_ptr",
2199
+ "typeString": "struct BorrowableObject.Borrowable"
2200
+ }
2201
+ }
2202
+ },
2203
+ {
2204
+ "body": {
2205
+ "id": 2327,
2206
+ "nodeType": "Block",
2207
+ "src": "406:328:7",
2208
+ "statements": [
2209
+ {
2210
+ "assignments": [
2211
+ 2282
2212
+ ],
2213
+ "declarations": [
2214
+ {
2215
+ "constant": false,
2216
+ "id": 2282,
2217
+ "name": "borrowablesLength",
2218
+ "nodeType": "VariableDeclaration",
2219
+ "scope": 2327,
2220
+ "src": "411:22:7",
2221
+ "stateVariable": false,
2222
+ "storageLocation": "default",
2223
+ "typeDescriptions": {
2224
+ "typeIdentifier": "t_uint256",
2225
+ "typeString": "uint256"
2226
+ },
2227
+ "typeName": {
2228
+ "id": 2281,
2229
+ "name": "uint",
2230
+ "nodeType": "ElementaryTypeName",
2231
+ "src": "411:4:7",
2232
+ "typeDescriptions": {
2233
+ "typeIdentifier": "t_uint256",
2234
+ "typeString": "uint256"
2235
+ }
2236
+ },
2237
+ "value": null,
2238
+ "visibility": "internal"
2239
+ }
2240
+ ],
2241
+ "id": 2288,
2242
+ "initialValue": {
2243
+ "argumentTypes": null,
2244
+ "arguments": [],
2245
+ "expression": {
2246
+ "argumentTypes": [],
2247
+ "expression": {
2248
+ "argumentTypes": null,
2249
+ "arguments": [
2250
+ {
2251
+ "argumentTypes": null,
2252
+ "id": 2284,
2253
+ "name": "vault",
2254
+ "nodeType": "Identifier",
2255
+ "overloadedDeclarations": [],
2256
+ "referencedDeclaration": 2276,
2257
+ "src": "452:5:7",
2258
+ "typeDescriptions": {
2259
+ "typeIdentifier": "t_address",
2260
+ "typeString": "address"
2261
+ }
2262
+ }
2263
+ ],
2264
+ "expression": {
2265
+ "argumentTypes": [
2266
+ {
2267
+ "typeIdentifier": "t_address",
2268
+ "typeString": "address"
2269
+ }
2270
+ ],
2271
+ "id": 2283,
2272
+ "name": "ILendingVaultV1",
2273
+ "nodeType": "Identifier",
2274
+ "overloadedDeclarations": [],
2275
+ "referencedDeclaration": 3618,
2276
+ "src": "436:15:7",
2277
+ "typeDescriptions": {
2278
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
2279
+ "typeString": "type(contract ILendingVaultV1)"
2280
+ }
2281
+ },
2282
+ "id": 2285,
2283
+ "isConstant": false,
2284
+ "isLValue": false,
2285
+ "isPure": false,
2286
+ "kind": "typeConversion",
2287
+ "lValueRequested": false,
2288
+ "names": [],
2289
+ "nodeType": "FunctionCall",
2290
+ "src": "436:22:7",
2291
+ "typeDescriptions": {
2292
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
2293
+ "typeString": "contract ILendingVaultV1"
2294
+ }
2295
+ },
2296
+ "id": 2286,
2297
+ "isConstant": false,
2298
+ "isLValue": false,
2299
+ "isPure": false,
2300
+ "lValueRequested": false,
2301
+ "memberName": "getBorrowablesLength",
2302
+ "nodeType": "MemberAccess",
2303
+ "referencedDeclaration": 3549,
2304
+ "src": "436:43:7",
2305
+ "typeDescriptions": {
2306
+ "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
2307
+ "typeString": "function () view external returns (uint256)"
2308
+ }
2309
+ },
2310
+ "id": 2287,
2311
+ "isConstant": false,
2312
+ "isLValue": false,
2313
+ "isPure": false,
2314
+ "kind": "functionCall",
2315
+ "lValueRequested": false,
2316
+ "names": [],
2317
+ "nodeType": "FunctionCall",
2318
+ "src": "436:45:7",
2319
+ "typeDescriptions": {
2320
+ "typeIdentifier": "t_uint256",
2321
+ "typeString": "uint256"
2322
+ }
2323
+ },
2324
+ "nodeType": "VariableDeclarationStatement",
2325
+ "src": "411:70:7"
2326
+ },
2327
+ {
2328
+ "assignments": [
2329
+ 2290
2330
+ ],
2331
+ "declarations": [
2332
+ {
2333
+ "constant": false,
2334
+ "id": 2290,
2335
+ "name": "underlying",
2336
+ "nodeType": "VariableDeclaration",
2337
+ "scope": 2327,
2338
+ "src": "486:18:7",
2339
+ "stateVariable": false,
2340
+ "storageLocation": "default",
2341
+ "typeDescriptions": {
2342
+ "typeIdentifier": "t_address",
2343
+ "typeString": "address"
2344
+ },
2345
+ "typeName": {
2346
+ "id": 2289,
2347
+ "name": "address",
2348
+ "nodeType": "ElementaryTypeName",
2349
+ "src": "486:7:7",
2350
+ "stateMutability": "nonpayable",
2351
+ "typeDescriptions": {
2352
+ "typeIdentifier": "t_address",
2353
+ "typeString": "address"
2354
+ }
2355
+ },
2356
+ "value": null,
2357
+ "visibility": "internal"
2358
+ }
2359
+ ],
2360
+ "id": 2296,
2361
+ "initialValue": {
2362
+ "argumentTypes": null,
2363
+ "arguments": [],
2364
+ "expression": {
2365
+ "argumentTypes": [],
2366
+ "expression": {
2367
+ "argumentTypes": null,
2368
+ "arguments": [
2369
+ {
2370
+ "argumentTypes": null,
2371
+ "id": 2292,
2372
+ "name": "vault",
2373
+ "nodeType": "Identifier",
2374
+ "overloadedDeclarations": [],
2375
+ "referencedDeclaration": 2276,
2376
+ "src": "523:5:7",
2377
+ "typeDescriptions": {
2378
+ "typeIdentifier": "t_address",
2379
+ "typeString": "address"
2380
+ }
2381
+ }
2382
+ ],
2383
+ "expression": {
2384
+ "argumentTypes": [
2385
+ {
2386
+ "typeIdentifier": "t_address",
2387
+ "typeString": "address"
2388
+ }
2389
+ ],
2390
+ "id": 2291,
2391
+ "name": "ILendingVaultV1",
2392
+ "nodeType": "Identifier",
2393
+ "overloadedDeclarations": [],
2394
+ "referencedDeclaration": 3618,
2395
+ "src": "507:15:7",
2396
+ "typeDescriptions": {
2397
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
2398
+ "typeString": "type(contract ILendingVaultV1)"
2399
+ }
2400
+ },
2401
+ "id": 2293,
2402
+ "isConstant": false,
2403
+ "isLValue": false,
2404
+ "isPure": false,
2405
+ "kind": "typeConversion",
2406
+ "lValueRequested": false,
2407
+ "names": [],
2408
+ "nodeType": "FunctionCall",
2409
+ "src": "507:22:7",
2410
+ "typeDescriptions": {
2411
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
2412
+ "typeString": "contract ILendingVaultV1"
2413
+ }
2414
+ },
2415
+ "id": 2294,
2416
+ "isConstant": false,
2417
+ "isLValue": false,
2418
+ "isPure": false,
2419
+ "lValueRequested": false,
2420
+ "memberName": "underlying",
2421
+ "nodeType": "MemberAccess",
2422
+ "referencedDeclaration": 3443,
2423
+ "src": "507:33:7",
2424
+ "typeDescriptions": {
2425
+ "typeIdentifier": "t_function_external_view$__$returns$_t_address_$",
2426
+ "typeString": "function () view external returns (address)"
2427
+ }
2428
+ },
2429
+ "id": 2295,
2430
+ "isConstant": false,
2431
+ "isLValue": false,
2432
+ "isPure": false,
2433
+ "kind": "functionCall",
2434
+ "lValueRequested": false,
2435
+ "names": [],
2436
+ "nodeType": "FunctionCall",
2437
+ "src": "507:35:7",
2438
+ "typeDescriptions": {
2439
+ "typeIdentifier": "t_address",
2440
+ "typeString": "address"
2441
+ }
2442
+ },
2443
+ "nodeType": "VariableDeclarationStatement",
2444
+ "src": "486:56:7"
2445
+ },
2446
+ {
2447
+ "body": {
2448
+ "id": 2325,
2449
+ "nodeType": "Block",
2450
+ "src": "592:138:7",
2451
+ "statements": [
2452
+ {
2453
+ "assignments": [
2454
+ 2308
2455
+ ],
2456
+ "declarations": [
2457
+ {
2458
+ "constant": false,
2459
+ "id": 2308,
2460
+ "name": "borrowable",
2461
+ "nodeType": "VariableDeclaration",
2462
+ "scope": 2325,
2463
+ "src": "598:18:7",
2464
+ "stateVariable": false,
2465
+ "storageLocation": "default",
2466
+ "typeDescriptions": {
2467
+ "typeIdentifier": "t_address",
2468
+ "typeString": "address"
2469
+ },
2470
+ "typeName": {
2471
+ "id": 2307,
2472
+ "name": "address",
2473
+ "nodeType": "ElementaryTypeName",
2474
+ "src": "598:7:7",
2475
+ "stateMutability": "nonpayable",
2476
+ "typeDescriptions": {
2477
+ "typeIdentifier": "t_address",
2478
+ "typeString": "address"
2479
+ }
2480
+ },
2481
+ "value": null,
2482
+ "visibility": "internal"
2483
+ }
2484
+ ],
2485
+ "id": 2315,
2486
+ "initialValue": {
2487
+ "argumentTypes": null,
2488
+ "arguments": [
2489
+ {
2490
+ "argumentTypes": null,
2491
+ "id": 2313,
2492
+ "name": "i",
2493
+ "nodeType": "Identifier",
2494
+ "overloadedDeclarations": [],
2495
+ "referencedDeclaration": 2298,
2496
+ "src": "654:1:7",
2497
+ "typeDescriptions": {
2498
+ "typeIdentifier": "t_uint256",
2499
+ "typeString": "uint256"
2500
+ }
2501
+ }
2502
+ ],
2503
+ "expression": {
2504
+ "argumentTypes": [
2505
+ {
2506
+ "typeIdentifier": "t_uint256",
2507
+ "typeString": "uint256"
2508
+ }
2509
+ ],
2510
+ "expression": {
2511
+ "argumentTypes": null,
2512
+ "arguments": [
2513
+ {
2514
+ "argumentTypes": null,
2515
+ "id": 2310,
2516
+ "name": "vault",
2517
+ "nodeType": "Identifier",
2518
+ "overloadedDeclarations": [],
2519
+ "referencedDeclaration": 2276,
2520
+ "src": "635:5:7",
2521
+ "typeDescriptions": {
2522
+ "typeIdentifier": "t_address",
2523
+ "typeString": "address"
2524
+ }
2525
+ }
2526
+ ],
2527
+ "expression": {
2528
+ "argumentTypes": [
2529
+ {
2530
+ "typeIdentifier": "t_address",
2531
+ "typeString": "address"
2532
+ }
2533
+ ],
2534
+ "id": 2309,
2535
+ "name": "ILendingVaultV1",
2536
+ "nodeType": "Identifier",
2537
+ "overloadedDeclarations": [],
2538
+ "referencedDeclaration": 3618,
2539
+ "src": "619:15:7",
2540
+ "typeDescriptions": {
2541
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
2542
+ "typeString": "type(contract ILendingVaultV1)"
2543
+ }
2544
+ },
2545
+ "id": 2311,
2546
+ "isConstant": false,
2547
+ "isLValue": false,
2548
+ "isPure": false,
2549
+ "kind": "typeConversion",
2550
+ "lValueRequested": false,
2551
+ "names": [],
2552
+ "nodeType": "FunctionCall",
2553
+ "src": "619:22:7",
2554
+ "typeDescriptions": {
2555
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
2556
+ "typeString": "contract ILendingVaultV1"
2557
+ }
2558
+ },
2559
+ "id": 2312,
2560
+ "isConstant": false,
2561
+ "isLValue": false,
2562
+ "isPure": false,
2563
+ "lValueRequested": false,
2564
+ "memberName": "borrowables",
2565
+ "nodeType": "MemberAccess",
2566
+ "referencedDeclaration": 3535,
2567
+ "src": "619:34:7",
2568
+ "typeDescriptions": {
2569
+ "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
2570
+ "typeString": "function (uint256) view external returns (address)"
2571
+ }
2572
+ },
2573
+ "id": 2314,
2574
+ "isConstant": false,
2575
+ "isLValue": false,
2576
+ "isPure": false,
2577
+ "kind": "functionCall",
2578
+ "lValueRequested": false,
2579
+ "names": [],
2580
+ "nodeType": "FunctionCall",
2581
+ "src": "619:37:7",
2582
+ "typeDescriptions": {
2583
+ "typeIdentifier": "t_address",
2584
+ "typeString": "address"
2585
+ }
2586
+ },
2587
+ "nodeType": "VariableDeclarationStatement",
2588
+ "src": "598:58:7"
2589
+ },
2590
+ {
2591
+ "expression": {
2592
+ "argumentTypes": null,
2593
+ "id": 2323,
2594
+ "isConstant": false,
2595
+ "isLValue": false,
2596
+ "isPure": false,
2597
+ "lValueRequested": false,
2598
+ "leftHandSide": {
2599
+ "argumentTypes": null,
2600
+ "id": 2316,
2601
+ "name": "availableLiquidity",
2602
+ "nodeType": "Identifier",
2603
+ "overloadedDeclarations": [],
2604
+ "referencedDeclaration": 2279,
2605
+ "src": "662:18:7",
2606
+ "typeDescriptions": {
2607
+ "typeIdentifier": "t_uint256",
2608
+ "typeString": "uint256"
2609
+ }
2610
+ },
2611
+ "nodeType": "Assignment",
2612
+ "operator": "+=",
2613
+ "rightHandSide": {
2614
+ "argumentTypes": null,
2615
+ "arguments": [
2616
+ {
2617
+ "argumentTypes": null,
2618
+ "id": 2321,
2619
+ "name": "borrowable",
2620
+ "nodeType": "Identifier",
2621
+ "overloadedDeclarations": [],
2622
+ "referencedDeclaration": 2308,
2623
+ "src": "713:10:7",
2624
+ "typeDescriptions": {
2625
+ "typeIdentifier": "t_address",
2626
+ "typeString": "address"
2627
+ }
2628
+ }
2629
+ ],
2630
+ "expression": {
2631
+ "argumentTypes": [
2632
+ {
2633
+ "typeIdentifier": "t_address",
2634
+ "typeString": "address"
2635
+ }
2636
+ ],
2637
+ "expression": {
2638
+ "argumentTypes": null,
2639
+ "arguments": [
2640
+ {
2641
+ "argumentTypes": null,
2642
+ "id": 2318,
2643
+ "name": "underlying",
2644
+ "nodeType": "Identifier",
2645
+ "overloadedDeclarations": [],
2646
+ "referencedDeclaration": 2290,
2647
+ "src": "691:10:7",
2648
+ "typeDescriptions": {
2649
+ "typeIdentifier": "t_address",
2650
+ "typeString": "address"
2651
+ }
2652
+ }
2653
+ ],
2654
+ "expression": {
2655
+ "argumentTypes": [
2656
+ {
2657
+ "typeIdentifier": "t_address",
2658
+ "typeString": "address"
2659
+ }
2660
+ ],
2661
+ "id": 2317,
2662
+ "name": "IERC20",
2663
+ "nodeType": "Identifier",
2664
+ "overloadedDeclarations": [],
2665
+ "referencedDeclaration": 3289,
2666
+ "src": "684:6:7",
2667
+ "typeDescriptions": {
2668
+ "typeIdentifier": "t_type$_t_contract$_IERC20_$3289_$",
2669
+ "typeString": "type(contract IERC20)"
2670
+ }
2671
+ },
2672
+ "id": 2319,
2673
+ "isConstant": false,
2674
+ "isLValue": false,
2675
+ "isPure": false,
2676
+ "kind": "typeConversion",
2677
+ "lValueRequested": false,
2678
+ "names": [],
2679
+ "nodeType": "FunctionCall",
2680
+ "src": "684:18:7",
2681
+ "typeDescriptions": {
2682
+ "typeIdentifier": "t_contract$_IERC20_$3289",
2683
+ "typeString": "contract IERC20"
2684
+ }
2685
+ },
2686
+ "id": 2320,
2687
+ "isConstant": false,
2688
+ "isLValue": false,
2689
+ "isPure": false,
2690
+ "lValueRequested": false,
2691
+ "memberName": "balanceOf",
2692
+ "nodeType": "MemberAccess",
2693
+ "referencedDeclaration": 3250,
2694
+ "src": "684:28:7",
2695
+ "typeDescriptions": {
2696
+ "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
2697
+ "typeString": "function (address) view external returns (uint256)"
2698
+ }
2699
+ },
2700
+ "id": 2322,
2701
+ "isConstant": false,
2702
+ "isLValue": false,
2703
+ "isPure": false,
2704
+ "kind": "functionCall",
2705
+ "lValueRequested": false,
2706
+ "names": [],
2707
+ "nodeType": "FunctionCall",
2708
+ "src": "684:40:7",
2709
+ "typeDescriptions": {
2710
+ "typeIdentifier": "t_uint256",
2711
+ "typeString": "uint256"
2712
+ }
2713
+ },
2714
+ "src": "662:62:7",
2715
+ "typeDescriptions": {
2716
+ "typeIdentifier": "t_uint256",
2717
+ "typeString": "uint256"
2718
+ }
2719
+ },
2720
+ "id": 2324,
2721
+ "nodeType": "ExpressionStatement",
2722
+ "src": "662:62:7"
2723
+ }
2724
+ ]
2725
+ },
2726
+ "condition": {
2727
+ "argumentTypes": null,
2728
+ "commonType": {
2729
+ "typeIdentifier": "t_uint256",
2730
+ "typeString": "uint256"
2731
+ },
2732
+ "id": 2303,
2733
+ "isConstant": false,
2734
+ "isLValue": false,
2735
+ "isPure": false,
2736
+ "lValueRequested": false,
2737
+ "leftExpression": {
2738
+ "argumentTypes": null,
2739
+ "id": 2301,
2740
+ "name": "i",
2741
+ "nodeType": "Identifier",
2742
+ "overloadedDeclarations": [],
2743
+ "referencedDeclaration": 2298,
2744
+ "src": "564:1:7",
2745
+ "typeDescriptions": {
2746
+ "typeIdentifier": "t_uint256",
2747
+ "typeString": "uint256"
2748
+ }
2749
+ },
2750
+ "nodeType": "BinaryOperation",
2751
+ "operator": "<",
2752
+ "rightExpression": {
2753
+ "argumentTypes": null,
2754
+ "id": 2302,
2755
+ "name": "borrowablesLength",
2756
+ "nodeType": "Identifier",
2757
+ "overloadedDeclarations": [],
2758
+ "referencedDeclaration": 2282,
2759
+ "src": "568:17:7",
2760
+ "typeDescriptions": {
2761
+ "typeIdentifier": "t_uint256",
2762
+ "typeString": "uint256"
2763
+ }
2764
+ },
2765
+ "src": "564:21:7",
2766
+ "typeDescriptions": {
2767
+ "typeIdentifier": "t_bool",
2768
+ "typeString": "bool"
2769
+ }
2770
+ },
2771
+ "id": 2326,
2772
+ "initializationExpression": {
2773
+ "assignments": [
2774
+ 2298
2775
+ ],
2776
+ "declarations": [
2777
+ {
2778
+ "constant": false,
2779
+ "id": 2298,
2780
+ "name": "i",
2781
+ "nodeType": "VariableDeclaration",
2782
+ "scope": 2326,
2783
+ "src": "552:6:7",
2784
+ "stateVariable": false,
2785
+ "storageLocation": "default",
2786
+ "typeDescriptions": {
2787
+ "typeIdentifier": "t_uint256",
2788
+ "typeString": "uint256"
2789
+ },
2790
+ "typeName": {
2791
+ "id": 2297,
2792
+ "name": "uint",
2793
+ "nodeType": "ElementaryTypeName",
2794
+ "src": "552:4:7",
2795
+ "typeDescriptions": {
2796
+ "typeIdentifier": "t_uint256",
2797
+ "typeString": "uint256"
2798
+ }
2799
+ },
2800
+ "value": null,
2801
+ "visibility": "internal"
2802
+ }
2803
+ ],
2804
+ "id": 2300,
2805
+ "initialValue": {
2806
+ "argumentTypes": null,
2807
+ "hexValue": "30",
2808
+ "id": 2299,
2809
+ "isConstant": false,
2810
+ "isLValue": false,
2811
+ "isPure": true,
2812
+ "kind": "number",
2813
+ "lValueRequested": false,
2814
+ "nodeType": "Literal",
2815
+ "src": "561:1:7",
2816
+ "subdenomination": null,
2817
+ "typeDescriptions": {
2818
+ "typeIdentifier": "t_rational_0_by_1",
2819
+ "typeString": "int_const 0"
2820
+ },
2821
+ "value": "0"
2822
+ },
2823
+ "nodeType": "VariableDeclarationStatement",
2824
+ "src": "552:10:7"
2825
+ },
2826
+ "loopExpression": {
2827
+ "expression": {
2828
+ "argumentTypes": null,
2829
+ "id": 2305,
2830
+ "isConstant": false,
2831
+ "isLValue": false,
2832
+ "isPure": false,
2833
+ "lValueRequested": false,
2834
+ "nodeType": "UnaryOperation",
2835
+ "operator": "++",
2836
+ "prefix": false,
2837
+ "src": "587:3:7",
2838
+ "subExpression": {
2839
+ "argumentTypes": null,
2840
+ "id": 2304,
2841
+ "name": "i",
2842
+ "nodeType": "Identifier",
2843
+ "overloadedDeclarations": [],
2844
+ "referencedDeclaration": 2298,
2845
+ "src": "587:1:7",
2846
+ "typeDescriptions": {
2847
+ "typeIdentifier": "t_uint256",
2848
+ "typeString": "uint256"
2849
+ }
2850
+ },
2851
+ "typeDescriptions": {
2852
+ "typeIdentifier": "t_uint256",
2853
+ "typeString": "uint256"
2854
+ }
2855
+ },
2856
+ "id": 2306,
2857
+ "nodeType": "ExpressionStatement",
2858
+ "src": "587:3:7"
2859
+ },
2860
+ "nodeType": "ForStatement",
2861
+ "src": "547:183:7"
2862
+ }
2863
+ ]
2864
+ },
2865
+ "documentation": null,
2866
+ "id": 2328,
2867
+ "implemented": true,
2868
+ "kind": "function",
2869
+ "modifiers": [],
2870
+ "name": "getAvailableLiquidity",
2871
+ "nodeType": "FunctionDefinition",
2872
+ "parameters": {
2873
+ "id": 2277,
2874
+ "nodeType": "ParameterList",
2875
+ "parameters": [
2876
+ {
2877
+ "constant": false,
2878
+ "id": 2276,
2879
+ "name": "vault",
2880
+ "nodeType": "VariableDeclaration",
2881
+ "scope": 2328,
2882
+ "src": "343:13:7",
2883
+ "stateVariable": false,
2884
+ "storageLocation": "default",
2885
+ "typeDescriptions": {
2886
+ "typeIdentifier": "t_address",
2887
+ "typeString": "address"
2888
+ },
2889
+ "typeName": {
2890
+ "id": 2275,
2891
+ "name": "address",
2892
+ "nodeType": "ElementaryTypeName",
2893
+ "src": "343:7:7",
2894
+ "stateMutability": "nonpayable",
2895
+ "typeDescriptions": {
2896
+ "typeIdentifier": "t_address",
2897
+ "typeString": "address"
2898
+ }
2899
+ },
2900
+ "value": null,
2901
+ "visibility": "internal"
2902
+ }
2903
+ ],
2904
+ "src": "342:15:7"
2905
+ },
2906
+ "returnParameters": {
2907
+ "id": 2280,
2908
+ "nodeType": "ParameterList",
2909
+ "parameters": [
2910
+ {
2911
+ "constant": false,
2912
+ "id": 2279,
2913
+ "name": "availableLiquidity",
2914
+ "nodeType": "VariableDeclaration",
2915
+ "scope": 2328,
2916
+ "src": "381:23:7",
2917
+ "stateVariable": false,
2918
+ "storageLocation": "default",
2919
+ "typeDescriptions": {
2920
+ "typeIdentifier": "t_uint256",
2921
+ "typeString": "uint256"
2922
+ },
2923
+ "typeName": {
2924
+ "id": 2278,
2925
+ "name": "uint",
2926
+ "nodeType": "ElementaryTypeName",
2927
+ "src": "381:4:7",
2928
+ "typeDescriptions": {
2929
+ "typeIdentifier": "t_uint256",
2930
+ "typeString": "uint256"
2931
+ }
2932
+ },
2933
+ "value": null,
2934
+ "visibility": "internal"
2935
+ }
2936
+ ],
2937
+ "src": "380:25:7"
2938
+ },
2939
+ "scope": 2416,
2940
+ "src": "312:422:7",
2941
+ "stateMutability": "view",
2942
+ "superFunction": null,
2943
+ "visibility": "external"
2944
+ },
2945
+ {
2946
+ "body": {
2947
+ "id": 2406,
2948
+ "nodeType": "Block",
2949
+ "src": "812:658:7",
2950
+ "statements": [
2951
+ {
2952
+ "assignments": [
2953
+ 2336
2954
+ ],
2955
+ "declarations": [
2956
+ {
2957
+ "constant": false,
2958
+ "id": 2336,
2959
+ "name": "borrowablesLength",
2960
+ "nodeType": "VariableDeclaration",
2961
+ "scope": 2406,
2962
+ "src": "817:22:7",
2963
+ "stateVariable": false,
2964
+ "storageLocation": "default",
2965
+ "typeDescriptions": {
2966
+ "typeIdentifier": "t_uint256",
2967
+ "typeString": "uint256"
2968
+ },
2969
+ "typeName": {
2970
+ "id": 2335,
2971
+ "name": "uint",
2972
+ "nodeType": "ElementaryTypeName",
2973
+ "src": "817:4:7",
2974
+ "typeDescriptions": {
2975
+ "typeIdentifier": "t_uint256",
2976
+ "typeString": "uint256"
2977
+ }
2978
+ },
2979
+ "value": null,
2980
+ "visibility": "internal"
2981
+ }
2982
+ ],
2983
+ "id": 2342,
2984
+ "initialValue": {
2985
+ "argumentTypes": null,
2986
+ "arguments": [],
2987
+ "expression": {
2988
+ "argumentTypes": [],
2989
+ "expression": {
2990
+ "argumentTypes": null,
2991
+ "arguments": [
2992
+ {
2993
+ "argumentTypes": null,
2994
+ "id": 2338,
2995
+ "name": "vault",
2996
+ "nodeType": "Identifier",
2997
+ "overloadedDeclarations": [],
2998
+ "referencedDeclaration": 2330,
2999
+ "src": "858:5:7",
3000
+ "typeDescriptions": {
3001
+ "typeIdentifier": "t_address",
3002
+ "typeString": "address"
3003
+ }
3004
+ }
3005
+ ],
3006
+ "expression": {
3007
+ "argumentTypes": [
3008
+ {
3009
+ "typeIdentifier": "t_address",
3010
+ "typeString": "address"
3011
+ }
3012
+ ],
3013
+ "id": 2337,
3014
+ "name": "ILendingVaultV1",
3015
+ "nodeType": "Identifier",
3016
+ "overloadedDeclarations": [],
3017
+ "referencedDeclaration": 3618,
3018
+ "src": "842:15:7",
3019
+ "typeDescriptions": {
3020
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
3021
+ "typeString": "type(contract ILendingVaultV1)"
3022
+ }
3023
+ },
3024
+ "id": 2339,
3025
+ "isConstant": false,
3026
+ "isLValue": false,
3027
+ "isPure": false,
3028
+ "kind": "typeConversion",
3029
+ "lValueRequested": false,
3030
+ "names": [],
3031
+ "nodeType": "FunctionCall",
3032
+ "src": "842:22:7",
3033
+ "typeDescriptions": {
3034
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
3035
+ "typeString": "contract ILendingVaultV1"
3036
+ }
3037
+ },
3038
+ "id": 2340,
3039
+ "isConstant": false,
3040
+ "isLValue": false,
3041
+ "isPure": false,
3042
+ "lValueRequested": false,
3043
+ "memberName": "getBorrowablesLength",
3044
+ "nodeType": "MemberAccess",
3045
+ "referencedDeclaration": 3549,
3046
+ "src": "842:43:7",
3047
+ "typeDescriptions": {
3048
+ "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
3049
+ "typeString": "function () view external returns (uint256)"
3050
+ }
3051
+ },
3052
+ "id": 2341,
3053
+ "isConstant": false,
3054
+ "isLValue": false,
3055
+ "isPure": false,
3056
+ "kind": "functionCall",
3057
+ "lValueRequested": false,
3058
+ "names": [],
3059
+ "nodeType": "FunctionCall",
3060
+ "src": "842:45:7",
3061
+ "typeDescriptions": {
3062
+ "typeIdentifier": "t_uint256",
3063
+ "typeString": "uint256"
3064
+ }
3065
+ },
3066
+ "nodeType": "VariableDeclarationStatement",
3067
+ "src": "817:70:7"
3068
+ },
3069
+ {
3070
+ "assignments": [
3071
+ 2344
3072
+ ],
3073
+ "declarations": [
3074
+ {
3075
+ "constant": false,
3076
+ "id": 2344,
3077
+ "name": "totalSuppliedAmount",
3078
+ "nodeType": "VariableDeclaration",
3079
+ "scope": 2406,
3080
+ "src": "892:24:7",
3081
+ "stateVariable": false,
3082
+ "storageLocation": "default",
3083
+ "typeDescriptions": {
3084
+ "typeIdentifier": "t_uint256",
3085
+ "typeString": "uint256"
3086
+ },
3087
+ "typeName": {
3088
+ "id": 2343,
3089
+ "name": "uint",
3090
+ "nodeType": "ElementaryTypeName",
3091
+ "src": "892:4:7",
3092
+ "typeDescriptions": {
3093
+ "typeIdentifier": "t_uint256",
3094
+ "typeString": "uint256"
3095
+ }
3096
+ },
3097
+ "value": null,
3098
+ "visibility": "internal"
3099
+ }
3100
+ ],
3101
+ "id": 2345,
3102
+ "initialValue": null,
3103
+ "nodeType": "VariableDeclarationStatement",
3104
+ "src": "892:24:7"
3105
+ },
3106
+ {
3107
+ "assignments": [
3108
+ 2347
3109
+ ],
3110
+ "declarations": [
3111
+ {
3112
+ "constant": false,
3113
+ "id": 2347,
3114
+ "name": "totalProfitsPerSecond",
3115
+ "nodeType": "VariableDeclaration",
3116
+ "scope": 2406,
3117
+ "src": "921:26:7",
3118
+ "stateVariable": false,
3119
+ "storageLocation": "default",
3120
+ "typeDescriptions": {
3121
+ "typeIdentifier": "t_uint256",
3122
+ "typeString": "uint256"
3123
+ },
3124
+ "typeName": {
3125
+ "id": 2346,
3126
+ "name": "uint",
3127
+ "nodeType": "ElementaryTypeName",
3128
+ "src": "921:4:7",
3129
+ "typeDescriptions": {
3130
+ "typeIdentifier": "t_uint256",
3131
+ "typeString": "uint256"
3132
+ }
3133
+ },
3134
+ "value": null,
3135
+ "visibility": "internal"
3136
+ }
3137
+ ],
3138
+ "id": 2348,
3139
+ "initialValue": null,
3140
+ "nodeType": "VariableDeclarationStatement",
3141
+ "src": "921:26:7"
3142
+ },
3143
+ {
3144
+ "body": {
3145
+ "id": 2400,
3146
+ "nodeType": "Block",
3147
+ "src": "997:414:7",
3148
+ "statements": [
3149
+ {
3150
+ "assignments": [
3151
+ 2360
3152
+ ],
3153
+ "declarations": [
3154
+ {
3155
+ "constant": false,
3156
+ "id": 2360,
3157
+ "name": "borrowable",
3158
+ "nodeType": "VariableDeclaration",
3159
+ "scope": 2400,
3160
+ "src": "1003:18:7",
3161
+ "stateVariable": false,
3162
+ "storageLocation": "default",
3163
+ "typeDescriptions": {
3164
+ "typeIdentifier": "t_address",
3165
+ "typeString": "address"
3166
+ },
3167
+ "typeName": {
3168
+ "id": 2359,
3169
+ "name": "address",
3170
+ "nodeType": "ElementaryTypeName",
3171
+ "src": "1003:7:7",
3172
+ "stateMutability": "nonpayable",
3173
+ "typeDescriptions": {
3174
+ "typeIdentifier": "t_address",
3175
+ "typeString": "address"
3176
+ }
3177
+ },
3178
+ "value": null,
3179
+ "visibility": "internal"
3180
+ }
3181
+ ],
3182
+ "id": 2367,
3183
+ "initialValue": {
3184
+ "argumentTypes": null,
3185
+ "arguments": [
3186
+ {
3187
+ "argumentTypes": null,
3188
+ "id": 2365,
3189
+ "name": "i",
3190
+ "nodeType": "Identifier",
3191
+ "overloadedDeclarations": [],
3192
+ "referencedDeclaration": 2350,
3193
+ "src": "1059:1:7",
3194
+ "typeDescriptions": {
3195
+ "typeIdentifier": "t_uint256",
3196
+ "typeString": "uint256"
3197
+ }
3198
+ }
3199
+ ],
3200
+ "expression": {
3201
+ "argumentTypes": [
3202
+ {
3203
+ "typeIdentifier": "t_uint256",
3204
+ "typeString": "uint256"
3205
+ }
3206
+ ],
3207
+ "expression": {
3208
+ "argumentTypes": null,
3209
+ "arguments": [
3210
+ {
3211
+ "argumentTypes": null,
3212
+ "id": 2362,
3213
+ "name": "vault",
3214
+ "nodeType": "Identifier",
3215
+ "overloadedDeclarations": [],
3216
+ "referencedDeclaration": 2330,
3217
+ "src": "1040:5:7",
3218
+ "typeDescriptions": {
3219
+ "typeIdentifier": "t_address",
3220
+ "typeString": "address"
3221
+ }
3222
+ }
3223
+ ],
3224
+ "expression": {
3225
+ "argumentTypes": [
3226
+ {
3227
+ "typeIdentifier": "t_address",
3228
+ "typeString": "address"
3229
+ }
3230
+ ],
3231
+ "id": 2361,
3232
+ "name": "ILendingVaultV1",
3233
+ "nodeType": "Identifier",
3234
+ "overloadedDeclarations": [],
3235
+ "referencedDeclaration": 3618,
3236
+ "src": "1024:15:7",
3237
+ "typeDescriptions": {
3238
+ "typeIdentifier": "t_type$_t_contract$_ILendingVaultV1_$3618_$",
3239
+ "typeString": "type(contract ILendingVaultV1)"
3240
+ }
3241
+ },
3242
+ "id": 2363,
3243
+ "isConstant": false,
3244
+ "isLValue": false,
3245
+ "isPure": false,
3246
+ "kind": "typeConversion",
3247
+ "lValueRequested": false,
3248
+ "names": [],
3249
+ "nodeType": "FunctionCall",
3250
+ "src": "1024:22:7",
3251
+ "typeDescriptions": {
3252
+ "typeIdentifier": "t_contract$_ILendingVaultV1_$3618",
3253
+ "typeString": "contract ILendingVaultV1"
3254
+ }
3255
+ },
3256
+ "id": 2364,
3257
+ "isConstant": false,
3258
+ "isLValue": false,
3259
+ "isPure": false,
3260
+ "lValueRequested": false,
3261
+ "memberName": "borrowables",
3262
+ "nodeType": "MemberAccess",
3263
+ "referencedDeclaration": 3535,
3264
+ "src": "1024:34:7",
3265
+ "typeDescriptions": {
3266
+ "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
3267
+ "typeString": "function (uint256) view external returns (address)"
3268
+ }
3269
+ },
3270
+ "id": 2366,
3271
+ "isConstant": false,
3272
+ "isLValue": false,
3273
+ "isPure": false,
3274
+ "kind": "functionCall",
3275
+ "lValueRequested": false,
3276
+ "names": [],
3277
+ "nodeType": "FunctionCall",
3278
+ "src": "1024:37:7",
3279
+ "typeDescriptions": {
3280
+ "typeIdentifier": "t_address",
3281
+ "typeString": "address"
3282
+ }
3283
+ },
3284
+ "nodeType": "VariableDeclarationStatement",
3285
+ "src": "1003:58:7"
3286
+ },
3287
+ {
3288
+ "assignments": [
3289
+ 2371
3290
+ ],
3291
+ "declarations": [
3292
+ {
3293
+ "constant": false,
3294
+ "id": 2371,
3295
+ "name": "borrowableObject",
3296
+ "nodeType": "VariableDeclaration",
3297
+ "scope": 2400,
3298
+ "src": "1067:51:7",
3299
+ "stateVariable": false,
3300
+ "storageLocation": "memory",
3301
+ "typeDescriptions": {
3302
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
3303
+ "typeString": "struct BorrowableObject.Borrowable"
3304
+ },
3305
+ "typeName": {
3306
+ "contractScope": null,
3307
+ "id": 2370,
3308
+ "name": "BorrowableObject.Borrowable",
3309
+ "nodeType": "UserDefinedTypeName",
3310
+ "referencedDeclaration": 4259,
3311
+ "src": "1067:27:7",
3312
+ "typeDescriptions": {
3313
+ "typeIdentifier": "t_struct$_Borrowable_$4259_storage_ptr",
3314
+ "typeString": "struct BorrowableObject.Borrowable"
3315
+ }
3316
+ },
3317
+ "value": null,
3318
+ "visibility": "internal"
3319
+ }
3320
+ ],
3321
+ "id": 2379,
3322
+ "initialValue": {
3323
+ "argumentTypes": null,
3324
+ "arguments": [
3325
+ {
3326
+ "argumentTypes": null,
3327
+ "arguments": [
3328
+ {
3329
+ "argumentTypes": null,
3330
+ "id": 2375,
3331
+ "name": "borrowable",
3332
+ "nodeType": "Identifier",
3333
+ "overloadedDeclarations": [],
3334
+ "referencedDeclaration": 2360,
3335
+ "src": "1164:10:7",
3336
+ "typeDescriptions": {
3337
+ "typeIdentifier": "t_address",
3338
+ "typeString": "address"
3339
+ }
3340
+ }
3341
+ ],
3342
+ "expression": {
3343
+ "argumentTypes": [
3344
+ {
3345
+ "typeIdentifier": "t_address",
3346
+ "typeString": "address"
3347
+ }
3348
+ ],
3349
+ "id": 2374,
3350
+ "name": "IBorrowable",
3351
+ "nodeType": "Identifier",
3352
+ "overloadedDeclarations": [],
3353
+ "referencedDeclaration": 3205,
3354
+ "src": "1152:11:7",
3355
+ "typeDescriptions": {
3356
+ "typeIdentifier": "t_type$_t_contract$_IBorrowable_$3205_$",
3357
+ "typeString": "type(contract IBorrowable)"
3358
+ }
3359
+ },
3360
+ "id": 2376,
3361
+ "isConstant": false,
3362
+ "isLValue": false,
3363
+ "isPure": false,
3364
+ "kind": "typeConversion",
3365
+ "lValueRequested": false,
3366
+ "names": [],
3367
+ "nodeType": "FunctionCall",
3368
+ "src": "1152:23:7",
3369
+ "typeDescriptions": {
3370
+ "typeIdentifier": "t_contract$_IBorrowable_$3205",
3371
+ "typeString": "contract IBorrowable"
3372
+ }
3373
+ },
3374
+ {
3375
+ "argumentTypes": null,
3376
+ "id": 2377,
3377
+ "name": "vault",
3378
+ "nodeType": "Identifier",
3379
+ "overloadedDeclarations": [],
3380
+ "referencedDeclaration": 2330,
3381
+ "src": "1177:5:7",
3382
+ "typeDescriptions": {
3383
+ "typeIdentifier": "t_address",
3384
+ "typeString": "address"
3385
+ }
3386
+ }
3387
+ ],
3388
+ "expression": {
3389
+ "argumentTypes": [
3390
+ {
3391
+ "typeIdentifier": "t_contract$_IBorrowable_$3205",
3392
+ "typeString": "contract IBorrowable"
3393
+ },
3394
+ {
3395
+ "typeIdentifier": "t_address",
3396
+ "typeString": "address"
3397
+ }
3398
+ ],
3399
+ "expression": {
3400
+ "argumentTypes": null,
3401
+ "id": 2372,
3402
+ "name": "BorrowableObject",
3403
+ "nodeType": "Identifier",
3404
+ "overloadedDeclarations": [],
3405
+ "referencedDeclaration": 4759,
3406
+ "src": "1121:16:7",
3407
+ "typeDescriptions": {
3408
+ "typeIdentifier": "t_type$_t_contract$_BorrowableObject_$4759_$",
3409
+ "typeString": "type(library BorrowableObject)"
3410
+ }
3411
+ },
3412
+ "id": 2373,
3413
+ "isConstant": false,
3414
+ "isLValue": false,
3415
+ "isPure": false,
3416
+ "lValueRequested": false,
3417
+ "memberName": "newBorrowable",
3418
+ "nodeType": "MemberAccess",
3419
+ "referencedDeclaration": 4354,
3420
+ "src": "1121:30:7",
3421
+ "typeDescriptions": {
3422
+ "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IBorrowable_$3205_$_t_address_$returns$_t_struct$_Borrowable_$4259_memory_ptr_$",
3423
+ "typeString": "function (contract IBorrowable,address) returns (struct BorrowableObject.Borrowable memory)"
3424
+ }
3425
+ },
3426
+ "id": 2378,
3427
+ "isConstant": false,
3428
+ "isLValue": false,
3429
+ "isPure": false,
3430
+ "kind": "functionCall",
3431
+ "lValueRequested": false,
3432
+ "names": [],
3433
+ "nodeType": "FunctionCall",
3434
+ "src": "1121:62:7",
3435
+ "typeDescriptions": {
3436
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
3437
+ "typeString": "struct BorrowableObject.Borrowable memory"
3438
+ }
3439
+ },
3440
+ "nodeType": "VariableDeclarationStatement",
3441
+ "src": "1067:116:7"
3442
+ },
3443
+ {
3444
+ "assignments": [
3445
+ 2381
3446
+ ],
3447
+ "declarations": [
3448
+ {
3449
+ "constant": false,
3450
+ "id": 2381,
3451
+ "name": "borrowableRate",
3452
+ "nodeType": "VariableDeclaration",
3453
+ "scope": 2400,
3454
+ "src": "1189:19:7",
3455
+ "stateVariable": false,
3456
+ "storageLocation": "default",
3457
+ "typeDescriptions": {
3458
+ "typeIdentifier": "t_uint256",
3459
+ "typeString": "uint256"
3460
+ },
3461
+ "typeName": {
3462
+ "id": 2380,
3463
+ "name": "uint",
3464
+ "nodeType": "ElementaryTypeName",
3465
+ "src": "1189:4:7",
3466
+ "typeDescriptions": {
3467
+ "typeIdentifier": "t_uint256",
3468
+ "typeString": "uint256"
3469
+ }
3470
+ },
3471
+ "value": null,
3472
+ "visibility": "internal"
3473
+ }
3474
+ ],
3475
+ "id": 2384,
3476
+ "initialValue": {
3477
+ "argumentTypes": null,
3478
+ "expression": {
3479
+ "argumentTypes": null,
3480
+ "id": 2382,
3481
+ "name": "borrowableObject",
3482
+ "nodeType": "Identifier",
3483
+ "overloadedDeclarations": [],
3484
+ "referencedDeclaration": 2371,
3485
+ "src": "1211:16:7",
3486
+ "typeDescriptions": {
3487
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
3488
+ "typeString": "struct BorrowableObject.Borrowable memory"
3489
+ }
3490
+ },
3491
+ "id": 2383,
3492
+ "isConstant": false,
3493
+ "isLValue": true,
3494
+ "isPure": false,
3495
+ "lValueRequested": false,
3496
+ "memberName": "cachedSupplyRate",
3497
+ "nodeType": "MemberAccess",
3498
+ "referencedDeclaration": 4258,
3499
+ "src": "1211:33:7",
3500
+ "typeDescriptions": {
3501
+ "typeIdentifier": "t_uint256",
3502
+ "typeString": "uint256"
3503
+ }
3504
+ },
3505
+ "nodeType": "VariableDeclarationStatement",
3506
+ "src": "1189:55:7"
3507
+ },
3508
+ {
3509
+ "assignments": [
3510
+ 2386
3511
+ ],
3512
+ "declarations": [
3513
+ {
3514
+ "constant": false,
3515
+ "id": 2386,
3516
+ "name": "suppliedAmount",
3517
+ "nodeType": "VariableDeclaration",
3518
+ "scope": 2400,
3519
+ "src": "1250:19:7",
3520
+ "stateVariable": false,
3521
+ "storageLocation": "default",
3522
+ "typeDescriptions": {
3523
+ "typeIdentifier": "t_uint256",
3524
+ "typeString": "uint256"
3525
+ },
3526
+ "typeName": {
3527
+ "id": 2385,
3528
+ "name": "uint",
3529
+ "nodeType": "ElementaryTypeName",
3530
+ "src": "1250:4:7",
3531
+ "typeDescriptions": {
3532
+ "typeIdentifier": "t_uint256",
3533
+ "typeString": "uint256"
3534
+ }
3535
+ },
3536
+ "value": null,
3537
+ "visibility": "internal"
3538
+ }
3539
+ ],
3540
+ "id": 2389,
3541
+ "initialValue": {
3542
+ "argumentTypes": null,
3543
+ "expression": {
3544
+ "argumentTypes": null,
3545
+ "id": 2387,
3546
+ "name": "borrowableObject",
3547
+ "nodeType": "Identifier",
3548
+ "overloadedDeclarations": [],
3549
+ "referencedDeclaration": 2371,
3550
+ "src": "1272:16:7",
3551
+ "typeDescriptions": {
3552
+ "typeIdentifier": "t_struct$_Borrowable_$4259_memory_ptr",
3553
+ "typeString": "struct BorrowableObject.Borrowable memory"
3554
+ }
3555
+ },
3556
+ "id": 2388,
3557
+ "isConstant": false,
3558
+ "isLValue": true,
3559
+ "isPure": false,
3560
+ "lValueRequested": false,
3561
+ "memberName": "ownedSupply",
3562
+ "nodeType": "MemberAccess",
3563
+ "referencedDeclaration": 4248,
3564
+ "src": "1272:28:7",
3565
+ "typeDescriptions": {
3566
+ "typeIdentifier": "t_uint256",
3567
+ "typeString": "uint256"
3568
+ }
3569
+ },
3570
+ "nodeType": "VariableDeclarationStatement",
3571
+ "src": "1250:50:7"
3572
+ },
3573
+ {
3574
+ "expression": {
3575
+ "argumentTypes": null,
3576
+ "id": 2392,
3577
+ "isConstant": false,
3578
+ "isLValue": false,
3579
+ "isPure": false,
3580
+ "lValueRequested": false,
3581
+ "leftHandSide": {
3582
+ "argumentTypes": null,
3583
+ "id": 2390,
3584
+ "name": "totalSuppliedAmount",
3585
+ "nodeType": "Identifier",
3586
+ "overloadedDeclarations": [],
3587
+ "referencedDeclaration": 2344,
3588
+ "src": "1306:19:7",
3589
+ "typeDescriptions": {
3590
+ "typeIdentifier": "t_uint256",
3591
+ "typeString": "uint256"
3592
+ }
3593
+ },
3594
+ "nodeType": "Assignment",
3595
+ "operator": "+=",
3596
+ "rightHandSide": {
3597
+ "argumentTypes": null,
3598
+ "id": 2391,
3599
+ "name": "suppliedAmount",
3600
+ "nodeType": "Identifier",
3601
+ "overloadedDeclarations": [],
3602
+ "referencedDeclaration": 2386,
3603
+ "src": "1329:14:7",
3604
+ "typeDescriptions": {
3605
+ "typeIdentifier": "t_uint256",
3606
+ "typeString": "uint256"
3607
+ }
3608
+ },
3609
+ "src": "1306:37:7",
3610
+ "typeDescriptions": {
3611
+ "typeIdentifier": "t_uint256",
3612
+ "typeString": "uint256"
3613
+ }
3614
+ },
3615
+ "id": 2393,
3616
+ "nodeType": "ExpressionStatement",
3617
+ "src": "1306:37:7"
3618
+ },
3619
+ {
3620
+ "expression": {
3621
+ "argumentTypes": null,
3622
+ "id": 2398,
3623
+ "isConstant": false,
3624
+ "isLValue": false,
3625
+ "isPure": false,
3626
+ "lValueRequested": false,
3627
+ "leftHandSide": {
3628
+ "argumentTypes": null,
3629
+ "id": 2394,
3630
+ "name": "totalProfitsPerSecond",
3631
+ "nodeType": "Identifier",
3632
+ "overloadedDeclarations": [],
3633
+ "referencedDeclaration": 2347,
3634
+ "src": "1349:21:7",
3635
+ "typeDescriptions": {
3636
+ "typeIdentifier": "t_uint256",
3637
+ "typeString": "uint256"
3638
+ }
3639
+ },
3640
+ "nodeType": "Assignment",
3641
+ "operator": "+=",
3642
+ "rightHandSide": {
3643
+ "argumentTypes": null,
3644
+ "commonType": {
3645
+ "typeIdentifier": "t_uint256",
3646
+ "typeString": "uint256"
3647
+ },
3648
+ "id": 2397,
3649
+ "isConstant": false,
3650
+ "isLValue": false,
3651
+ "isPure": false,
3652
+ "lValueRequested": false,
3653
+ "leftExpression": {
3654
+ "argumentTypes": null,
3655
+ "id": 2395,
3656
+ "name": "borrowableRate",
3657
+ "nodeType": "Identifier",
3658
+ "overloadedDeclarations": [],
3659
+ "referencedDeclaration": 2381,
3660
+ "src": "1374:14:7",
3661
+ "typeDescriptions": {
3662
+ "typeIdentifier": "t_uint256",
3663
+ "typeString": "uint256"
3664
+ }
3665
+ },
3666
+ "nodeType": "BinaryOperation",
3667
+ "operator": "*",
3668
+ "rightExpression": {
3669
+ "argumentTypes": null,
3670
+ "id": 2396,
3671
+ "name": "suppliedAmount",
3672
+ "nodeType": "Identifier",
3673
+ "overloadedDeclarations": [],
3674
+ "referencedDeclaration": 2386,
3675
+ "src": "1391:14:7",
3676
+ "typeDescriptions": {
3677
+ "typeIdentifier": "t_uint256",
3678
+ "typeString": "uint256"
3679
+ }
3680
+ },
3681
+ "src": "1374:31:7",
3682
+ "typeDescriptions": {
3683
+ "typeIdentifier": "t_uint256",
3684
+ "typeString": "uint256"
3685
+ }
3686
+ },
3687
+ "src": "1349:56:7",
3688
+ "typeDescriptions": {
3689
+ "typeIdentifier": "t_uint256",
3690
+ "typeString": "uint256"
3691
+ }
3692
+ },
3693
+ "id": 2399,
3694
+ "nodeType": "ExpressionStatement",
3695
+ "src": "1349:56:7"
3696
+ }
3697
+ ]
3698
+ },
3699
+ "condition": {
3700
+ "argumentTypes": null,
3701
+ "commonType": {
3702
+ "typeIdentifier": "t_uint256",
3703
+ "typeString": "uint256"
3704
+ },
3705
+ "id": 2355,
3706
+ "isConstant": false,
3707
+ "isLValue": false,
3708
+ "isPure": false,
3709
+ "lValueRequested": false,
3710
+ "leftExpression": {
3711
+ "argumentTypes": null,
3712
+ "id": 2353,
3713
+ "name": "i",
3714
+ "nodeType": "Identifier",
3715
+ "overloadedDeclarations": [],
3716
+ "referencedDeclaration": 2350,
3717
+ "src": "969:1:7",
3718
+ "typeDescriptions": {
3719
+ "typeIdentifier": "t_uint256",
3720
+ "typeString": "uint256"
3721
+ }
3722
+ },
3723
+ "nodeType": "BinaryOperation",
3724
+ "operator": "<",
3725
+ "rightExpression": {
3726
+ "argumentTypes": null,
3727
+ "id": 2354,
3728
+ "name": "borrowablesLength",
3729
+ "nodeType": "Identifier",
3730
+ "overloadedDeclarations": [],
3731
+ "referencedDeclaration": 2336,
3732
+ "src": "973:17:7",
3733
+ "typeDescriptions": {
3734
+ "typeIdentifier": "t_uint256",
3735
+ "typeString": "uint256"
3736
+ }
3737
+ },
3738
+ "src": "969:21:7",
3739
+ "typeDescriptions": {
3740
+ "typeIdentifier": "t_bool",
3741
+ "typeString": "bool"
3742
+ }
3743
+ },
3744
+ "id": 2401,
3745
+ "initializationExpression": {
3746
+ "assignments": [
3747
+ 2350
3748
+ ],
3749
+ "declarations": [
3750
+ {
3751
+ "constant": false,
3752
+ "id": 2350,
3753
+ "name": "i",
3754
+ "nodeType": "VariableDeclaration",
3755
+ "scope": 2401,
3756
+ "src": "957:6:7",
3757
+ "stateVariable": false,
3758
+ "storageLocation": "default",
3759
+ "typeDescriptions": {
3760
+ "typeIdentifier": "t_uint256",
3761
+ "typeString": "uint256"
3762
+ },
3763
+ "typeName": {
3764
+ "id": 2349,
3765
+ "name": "uint",
3766
+ "nodeType": "ElementaryTypeName",
3767
+ "src": "957:4:7",
3768
+ "typeDescriptions": {
3769
+ "typeIdentifier": "t_uint256",
3770
+ "typeString": "uint256"
3771
+ }
3772
+ },
3773
+ "value": null,
3774
+ "visibility": "internal"
3775
+ }
3776
+ ],
3777
+ "id": 2352,
3778
+ "initialValue": {
3779
+ "argumentTypes": null,
3780
+ "hexValue": "30",
3781
+ "id": 2351,
3782
+ "isConstant": false,
3783
+ "isLValue": false,
3784
+ "isPure": true,
3785
+ "kind": "number",
3786
+ "lValueRequested": false,
3787
+ "nodeType": "Literal",
3788
+ "src": "966:1:7",
3789
+ "subdenomination": null,
3790
+ "typeDescriptions": {
3791
+ "typeIdentifier": "t_rational_0_by_1",
3792
+ "typeString": "int_const 0"
3793
+ },
3794
+ "value": "0"
3795
+ },
3796
+ "nodeType": "VariableDeclarationStatement",
3797
+ "src": "957:10:7"
3798
+ },
3799
+ "loopExpression": {
3800
+ "expression": {
3801
+ "argumentTypes": null,
3802
+ "id": 2357,
3803
+ "isConstant": false,
3804
+ "isLValue": false,
3805
+ "isPure": false,
3806
+ "lValueRequested": false,
3807
+ "nodeType": "UnaryOperation",
3808
+ "operator": "++",
3809
+ "prefix": false,
3810
+ "src": "992:3:7",
3811
+ "subExpression": {
3812
+ "argumentTypes": null,
3813
+ "id": 2356,
3814
+ "name": "i",
3815
+ "nodeType": "Identifier",
3816
+ "overloadedDeclarations": [],
3817
+ "referencedDeclaration": 2350,
3818
+ "src": "992:1:7",
3819
+ "typeDescriptions": {
3820
+ "typeIdentifier": "t_uint256",
3821
+ "typeString": "uint256"
3822
+ }
3823
+ },
3824
+ "typeDescriptions": {
3825
+ "typeIdentifier": "t_uint256",
3826
+ "typeString": "uint256"
3827
+ }
3828
+ },
3829
+ "id": 2358,
3830
+ "nodeType": "ExpressionStatement",
3831
+ "src": "992:3:7"
3832
+ },
3833
+ "nodeType": "ForStatement",
3834
+ "src": "952:459:7"
3835
+ },
3836
+ {
3837
+ "expression": {
3838
+ "argumentTypes": null,
3839
+ "commonType": {
3840
+ "typeIdentifier": "t_uint256",
3841
+ "typeString": "uint256"
3842
+ },
3843
+ "id": 2404,
3844
+ "isConstant": false,
3845
+ "isLValue": false,
3846
+ "isPure": false,
3847
+ "lValueRequested": false,
3848
+ "leftExpression": {
3849
+ "argumentTypes": null,
3850
+ "id": 2402,
3851
+ "name": "totalProfitsPerSecond",
3852
+ "nodeType": "Identifier",
3853
+ "overloadedDeclarations": [],
3854
+ "referencedDeclaration": 2347,
3855
+ "src": "1422:21:7",
3856
+ "typeDescriptions": {
3857
+ "typeIdentifier": "t_uint256",
3858
+ "typeString": "uint256"
3859
+ }
3860
+ },
3861
+ "nodeType": "BinaryOperation",
3862
+ "operator": "/",
3863
+ "rightExpression": {
3864
+ "argumentTypes": null,
3865
+ "id": 2403,
3866
+ "name": "totalSuppliedAmount",
3867
+ "nodeType": "Identifier",
3868
+ "overloadedDeclarations": [],
3869
+ "referencedDeclaration": 2344,
3870
+ "src": "1446:19:7",
3871
+ "typeDescriptions": {
3872
+ "typeIdentifier": "t_uint256",
3873
+ "typeString": "uint256"
3874
+ }
3875
+ },
3876
+ "src": "1422:43:7",
3877
+ "typeDescriptions": {
3878
+ "typeIdentifier": "t_uint256",
3879
+ "typeString": "uint256"
3880
+ }
3881
+ },
3882
+ "functionReturnParameters": 2334,
3883
+ "id": 2405,
3884
+ "nodeType": "Return",
3885
+ "src": "1415:50:7"
3886
+ }
3887
+ ]
3888
+ },
3889
+ "documentation": null,
3890
+ "id": 2407,
3891
+ "implemented": true,
3892
+ "kind": "function",
3893
+ "modifiers": [],
3894
+ "name": "getSupplyRate",
3895
+ "nodeType": "FunctionDefinition",
3896
+ "parameters": {
3897
+ "id": 2331,
3898
+ "nodeType": "ParameterList",
3899
+ "parameters": [
3900
+ {
3901
+ "constant": false,
3902
+ "id": 2330,
3903
+ "name": "vault",
3904
+ "nodeType": "VariableDeclaration",
3905
+ "scope": 2407,
3906
+ "src": "762:13:7",
3907
+ "stateVariable": false,
3908
+ "storageLocation": "default",
3909
+ "typeDescriptions": {
3910
+ "typeIdentifier": "t_address",
3911
+ "typeString": "address"
3912
+ },
3913
+ "typeName": {
3914
+ "id": 2329,
3915
+ "name": "address",
3916
+ "nodeType": "ElementaryTypeName",
3917
+ "src": "762:7:7",
3918
+ "stateMutability": "nonpayable",
3919
+ "typeDescriptions": {
3920
+ "typeIdentifier": "t_address",
3921
+ "typeString": "address"
3922
+ }
3923
+ },
3924
+ "value": null,
3925
+ "visibility": "internal"
3926
+ }
3927
+ ],
3928
+ "src": "761:15:7"
3929
+ },
3930
+ "returnParameters": {
3931
+ "id": 2334,
3932
+ "nodeType": "ParameterList",
3933
+ "parameters": [
3934
+ {
3935
+ "constant": false,
3936
+ "id": 2333,
3937
+ "name": "supplyRate",
3938
+ "nodeType": "VariableDeclaration",
3939
+ "scope": 2407,
3940
+ "src": "795:15:7",
3941
+ "stateVariable": false,
3942
+ "storageLocation": "default",
3943
+ "typeDescriptions": {
3944
+ "typeIdentifier": "t_uint256",
3945
+ "typeString": "uint256"
3946
+ },
3947
+ "typeName": {
3948
+ "id": 2332,
3949
+ "name": "uint",
3950
+ "nodeType": "ElementaryTypeName",
3951
+ "src": "795:4:7",
3952
+ "typeDescriptions": {
3953
+ "typeIdentifier": "t_uint256",
3954
+ "typeString": "uint256"
3955
+ }
3956
+ },
3957
+ "value": null,
3958
+ "visibility": "internal"
3959
+ }
3960
+ ],
3961
+ "src": "794:17:7"
3962
+ },
3963
+ "scope": 2416,
3964
+ "src": "739:731:7",
3965
+ "stateMutability": "nonpayable",
3966
+ "superFunction": null,
3967
+ "visibility": "external"
3968
+ },
3969
+ {
3970
+ "body": {
3971
+ "id": 2414,
3972
+ "nodeType": "Block",
3973
+ "src": "1557:16:7",
3974
+ "statements": []
3975
+ },
3976
+ "documentation": null,
3977
+ "id": 2415,
3978
+ "implemented": true,
3979
+ "kind": "function",
3980
+ "modifiers": [],
3981
+ "name": "getOptimizedSupplyRate",
3982
+ "nodeType": "FunctionDefinition",
3983
+ "parameters": {
3984
+ "id": 2410,
3985
+ "nodeType": "ParameterList",
3986
+ "parameters": [
3987
+ {
3988
+ "constant": false,
3989
+ "id": 2409,
3990
+ "name": "vault",
3991
+ "nodeType": "VariableDeclaration",
3992
+ "scope": 2415,
3993
+ "src": "1507:13:7",
3994
+ "stateVariable": false,
3995
+ "storageLocation": "default",
3996
+ "typeDescriptions": {
3997
+ "typeIdentifier": "t_address",
3998
+ "typeString": "address"
3999
+ },
4000
+ "typeName": {
4001
+ "id": 2408,
4002
+ "name": "address",
4003
+ "nodeType": "ElementaryTypeName",
4004
+ "src": "1507:7:7",
4005
+ "stateMutability": "nonpayable",
4006
+ "typeDescriptions": {
4007
+ "typeIdentifier": "t_address",
4008
+ "typeString": "address"
4009
+ }
4010
+ },
4011
+ "value": null,
4012
+ "visibility": "internal"
4013
+ }
4014
+ ],
4015
+ "src": "1506:15:7"
4016
+ },
4017
+ "returnParameters": {
4018
+ "id": 2413,
4019
+ "nodeType": "ParameterList",
4020
+ "parameters": [
4021
+ {
4022
+ "constant": false,
4023
+ "id": 2412,
4024
+ "name": "supplyRate",
4025
+ "nodeType": "VariableDeclaration",
4026
+ "scope": 2415,
4027
+ "src": "1540:15:7",
4028
+ "stateVariable": false,
4029
+ "storageLocation": "default",
4030
+ "typeDescriptions": {
4031
+ "typeIdentifier": "t_uint256",
4032
+ "typeString": "uint256"
4033
+ },
4034
+ "typeName": {
4035
+ "id": 2411,
4036
+ "name": "uint",
4037
+ "nodeType": "ElementaryTypeName",
4038
+ "src": "1540:4:7",
4039
+ "typeDescriptions": {
4040
+ "typeIdentifier": "t_uint256",
4041
+ "typeString": "uint256"
4042
+ }
4043
+ },
4044
+ "value": null,
4045
+ "visibility": "internal"
4046
+ }
4047
+ ],
4048
+ "src": "1539:17:7"
4049
+ },
4050
+ "scope": 2416,
4051
+ "src": "1475:98:7",
4052
+ "stateMutability": "nonpayable",
4053
+ "superFunction": null,
4054
+ "visibility": "external"
4055
+ }
4056
+ ],
4057
+ "scope": 2417,
4058
+ "src": "189:1387:7"
4059
+ }
4060
+ ],
4061
+ "src": "0:1576:7"
4062
+ },
4063
+ "compiler": {
4064
+ "name": "solc",
4065
+ "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
4066
+ },
4067
+ "networks": {},
4068
+ "schemaVersion": "3.3.2",
4069
+ "updatedAt": "2023-07-25T23:02:16.364Z",
4070
+ "devdoc": {
4071
+ "methods": {}
4072
+ },
4073
+ "userdoc": {
4074
+ "methods": {}
4075
+ }
4076
+ }