{
    "contractName": "PairCurve",
    "abi": [
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "input",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "output",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "to",
                    "type": "address"
                },
                {
                    "internalType": "bytes",
                    "name": "data",
                    "type": "bytes"
                }
            ],
            "name": "swap",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "input",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "output",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "amountIn",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "data",
                    "type": "bytes"
                }
            ],
            "name": "getOutputAmount",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "amountOut",
                    "type": "uint256"
                }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
        }
    ],
    "metadata": "{\"compiler\":{\"version\":\"0.6.8+commit.0bbfe453\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"input\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"output\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"getOutputAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"input\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"output\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"project:/contracts/swappa/PairCurve.sol\":\"PairCurve\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0xdb26cbf4d028490f49831a7865c2fe1b28db44b535ca8d343785a3b768aae183\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://840b14ce0315c47d49ba328f1f9fa7654ded1c9e1559e6c5e777a7b2dc28bf0a\",\"dweb:/ipfs/QmTLLabn4wcfGro9LEmUXUN2nwKqZSotXMvjDCLXEnLtZP\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x9a9cf02622cd7a64261b10534fc3260449da25c98c9e96d1b4ae8110a20e5806\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2df142592d1dc267d9549049ee3317fa190d2f87eaa565f86ab05ec83f7ab8f5\",\"dweb:/ipfs/QmSkJtcfWo7c42KnL5hho6GFxK6HRNV91XABx1P7xDtfLV\"]},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0x91e0bd6a6762d2a1700dab0849de8422611355100576c4beef1e80d82a4104a0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://73bbd77af0a8b07255d2ffa20728bcf13b116007c9ddac5d37046cfabb0e1e02\",\"dweb:/ipfs/QmRgZgWCWCSMTTaok6o4QvWA6MgB4goS8qpb3sN7bAvaZ9\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x5c26b39d26f7ed489e555d955dcd3e01872972e71fdd1528e93ec164e4f23385\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://efdc632af6960cf865dbc113665ea1f5b90eab75cc40ec062b2f6ae6da582017\",\"dweb:/ipfs/QmfAZFDuG62vxmAN9DnXApv7e7PMzPqi4RkqqZHLMSQiY5\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xf5fa8cbdffa5ef8be49b246b5628facc30b71707e78a45d80d93b64eff3fe390\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://774e78a9ff32792cc95db4d2ceaf3a7965bb7f0bea5e6cb7cff182b450d44b37\",\"dweb:/ipfs/QmRRMC4uj7eAcLW7chynA3sNEYULMFazdLwQHKHQPyzAbA\"]},\"project:/contracts/interfaces/curve/ICurve.sol\":{\"keccak256\":\"0x9e3eb4830baa051648e505de0eb31b517f84c10109a13285f219bafbbce4425a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1c88db4a8b700a4de178805cebb9a23b8c2bfbaaac932c943cb9a205a1440602\",\"dweb:/ipfs/QmdpAhgyaRxbmog5QtFpRKUTccFseRrryTrff7qWAjjQhY\"]},\"project:/contracts/swappa/ISwappaPairV1.sol\":{\"keccak256\":\"0x3ad68981bda91ed83c5e9ee8617f08bb5e208208477fb755cc77077f127010ab\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e4390b1bebc39f58bff34b9099a646ead67cef27b722ef61548487251cca719\",\"dweb:/ipfs/QmRWEuYyjHaS957VKWtTfDpzfqkXb2bvEsS33meAC76ZuU\"]},\"project:/contracts/swappa/PairCurve.sol\":{\"keccak256\":\"0x16dffe7193c9052c461cdca6725de457919659a0b838f59033e61b2f53f5fb1d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6d17bd302e9932eed98e7dd2c40b84a70d53790868dbe226d5a1027313900616\",\"dweb:/ipfs/Qmd1YFDUnvLuRkqYW4tw7fMCWYbMcuBJ98cEYqzvdCHYau\"]}},\"version\":1}",
    "bytecode": "0x608060405234801561001057600080fd5b5061088d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806332ef83141461003b5780637eace892146100db575b600080fd5b6100d96004803603608081101561005157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235811692602081013582169260408201359092169181019060808101606082013564010000000081111561009a57600080fd5b8201836020820111156100ac57600080fd5b803590602001918460018302840111640100000000831117156100ce57600080fd5b50909250905061018a565b005b610178600480360360808110156100f157600080fd5b73ffffffffffffffffffffffffffffffffffffffff82358116926020810135909116916040820135919081019060808101606082013564010000000081111561013957600080fd5b82018360208201111561014b57600080fd5b8035906020019184600183028401116401000000008311171561016d57600080fd5b509092509050610555565b60408051918252519081900360200190f35b60006101cb83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061065392505050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561023d57600080fd5b505afa158015610251573d6000803e3d6000fd5b505050506040513d602081101561026757600080fd5b5051604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301526024820184905291519293509089169163095ea7b3916044808201926020929091908290030181600087803b1580156102e557600080fd5b505af11580156102f9573d6000803e3d6000fd5b505050506040513d602081101561030f57600080fd5b505161037c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5061697243757276653a20617070726f7665206661696c656421000000000000604482015290519081900360640190fd5b8160008061038b838b8b6106cd565b9150915060008373ffffffffffffffffffffffffffffffffffffffff16633df0212484848860006040518563ffffffff1660e01b81526004018085600f0b600f0b815260200184600f0b600f0b8152602001838152602001828152602001945050505050602060405180830381600087803b15801561040957600080fd5b505af115801561041d573d6000803e3d6000fd5b505050506040513d602081101561043357600080fd5b5051604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c81166004830152602482018490529151929350908c169163a9059cbb916044808201926020929091908290030181600087803b1580156104b157600080fd5b505af11580156104c5573d6000803e3d6000fd5b505050506040513d60208110156104db57600080fd5b505161054857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5061697243757276653a207472616e73666572206661696c6564210000000000604482015290519081900360640190fd5b5050505050505050505050565b60008061059784848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061065392505050565b9050806000806105a8838b8b6106cd565b915091508273ffffffffffffffffffffffffffffffffffffffff16635e0d443f83838b6040518463ffffffff1660e01b81526004018084600f0b600f0b815260200183600f0b600f0b8152602001828152602001935050505060206040518083038186803b15801561061957600080fd5b505afa15801561062d573d6000803e3d6000fd5b505050506040513d602081101561064357600080fd5b50519a9950505050505050505050565b600081516014146106c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f5061697243757276653a20696e76616c69642064617461210000000000000000604482015290519081900360640190fd5b506014015190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060005b60048160ff16101561084e5782600f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14158015610754575081600f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b1561075e5761084e565b60008673ffffffffffffffffffffffffffffffffffffffff1663c6610657836040518263ffffffff1660e01b8152600401808260ff16815260200191505060206040518083038186803b1580156107b457600080fd5b505afa1580156107c8573d6000803e3d6000fd5b505050506040513d60208110156107de57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff808216908716141561080a578160ff1693505b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610845578160ff1692505b506001016106f2565b5093509391505056fea2646970667358221220283e86dd73e84b8ad73557984a4a222bede1b9d48b9a335da3826017d5e380ae64736f6c63430006080033",
    "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806332ef83141461003b5780637eace892146100db575b600080fd5b6100d96004803603608081101561005157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235811692602081013582169260408201359092169181019060808101606082013564010000000081111561009a57600080fd5b8201836020820111156100ac57600080fd5b803590602001918460018302840111640100000000831117156100ce57600080fd5b50909250905061018a565b005b610178600480360360808110156100f157600080fd5b73ffffffffffffffffffffffffffffffffffffffff82358116926020810135909116916040820135919081019060808101606082013564010000000081111561013957600080fd5b82018360208201111561014b57600080fd5b8035906020019184600183028401116401000000008311171561016d57600080fd5b509092509050610555565b60408051918252519081900360200190f35b60006101cb83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061065392505050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561023d57600080fd5b505afa158015610251573d6000803e3d6000fd5b505050506040513d602081101561026757600080fd5b5051604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301526024820184905291519293509089169163095ea7b3916044808201926020929091908290030181600087803b1580156102e557600080fd5b505af11580156102f9573d6000803e3d6000fd5b505050506040513d602081101561030f57600080fd5b505161037c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5061697243757276653a20617070726f7665206661696c656421000000000000604482015290519081900360640190fd5b8160008061038b838b8b6106cd565b9150915060008373ffffffffffffffffffffffffffffffffffffffff16633df0212484848860006040518563ffffffff1660e01b81526004018085600f0b600f0b815260200184600f0b600f0b8152602001838152602001828152602001945050505050602060405180830381600087803b15801561040957600080fd5b505af115801561041d573d6000803e3d6000fd5b505050506040513d602081101561043357600080fd5b5051604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c81166004830152602482018490529151929350908c169163a9059cbb916044808201926020929091908290030181600087803b1580156104b157600080fd5b505af11580156104c5573d6000803e3d6000fd5b505050506040513d60208110156104db57600080fd5b505161054857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5061697243757276653a207472616e73666572206661696c6564210000000000604482015290519081900360640190fd5b5050505050505050505050565b60008061059784848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061065392505050565b9050806000806105a8838b8b6106cd565b915091508273ffffffffffffffffffffffffffffffffffffffff16635e0d443f83838b6040518463ffffffff1660e01b81526004018084600f0b600f0b815260200183600f0b600f0b8152602001828152602001935050505060206040518083038186803b15801561061957600080fd5b505afa15801561062d573d6000803e3d6000fd5b505050506040513d602081101561064357600080fd5b50519a9950505050505050505050565b600081516014146106c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f5061697243757276653a20696e76616c69642064617461210000000000000000604482015290519081900360640190fd5b506014015190565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060005b60048160ff16101561084e5782600f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14158015610754575081600f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b1561075e5761084e565b60008673ffffffffffffffffffffffffffffffffffffffff1663c6610657836040518263ffffffff1660e01b8152600401808260ff16815260200191505060206040518083038186803b1580156107b457600080fd5b505afa1580156107c8573d6000803e3d6000fd5b505050506040513d60208110156107de57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff808216908716141561080a578160ff1693505b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610845578160ff1692505b506001016106f2565b5093509391505056fea2646970667358221220283e86dd73e84b8ad73557984a4a222bede1b9d48b9a335da3826017d5e380ae64736f6c63430006080033",
    "immutableReferences": {},
    "sourceMap": "237:1946:50:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;237:1946:50;;;;;;;",
    "deployedSourceMap": "237:1946:50:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;237:1946:50;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;306:636:50;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;306:636:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:11:-1;11:28;;8:2;;;52:1;49;42:12;8:2;306:636:50;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;306:636:50;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;306:636:50;;-1:-1:-1;306:636:50;-1:-1:-1;306:636:50;:::i;:::-;;1156:384;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;1156:384:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:11:-1;11:28;;8:2;;;52:1;49;42:12;8:2;1156:384:50;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;1156:384:50;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;1156:384:50;;-1:-1:-1;1156:384:50;-1:-1:-1;1156:384:50;:::i;:::-;;;;;;;;;;;;;;;;306:636;417:20;440:15;450:4;;440:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;440:9:50;;-1:-1:-1;;;440:15:50:i;:::-;481:37;;;;;;512:4;481:37;;;;;;417:38;;-1:-1:-1;459:19:50;;481:22;;;;;;:37;;;;;;;;;;;;;;:22;:37;;;2:2:-1;;;;27:1;24;17:12;2:2;481:37:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;481:37:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;481:37:50;534:47;;;;;;:20;:47;;;;;;;;;;;;;;;481:37;;-1:-1:-1;534:20:50;;;;;;:47;;;;;481:37;;534:47;;;;;;;;-1:-1:-1;534:20:50;:47;;;2:2:-1;;;;27:1;24;17:12;2:2;534:47:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;534:47:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;534:47:50;522:96;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;647:12;622:15;;697:55;647:12;732:5;742:6;697:17;:55::i;:::-;664:88;;;;756:20;779:8;:17;;;801:7;813:5;823:11;839:1;779:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;779:65:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;779:65:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;779:65:50;860:40;;;;;;:22;:40;;;;;;;;;;;;;;;779:65;;-1:-1:-1;860:22:50;;;;;;:40;;;;;779:65;;860:40;;;;;;;;-1:-1:-1;860:22:50;:40;;;2:2:-1;;;;27:1;24;17:12;2:2;860:40:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;860:40:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;860:40:50;848:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;306:636;;;;;;;;;;;:::o;1156:384::-;1289:17;1312:20;1335:15;1345:4;;1335:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;1335:9:50;;-1:-1:-1;;;1335:15:50:i;:::-;1312:38;-1:-1:-1;1312:38:50;1354:15;;1429:55;1312:38;1464:5;1474:6;1429:17;:55::i;:::-;1396:88;;;;1495:8;:15;;;1511:7;1520:5;1527:8;1495:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1495:41:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1495:41:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1495:41:50;;1156:384;-1:-1:-1;;;;;;;;;;1156:384:50:o;945:208::-;1011:20;1046:4;:11;1061:2;1046:17;1038:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1142:2:50;1132:13;1126:20;;1105:45::o;1546:635::-;1750:2;;1673:14;1808:367;1828:1;1822:3;:7;;;1808:367;;;1856:7;:13;;1867:2;1856:13;;:28;;;;;1873:5;:11;;1882:2;1873:11;;1856:28;1852:110;;;1942:5;;1852:110;1975:12;1990:8;:14;;;2005:3;1990:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1990:19:50;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1990:19:50;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1990:19:50;;-1:-1:-1;2027:13:50;;;;;;;;2023:65;;;2070:3;2060:13;;;;2023:65;2113:6;2105:14;;:4;:14;;;2101:64;;;2147:3;2139:11;;;;2101:64;-1:-1:-1;1831:5:50;;1808:367;;;1546:635;;;;;;;:::o",
    "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.6.8;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"../interfaces/curve/ICurve.sol\";\nimport \"./ISwappaPairV1.sol\";\n\ncontract PairCurve is ISwappaPairV1 {\n\tusing SafeMath for uint256;\n\n\tfunction swap(\n\t\taddress input,\n\t\taddress output,\n\t\taddress to,\n\t\tbytes calldata data\n\t) external override {\n\t\taddress swapPoolAddr = parseData(data);\n\t\tuint256 inputAmount = ERC20(input).balanceOf(address(this));\n\t\trequire(\n\t\t\tERC20(input).approve(swapPoolAddr, inputAmount),\n\t\t\t\"PairCurve: approve failed!\"\n\t\t);\n\t\tICurve swapPool = ICurve(swapPoolAddr);\n\t\t(int128 fromIdx, int128 toIdx) = getInputOutputIdx(\n\t\t\tswapPool,\n\t\t\tinput,\n\t\t\toutput\n\t\t);\n\t\tuint256 outputAmount = swapPool.exchange(\n\t\t\tfromIdx,\n\t\t\ttoIdx,\n\t\t\tinputAmount,\n\t\t\t0\n\t\t);\n\t\trequire(\n\t\t\tERC20(output).transfer(to, outputAmount),\n\t\t\t\"PairCurve: transfer failed!\"\n\t\t);\n\t}\n\n\tfunction parseData(bytes memory data)\n\t\tprivate\n\t\tpure\n\t\treturns (address swapPoolAddr)\n\t{\n\t\trequire(data.length == 20, \"PairCurve: invalid data!\");\n\t\tassembly {\n\t\t\tswapPoolAddr := mload(add(data, 20))\n\t\t}\n\t}\n\n\tfunction getOutputAmount(\n\t\taddress input,\n\t\taddress output,\n\t\tuint256 amountIn,\n\t\tbytes calldata data\n\t) external override returns (uint256 amountOut) {\n\t\taddress swapPoolAddr = parseData(data);\n\t\tICurve swapPool = ICurve(swapPoolAddr);\n\t\t(int128 fromIdx, int128 toIdx) = getInputOutputIdx(\n\t\t\tswapPool,\n\t\t\tinput,\n\t\t\toutput\n\t\t);\n\t\treturn swapPool.get_dy(fromIdx, toIdx, amountIn);\n\t}\n\n    function getInputOutputIdx(\n        ICurve swapPool,\n        address input,\n        address output\n    ) private view returns (int128 fromIdx, int128 toIdx) {\n        uint8 idx;\n        fromIdx = toIdx = -1;\n        // curve pool contain at most 4 coins\n        for (idx = 0; idx < 4; idx++) {\n            if (fromIdx != -1 && toIdx != -1) {\n                // found coin indices\n                break;\n            }\n            address coin = swapPool.coins(idx);\n            if (coin == input) {\n                fromIdx = idx;\n            }\n            if (coin == output) {\n                toIdx = idx;\n            }\n        }\n    }\n}\n",
    "sourcePath": "/home/thezviad_gmail_com/src/swappa/contracts/swappa/PairCurve.sol",
    "ast": {
        "absolutePath": "project:/contracts/swappa/PairCurve.sol",
        "exportedSymbols": {
            "PairCurve": [
                6085
            ]
        },
        "id": 6086,
        "license": "MIT",
        "nodeType": "SourceUnit",
        "nodes": [
            {
                "id": 5862,
                "literals": [
                    "solidity",
                    "^",
                    "0.6",
                    ".8"
                ],
                "nodeType": "PragmaDirective",
                "src": "32:23:50"
            },
            {
                "absolutePath": "@openzeppelin/contracts/math/SafeMath.sol",
                "file": "@openzeppelin/contracts/math/SafeMath.sol",
                "id": 5863,
                "nodeType": "ImportDirective",
                "scope": 6086,
                "sourceUnit": 219,
                "src": "57:51:50",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "absolutePath": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
                "file": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
                "id": 5864,
                "nodeType": "ImportDirective",
                "scope": 6086,
                "sourceUnit": 726,
                "src": "109:55:50",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "absolutePath": "project:/contracts/interfaces/curve/ICurve.sol",
                "file": "../interfaces/curve/ICurve.sol",
                "id": 5865,
                "nodeType": "ImportDirective",
                "scope": 6086,
                "sourceUnit": 1545,
                "src": "165:40:50",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "absolutePath": "project:/contracts/swappa/ISwappaPairV1.sol",
                "file": "./ISwappaPairV1.sol",
                "id": 5866,
                "nodeType": "ImportDirective",
                "scope": 6086,
                "sourceUnit": 5326,
                "src": "206:29:50",
                "symbolAliases": [],
                "unitAlias": ""
            },
            {
                "abstract": false,
                "baseContracts": [
                    {
                        "arguments": null,
                        "baseName": {
                            "contractScope": null,
                            "id": 5867,
                            "name": "ISwappaPairV1",
                            "nodeType": "UserDefinedTypeName",
                            "referencedDeclaration": 5325,
                            "src": "259:13:50",
                            "typeDescriptions": {
                                "typeIdentifier": "t_contract$_ISwappaPairV1_$5325",
                                "typeString": "contract ISwappaPairV1"
                            }
                        },
                        "id": 5868,
                        "nodeType": "InheritanceSpecifier",
                        "src": "259:13:50"
                    }
                ],
                "contractDependencies": [
                    5325
                ],
                "contractKind": "contract",
                "documentation": null,
                "fullyImplemented": true,
                "id": 6085,
                "linearizedBaseContracts": [
                    6085,
                    5325
                ],
                "name": "PairCurve",
                "nodeType": "ContractDefinition",
                "nodes": [
                    {
                        "id": 5871,
                        "libraryName": {
                            "contractScope": null,
                            "id": 5869,
                            "name": "SafeMath",
                            "nodeType": "UserDefinedTypeName",
                            "referencedDeclaration": 218,
                            "src": "282:8:50",
                            "typeDescriptions": {
                                "typeIdentifier": "t_contract$_SafeMath_$218",
                                "typeString": "library SafeMath"
                            }
                        },
                        "nodeType": "UsingForDirective",
                        "src": "276:27:50",
                        "typeName": {
                            "id": 5870,
                            "name": "uint256",
                            "nodeType": "ElementaryTypeName",
                            "src": "295:7:50",
                            "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                            }
                        }
                    },
                    {
                        "baseFunctions": [
                            5311
                        ],
                        "body": {
                            "id": 5949,
                            "nodeType": "Block",
                            "src": "413:529:50",
                            "statements": [
                                {
                                    "assignments": [
                                        5884
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5884,
                                            "mutability": "mutable",
                                            "name": "swapPoolAddr",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "417:20:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            },
                                            "typeName": {
                                                "id": 5883,
                                                "name": "address",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "417:7:50",
                                                "stateMutability": "nonpayable",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5888,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5886,
                                                "name": "data",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5879,
                                                "src": "450:4:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                    "typeString": "bytes calldata"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                    "typeString": "bytes calldata"
                                                }
                                            ],
                                            "id": 5885,
                                            "name": "parseData",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 5967,
                                            "src": "440:9:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_address_$",
                                                "typeString": "function (bytes memory) pure returns (address)"
                                            }
                                        },
                                        "id": 5887,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "440:15:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "417:38:50"
                                },
                                {
                                    "assignments": [
                                        5890
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5890,
                                            "mutability": "mutable",
                                            "name": "inputAmount",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "459:19:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                            },
                                            "typeName": {
                                                "id": 5889,
                                                "name": "uint256",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "459:7:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5900,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "arguments": [
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5897,
                                                        "name": "this",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": -28,
                                                        "src": "512:4:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_contract$_PairCurve_$6085",
                                                            "typeString": "contract PairCurve"
                                                        }
                                                    }
                                                ],
                                                "expression": {
                                                    "argumentTypes": [
                                                        {
                                                            "typeIdentifier": "t_contract$_PairCurve_$6085",
                                                            "typeString": "contract PairCurve"
                                                        }
                                                    ],
                                                    "id": 5896,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": true,
                                                    "lValueRequested": false,
                                                    "nodeType": "ElementaryTypeNameExpression",
                                                    "src": "504:7:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_type$_t_address_$",
                                                        "typeString": "type(address)"
                                                    },
                                                    "typeName": {
                                                        "id": 5895,
                                                        "name": "address",
                                                        "nodeType": "ElementaryTypeName",
                                                        "src": "504:7:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": null,
                                                            "typeString": null
                                                        }
                                                    }
                                                },
                                                "id": 5898,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "kind": "typeConversion",
                                                "lValueRequested": false,
                                                "names": [],
                                                "nodeType": "FunctionCall",
                                                "src": "504:13:50",
                                                "tryCall": false,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            ],
                                            "expression": {
                                                "argumentTypes": null,
                                                "arguments": [
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5892,
                                                        "name": "input",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5873,
                                                        "src": "487:5:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    }
                                                ],
                                                "expression": {
                                                    "argumentTypes": [
                                                        {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    ],
                                                    "id": 5891,
                                                    "name": "ERC20",
                                                    "nodeType": "Identifier",
                                                    "overloadedDeclarations": [],
                                                    "referencedDeclaration": 725,
                                                    "src": "481:5:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_type$_t_contract$_ERC20_$725_$",
                                                        "typeString": "type(contract ERC20)"
                                                    }
                                                },
                                                "id": 5893,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "kind": "typeConversion",
                                                "lValueRequested": false,
                                                "names": [],
                                                "nodeType": "FunctionCall",
                                                "src": "481:12:50",
                                                "tryCall": false,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ERC20_$725",
                                                    "typeString": "contract ERC20"
                                                }
                                            },
                                            "id": 5894,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "balanceOf",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 325,
                                            "src": "481:22:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
                                                "typeString": "function (address) view external returns (uint256)"
                                            }
                                        },
                                        "id": 5899,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "481:37:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "459:59:50"
                                },
                                {
                                    "expression": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "arguments": [
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5906,
                                                        "name": "swapPoolAddr",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5884,
                                                        "src": "555:12:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5907,
                                                        "name": "inputAmount",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5890,
                                                        "src": "569:11:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_uint256",
                                                            "typeString": "uint256"
                                                        }
                                                    }
                                                ],
                                                "expression": {
                                                    "argumentTypes": [
                                                        {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        },
                                                        {
                                                            "typeIdentifier": "t_uint256",
                                                            "typeString": "uint256"
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": null,
                                                        "arguments": [
                                                            {
                                                                "argumentTypes": null,
                                                                "id": 5903,
                                                                "name": "input",
                                                                "nodeType": "Identifier",
                                                                "overloadedDeclarations": [],
                                                                "referencedDeclaration": 5873,
                                                                "src": "540:5:50",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            }
                                                        ],
                                                        "expression": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "id": 5902,
                                                            "name": "ERC20",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 725,
                                                            "src": "534:5:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_type$_t_contract$_ERC20_$725_$",
                                                                "typeString": "type(contract ERC20)"
                                                            }
                                                        },
                                                        "id": 5904,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "kind": "typeConversion",
                                                        "lValueRequested": false,
                                                        "names": [],
                                                        "nodeType": "FunctionCall",
                                                        "src": "534:12:50",
                                                        "tryCall": false,
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_contract$_ERC20_$725",
                                                            "typeString": "contract ERC20"
                                                        }
                                                    },
                                                    "id": 5905,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "memberName": "approve",
                                                    "nodeType": "MemberAccess",
                                                    "referencedDeclaration": 385,
                                                    "src": "534:20:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
                                                        "typeString": "function (address,uint256) external returns (bool)"
                                                    }
                                                },
                                                "id": 5908,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "kind": "functionCall",
                                                "lValueRequested": false,
                                                "names": [],
                                                "nodeType": "FunctionCall",
                                                "src": "534:47:50",
                                                "tryCall": false,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "hexValue": "5061697243757276653a20617070726f7665206661696c656421",
                                                "id": 5909,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "kind": "string",
                                                "lValueRequested": false,
                                                "nodeType": "Literal",
                                                "src": "586:28:50",
                                                "subdenomination": null,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_stringliteral_f45c90037d0958f6ad6114184549698690c0fce5d9e7f92af353db2bbe9f2f70",
                                                    "typeString": "literal_string \"PairCurve: approve failed!\""
                                                },
                                                "value": "PairCurve: approve failed!"
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                },
                                                {
                                                    "typeIdentifier": "t_stringliteral_f45c90037d0958f6ad6114184549698690c0fce5d9e7f92af353db2bbe9f2f70",
                                                    "typeString": "literal_string \"PairCurve: approve failed!\""
                                                }
                                            ],
                                            "id": 5901,
                                            "name": "require",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [
                                                -18,
                                                -18
                                            ],
                                            "referencedDeclaration": -18,
                                            "src": "522:7:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                                                "typeString": "function (bool,string memory) pure"
                                            }
                                        },
                                        "id": 5910,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "522:96:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_tuple$__$",
                                            "typeString": "tuple()"
                                        }
                                    },
                                    "id": 5911,
                                    "nodeType": "ExpressionStatement",
                                    "src": "522:96:50"
                                },
                                {
                                    "assignments": [
                                        5913
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5913,
                                            "mutability": "mutable",
                                            "name": "swapPool",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "622:15:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_contract$_ICurve_$1544",
                                                "typeString": "contract ICurve"
                                            },
                                            "typeName": {
                                                "contractScope": null,
                                                "id": 5912,
                                                "name": "ICurve",
                                                "nodeType": "UserDefinedTypeName",
                                                "referencedDeclaration": 1544,
                                                "src": "622:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5917,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5915,
                                                "name": "swapPoolAddr",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5884,
                                                "src": "647:12:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            ],
                                            "id": 5914,
                                            "name": "ICurve",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1544,
                                            "src": "640:6:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_type$_t_contract$_ICurve_$1544_$",
                                                "typeString": "type(contract ICurve)"
                                            }
                                        },
                                        "id": 5916,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "typeConversion",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "640:20:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_contract$_ICurve_$1544",
                                            "typeString": "contract ICurve"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "622:38:50"
                                },
                                {
                                    "assignments": [
                                        5919,
                                        5921
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5919,
                                            "mutability": "mutable",
                                            "name": "fromIdx",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "665:14:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            },
                                            "typeName": {
                                                "id": 5918,
                                                "name": "int128",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "665:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        {
                                            "constant": false,
                                            "id": 5921,
                                            "mutability": "mutable",
                                            "name": "toIdx",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "681:12:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            },
                                            "typeName": {
                                                "id": 5920,
                                                "name": "int128",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "681:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5927,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5923,
                                                "name": "swapPool",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5913,
                                                "src": "719:8:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 5924,
                                                "name": "input",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5873,
                                                "src": "732:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 5925,
                                                "name": "output",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5875,
                                                "src": "742:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                },
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                },
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            ],
                                            "id": 5922,
                                            "name": "getInputOutputIdx",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 6084,
                                            "src": "697:17:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_internal_view$_t_contract$_ICurve_$1544_$_t_address_$_t_address_$returns$_t_int128_$_t_int128_$",
                                                "typeString": "function (contract ICurve,address,address) view returns (int128,int128)"
                                            }
                                        },
                                        "id": 5926,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "697:55:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_tuple$_t_int128_$_t_int128_$",
                                            "typeString": "tuple(int128,int128)"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "664:88:50"
                                },
                                {
                                    "assignments": [
                                        5929
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5929,
                                            "mutability": "mutable",
                                            "name": "outputAmount",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 5949,
                                            "src": "756:20:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                            },
                                            "typeName": {
                                                "id": 5928,
                                                "name": "uint256",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "756:7:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5937,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5932,
                                                "name": "fromIdx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5919,
                                                "src": "801:7:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 5933,
                                                "name": "toIdx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5921,
                                                "src": "813:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 5934,
                                                "name": "inputAmount",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5890,
                                                "src": "823:11:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "hexValue": "30",
                                                "id": 5935,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "kind": "number",
                                                "lValueRequested": false,
                                                "nodeType": "Literal",
                                                "src": "839:1:50",
                                                "subdenomination": null,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_rational_0_by_1",
                                                    "typeString": "int_const 0"
                                                },
                                                "value": "0"
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                },
                                                {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                },
                                                {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                },
                                                {
                                                    "typeIdentifier": "t_rational_0_by_1",
                                                    "typeString": "int_const 0"
                                                }
                                            ],
                                            "expression": {
                                                "argumentTypes": null,
                                                "id": 5930,
                                                "name": "swapPool",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5913,
                                                "src": "779:8:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            "id": 5931,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "exchange",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 1527,
                                            "src": "779:17:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_external_nonpayable$_t_int128_$_t_int128_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                                "typeString": "function (int128,int128,uint256,uint256) external returns (uint256)"
                                            }
                                        },
                                        "id": 5936,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "779:65:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "756:88:50"
                                },
                                {
                                    "expression": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "arguments": [
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5943,
                                                        "name": "to",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5877,
                                                        "src": "883:2:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    {
                                                        "argumentTypes": null,
                                                        "id": 5944,
                                                        "name": "outputAmount",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5929,
                                                        "src": "887:12:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_uint256",
                                                            "typeString": "uint256"
                                                        }
                                                    }
                                                ],
                                                "expression": {
                                                    "argumentTypes": [
                                                        {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        },
                                                        {
                                                            "typeIdentifier": "t_uint256",
                                                            "typeString": "uint256"
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": null,
                                                        "arguments": [
                                                            {
                                                                "argumentTypes": null,
                                                                "id": 5940,
                                                                "name": "output",
                                                                "nodeType": "Identifier",
                                                                "overloadedDeclarations": [],
                                                                "referencedDeclaration": 5875,
                                                                "src": "866:6:50",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            }
                                                        ],
                                                        "expression": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "id": 5939,
                                                            "name": "ERC20",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 725,
                                                            "src": "860:5:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_type$_t_contract$_ERC20_$725_$",
                                                                "typeString": "type(contract ERC20)"
                                                            }
                                                        },
                                                        "id": 5941,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "kind": "typeConversion",
                                                        "lValueRequested": false,
                                                        "names": [],
                                                        "nodeType": "FunctionCall",
                                                        "src": "860:13:50",
                                                        "tryCall": false,
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_contract$_ERC20_$725",
                                                            "typeString": "contract ERC20"
                                                        }
                                                    },
                                                    "id": 5942,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "memberName": "transfer",
                                                    "nodeType": "MemberAccess",
                                                    "referencedDeclaration": 346,
                                                    "src": "860:22:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$",
                                                        "typeString": "function (address,uint256) external returns (bool)"
                                                    }
                                                },
                                                "id": 5945,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "kind": "functionCall",
                                                "lValueRequested": false,
                                                "names": [],
                                                "nodeType": "FunctionCall",
                                                "src": "860:40:50",
                                                "tryCall": false,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "hexValue": "5061697243757276653a207472616e73666572206661696c656421",
                                                "id": 5946,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "kind": "string",
                                                "lValueRequested": false,
                                                "nodeType": "Literal",
                                                "src": "905:29:50",
                                                "subdenomination": null,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_stringliteral_9bdcee1997e408c6c127235b0677e6c10fa6f38a518199ee7e4a26f846bf5885",
                                                    "typeString": "literal_string \"PairCurve: transfer failed!\""
                                                },
                                                "value": "PairCurve: transfer failed!"
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                },
                                                {
                                                    "typeIdentifier": "t_stringliteral_9bdcee1997e408c6c127235b0677e6c10fa6f38a518199ee7e4a26f846bf5885",
                                                    "typeString": "literal_string \"PairCurve: transfer failed!\""
                                                }
                                            ],
                                            "id": 5938,
                                            "name": "require",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [
                                                -18,
                                                -18
                                            ],
                                            "referencedDeclaration": -18,
                                            "src": "848:7:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                                                "typeString": "function (bool,string memory) pure"
                                            }
                                        },
                                        "id": 5947,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "848:90:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_tuple$__$",
                                            "typeString": "tuple()"
                                        }
                                    },
                                    "id": 5948,
                                    "nodeType": "ExpressionStatement",
                                    "src": "848:90:50"
                                }
                            ]
                        },
                        "documentation": null,
                        "functionSelector": "32ef8314",
                        "id": 5950,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "swap",
                        "nodeType": "FunctionDefinition",
                        "overrides": {
                            "id": 5881,
                            "nodeType": "OverrideSpecifier",
                            "overrides": [],
                            "src": "404:8:50"
                        },
                        "parameters": {
                            "id": 5880,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 5873,
                                    "mutability": "mutable",
                                    "name": "input",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5950,
                                    "src": "323:13:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5872,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "323:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5875,
                                    "mutability": "mutable",
                                    "name": "output",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5950,
                                    "src": "340:14:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5874,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "340:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5877,
                                    "mutability": "mutable",
                                    "name": "to",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5950,
                                    "src": "358:10:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5876,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "358:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5879,
                                    "mutability": "mutable",
                                    "name": "data",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5950,
                                    "src": "372:19:50",
                                    "stateVariable": false,
                                    "storageLocation": "calldata",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_bytes_calldata_ptr",
                                        "typeString": "bytes"
                                    },
                                    "typeName": {
                                        "id": 5878,
                                        "name": "bytes",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "372:5:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bytes_storage_ptr",
                                            "typeString": "bytes"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "319:75:50"
                        },
                        "returnParameters": {
                            "id": 5882,
                            "nodeType": "ParameterList",
                            "parameters": [],
                            "src": "413:0:50"
                        },
                        "scope": 6085,
                        "src": "306:636:50",
                        "stateMutability": "nonpayable",
                        "virtual": false,
                        "visibility": "external"
                    },
                    {
                        "body": {
                            "id": 5966,
                            "nodeType": "Block",
                            "src": "1034:119:50",
                            "statements": [
                                {
                                    "expression": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "commonType": {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                },
                                                "id": 5961,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "lValueRequested": false,
                                                "leftExpression": {
                                                    "argumentTypes": null,
                                                    "expression": {
                                                        "argumentTypes": null,
                                                        "id": 5958,
                                                        "name": "data",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 5952,
                                                        "src": "1046:4:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_bytes_memory_ptr",
                                                            "typeString": "bytes memory"
                                                        }
                                                    },
                                                    "id": 5959,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "memberName": "length",
                                                    "nodeType": "MemberAccess",
                                                    "referencedDeclaration": null,
                                                    "src": "1046:11:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_uint256",
                                                        "typeString": "uint256"
                                                    }
                                                },
                                                "nodeType": "BinaryOperation",
                                                "operator": "==",
                                                "rightExpression": {
                                                    "argumentTypes": null,
                                                    "hexValue": "3230",
                                                    "id": 5960,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": true,
                                                    "kind": "number",
                                                    "lValueRequested": false,
                                                    "nodeType": "Literal",
                                                    "src": "1061:2:50",
                                                    "subdenomination": null,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_rational_20_by_1",
                                                        "typeString": "int_const 20"
                                                    },
                                                    "value": "20"
                                                },
                                                "src": "1046:17:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "hexValue": "5061697243757276653a20696e76616c6964206461746121",
                                                "id": 5962,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "kind": "string",
                                                "lValueRequested": false,
                                                "nodeType": "Literal",
                                                "src": "1065:26:50",
                                                "subdenomination": null,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_stringliteral_777d8255f673776d22a0d7fde49d7b7af3af8a4f0f5085651c5484bf11d8b1d5",
                                                    "typeString": "literal_string \"PairCurve: invalid data!\""
                                                },
                                                "value": "PairCurve: invalid data!"
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_bool",
                                                    "typeString": "bool"
                                                },
                                                {
                                                    "typeIdentifier": "t_stringliteral_777d8255f673776d22a0d7fde49d7b7af3af8a4f0f5085651c5484bf11d8b1d5",
                                                    "typeString": "literal_string \"PairCurve: invalid data!\""
                                                }
                                            ],
                                            "id": 5957,
                                            "name": "require",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [
                                                -18,
                                                -18
                                            ],
                                            "referencedDeclaration": -18,
                                            "src": "1038:7:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                                                "typeString": "function (bool,string memory) pure"
                                            }
                                        },
                                        "id": 5963,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "1038:54:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_tuple$__$",
                                            "typeString": "tuple()"
                                        }
                                    },
                                    "id": 5964,
                                    "nodeType": "ExpressionStatement",
                                    "src": "1038:54:50"
                                },
                                {
                                    "AST": {
                                        "nodeType": "YulBlock",
                                        "src": "1105:45:50",
                                        "statements": [
                                            {
                                                "nodeType": "YulAssignment",
                                                "src": "1110:36:50",
                                                "value": {
                                                    "arguments": [
                                                        {
                                                            "arguments": [
                                                                {
                                                                    "name": "data",
                                                                    "nodeType": "YulIdentifier",
                                                                    "src": "1136:4:50"
                                                                },
                                                                {
                                                                    "kind": "number",
                                                                    "nodeType": "YulLiteral",
                                                                    "src": "1142:2:50",
                                                                    "type": "",
                                                                    "value": "20"
                                                                }
                                                            ],
                                                            "functionName": {
                                                                "name": "add",
                                                                "nodeType": "YulIdentifier",
                                                                "src": "1132:3:50"
                                                            },
                                                            "nodeType": "YulFunctionCall",
                                                            "src": "1132:13:50"
                                                        }
                                                    ],
                                                    "functionName": {
                                                        "name": "mload",
                                                        "nodeType": "YulIdentifier",
                                                        "src": "1126:5:50"
                                                    },
                                                    "nodeType": "YulFunctionCall",
                                                    "src": "1126:20:50"
                                                },
                                                "variableNames": [
                                                    {
                                                        "name": "swapPoolAddr",
                                                        "nodeType": "YulIdentifier",
                                                        "src": "1110:12:50"
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    "evmVersion": "istanbul",
                                    "externalReferences": [
                                        {
                                            "declaration": 5952,
                                            "isOffset": false,
                                            "isSlot": false,
                                            "src": "1136:4:50",
                                            "valueSize": 1
                                        },
                                        {
                                            "declaration": 5955,
                                            "isOffset": false,
                                            "isSlot": false,
                                            "src": "1110:12:50",
                                            "valueSize": 1
                                        }
                                    ],
                                    "id": 5965,
                                    "nodeType": "InlineAssembly",
                                    "src": "1096:54:50"
                                }
                            ]
                        },
                        "documentation": null,
                        "id": 5967,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "parseData",
                        "nodeType": "FunctionDefinition",
                        "overrides": null,
                        "parameters": {
                            "id": 5953,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 5952,
                                    "mutability": "mutable",
                                    "name": "data",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5967,
                                    "src": "964:17:50",
                                    "stateVariable": false,
                                    "storageLocation": "memory",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_bytes_memory_ptr",
                                        "typeString": "bytes"
                                    },
                                    "typeName": {
                                        "id": 5951,
                                        "name": "bytes",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "964:5:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bytes_storage_ptr",
                                            "typeString": "bytes"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "963:19:50"
                        },
                        "returnParameters": {
                            "id": 5956,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 5955,
                                    "mutability": "mutable",
                                    "name": "swapPoolAddr",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 5967,
                                    "src": "1011:20:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5954,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1011:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1010:22:50"
                        },
                        "scope": 6085,
                        "src": "945:208:50",
                        "stateMutability": "pure",
                        "virtual": false,
                        "visibility": "private"
                    },
                    {
                        "baseFunctions": [
                            5324
                        ],
                        "body": {
                            "id": 6010,
                            "nodeType": "Block",
                            "src": "1308:232:50",
                            "statements": [
                                {
                                    "assignments": [
                                        5982
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5982,
                                            "mutability": "mutable",
                                            "name": "swapPoolAddr",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 6010,
                                            "src": "1312:20:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_address",
                                                "typeString": "address"
                                            },
                                            "typeName": {
                                                "id": 5981,
                                                "name": "address",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "1312:7:50",
                                                "stateMutability": "nonpayable",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5986,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5984,
                                                "name": "data",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5975,
                                                "src": "1345:4:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                    "typeString": "bytes calldata"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                    "typeString": "bytes calldata"
                                                }
                                            ],
                                            "id": 5983,
                                            "name": "parseData",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 5967,
                                            "src": "1335:9:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_address_$",
                                                "typeString": "function (bytes memory) pure returns (address)"
                                            }
                                        },
                                        "id": 5985,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "1335:15:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "1312:38:50"
                                },
                                {
                                    "assignments": [
                                        5988
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5988,
                                            "mutability": "mutable",
                                            "name": "swapPool",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 6010,
                                            "src": "1354:15:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_contract$_ICurve_$1544",
                                                "typeString": "contract ICurve"
                                            },
                                            "typeName": {
                                                "contractScope": null,
                                                "id": 5987,
                                                "name": "ICurve",
                                                "nodeType": "UserDefinedTypeName",
                                                "referencedDeclaration": 1544,
                                                "src": "1354:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 5992,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5990,
                                                "name": "swapPoolAddr",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5982,
                                                "src": "1379:12:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            ],
                                            "id": 5989,
                                            "name": "ICurve",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 1544,
                                            "src": "1372:6:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_type$_t_contract$_ICurve_$1544_$",
                                                "typeString": "type(contract ICurve)"
                                            }
                                        },
                                        "id": 5991,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "typeConversion",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "1372:20:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_contract$_ICurve_$1544",
                                            "typeString": "contract ICurve"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "1354:38:50"
                                },
                                {
                                    "assignments": [
                                        5994,
                                        5996
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 5994,
                                            "mutability": "mutable",
                                            "name": "fromIdx",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 6010,
                                            "src": "1397:14:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            },
                                            "typeName": {
                                                "id": 5993,
                                                "name": "int128",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "1397:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        {
                                            "constant": false,
                                            "id": 5996,
                                            "mutability": "mutable",
                                            "name": "toIdx",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 6010,
                                            "src": "1413:12:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            },
                                            "typeName": {
                                                "id": 5995,
                                                "name": "int128",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "1413:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 6002,
                                    "initialValue": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 5998,
                                                "name": "swapPool",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5988,
                                                "src": "1451:8:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 5999,
                                                "name": "input",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5969,
                                                "src": "1464:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 6000,
                                                "name": "output",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5971,
                                                "src": "1474:6:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                },
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                },
                                                {
                                                    "typeIdentifier": "t_address",
                                                    "typeString": "address"
                                                }
                                            ],
                                            "id": 5997,
                                            "name": "getInputOutputIdx",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 6084,
                                            "src": "1429:17:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_internal_view$_t_contract$_ICurve_$1544_$_t_address_$_t_address_$returns$_t_int128_$_t_int128_$",
                                                "typeString": "function (contract ICurve,address,address) view returns (int128,int128)"
                                            }
                                        },
                                        "id": 6001,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "1429:55:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_tuple$_t_int128_$_t_int128_$",
                                            "typeString": "tuple(int128,int128)"
                                        }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "1396:88:50"
                                },
                                {
                                    "expression": {
                                        "argumentTypes": null,
                                        "arguments": [
                                            {
                                                "argumentTypes": null,
                                                "id": 6005,
                                                "name": "fromIdx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5994,
                                                "src": "1511:7:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 6006,
                                                "name": "toIdx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5996,
                                                "src": "1520:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            {
                                                "argumentTypes": null,
                                                "id": 6007,
                                                "name": "amountIn",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5973,
                                                "src": "1527:8:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                }
                                            }
                                        ],
                                        "expression": {
                                            "argumentTypes": [
                                                {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                },
                                                {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                },
                                                {
                                                    "typeIdentifier": "t_uint256",
                                                    "typeString": "uint256"
                                                }
                                            ],
                                            "expression": {
                                                "argumentTypes": null,
                                                "id": 6003,
                                                "name": "swapPool",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 5988,
                                                "src": "1495:8:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                    "typeString": "contract ICurve"
                                                }
                                            },
                                            "id": 6004,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "get_dy",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 1538,
                                            "src": "1495:15:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_function_external_view$_t_int128_$_t_int128_$_t_uint256_$returns$_t_uint256_$",
                                                "typeString": "function (int128,int128,uint256) view external returns (uint256)"
                                            }
                                        },
                                        "id": 6008,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "kind": "functionCall",
                                        "lValueRequested": false,
                                        "names": [],
                                        "nodeType": "FunctionCall",
                                        "src": "1495:41:50",
                                        "tryCall": false,
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "functionReturnParameters": 5980,
                                    "id": 6009,
                                    "nodeType": "Return",
                                    "src": "1488:48:50"
                                }
                            ]
                        },
                        "documentation": null,
                        "functionSelector": "7eace892",
                        "id": 6011,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "getOutputAmount",
                        "nodeType": "FunctionDefinition",
                        "overrides": {
                            "id": 5977,
                            "nodeType": "OverrideSpecifier",
                            "overrides": [],
                            "src": "1271:8:50"
                        },
                        "parameters": {
                            "id": 5976,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 5969,
                                    "mutability": "mutable",
                                    "name": "input",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6011,
                                    "src": "1184:13:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5968,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1184:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5971,
                                    "mutability": "mutable",
                                    "name": "output",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6011,
                                    "src": "1201:14:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 5970,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1201:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5973,
                                    "mutability": "mutable",
                                    "name": "amountIn",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6011,
                                    "src": "1219:16:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                    },
                                    "typeName": {
                                        "id": 5972,
                                        "name": "uint256",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1219:7:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 5975,
                                    "mutability": "mutable",
                                    "name": "data",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6011,
                                    "src": "1239:19:50",
                                    "stateVariable": false,
                                    "storageLocation": "calldata",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_bytes_calldata_ptr",
                                        "typeString": "bytes"
                                    },
                                    "typeName": {
                                        "id": 5974,
                                        "name": "bytes",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1239:5:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bytes_storage_ptr",
                                            "typeString": "bytes"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1180:81:50"
                        },
                        "returnParameters": {
                            "id": 5980,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 5979,
                                    "mutability": "mutable",
                                    "name": "amountOut",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6011,
                                    "src": "1289:17:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                    },
                                    "typeName": {
                                        "id": 5978,
                                        "name": "uint256",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1289:7:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1288:19:50"
                        },
                        "scope": 6085,
                        "src": "1156:384:50",
                        "stateMutability": "nonpayable",
                        "virtual": false,
                        "visibility": "external"
                    },
                    {
                        "body": {
                            "id": 6083,
                            "nodeType": "Block",
                            "src": "1703:478:50",
                            "statements": [
                                {
                                    "assignments": [
                                        6025
                                    ],
                                    "declarations": [
                                        {
                                            "constant": false,
                                            "id": 6025,
                                            "mutability": "mutable",
                                            "name": "idx",
                                            "nodeType": "VariableDeclaration",
                                            "overrides": null,
                                            "scope": 6083,
                                            "src": "1713:9:50",
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint8",
                                                "typeString": "uint8"
                                            },
                                            "typeName": {
                                                "id": 6024,
                                                "name": "uint8",
                                                "nodeType": "ElementaryTypeName",
                                                "src": "1713:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint8",
                                                    "typeString": "uint8"
                                                }
                                            },
                                            "value": null,
                                            "visibility": "internal"
                                        }
                                    ],
                                    "id": 6026,
                                    "initialValue": null,
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "1713:9:50"
                                },
                                {
                                    "expression": {
                                        "argumentTypes": null,
                                        "id": 6032,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftHandSide": {
                                            "argumentTypes": null,
                                            "id": 6027,
                                            "name": "fromIdx",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 6020,
                                            "src": "1732:7:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            }
                                        },
                                        "nodeType": "Assignment",
                                        "operator": "=",
                                        "rightHandSide": {
                                            "argumentTypes": null,
                                            "id": 6031,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "leftHandSide": {
                                                "argumentTypes": null,
                                                "id": 6028,
                                                "name": "toIdx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 6022,
                                                "src": "1742:5:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_int128",
                                                    "typeString": "int128"
                                                }
                                            },
                                            "nodeType": "Assignment",
                                            "operator": "=",
                                            "rightHandSide": {
                                                "argumentTypes": null,
                                                "id": 6030,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "lValueRequested": false,
                                                "nodeType": "UnaryOperation",
                                                "operator": "-",
                                                "prefix": true,
                                                "src": "1750:2:50",
                                                "subExpression": {
                                                    "argumentTypes": null,
                                                    "hexValue": "31",
                                                    "id": 6029,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": true,
                                                    "kind": "number",
                                                    "lValueRequested": false,
                                                    "nodeType": "Literal",
                                                    "src": "1751:1:50",
                                                    "subdenomination": null,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_rational_1_by_1",
                                                        "typeString": "int_const 1"
                                                    },
                                                    "value": "1"
                                                },
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_rational_minus_1_by_1",
                                                    "typeString": "int_const -1"
                                                }
                                            },
                                            "src": "1742:10:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_int128",
                                                "typeString": "int128"
                                            }
                                        },
                                        "src": "1732:20:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_int128",
                                            "typeString": "int128"
                                        }
                                    },
                                    "id": 6033,
                                    "nodeType": "ExpressionStatement",
                                    "src": "1732:20:50"
                                },
                                {
                                    "body": {
                                        "id": 6081,
                                        "nodeType": "Block",
                                        "src": "1838:337:50",
                                        "statements": [
                                            {
                                                "condition": {
                                                    "argumentTypes": null,
                                                    "commonType": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    },
                                                    "id": 6052,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "leftExpression": {
                                                        "argumentTypes": null,
                                                        "commonType": {
                                                            "typeIdentifier": "t_int128",
                                                            "typeString": "int128"
                                                        },
                                                        "id": 6047,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "lValueRequested": false,
                                                        "leftExpression": {
                                                            "argumentTypes": null,
                                                            "id": 6044,
                                                            "name": "fromIdx",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 6020,
                                                            "src": "1856:7:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_int128",
                                                                "typeString": "int128"
                                                            }
                                                        },
                                                        "nodeType": "BinaryOperation",
                                                        "operator": "!=",
                                                        "rightExpression": {
                                                            "argumentTypes": null,
                                                            "id": 6046,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "nodeType": "UnaryOperation",
                                                            "operator": "-",
                                                            "prefix": true,
                                                            "src": "1867:2:50",
                                                            "subExpression": {
                                                                "argumentTypes": null,
                                                                "hexValue": "31",
                                                                "id": 6045,
                                                                "isConstant": false,
                                                                "isLValue": false,
                                                                "isPure": true,
                                                                "kind": "number",
                                                                "lValueRequested": false,
                                                                "nodeType": "Literal",
                                                                "src": "1868:1:50",
                                                                "subdenomination": null,
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_rational_1_by_1",
                                                                    "typeString": "int_const 1"
                                                                },
                                                                "value": "1"
                                                            },
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_rational_minus_1_by_1",
                                                                "typeString": "int_const -1"
                                                            }
                                                        },
                                                        "src": "1856:13:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_bool",
                                                            "typeString": "bool"
                                                        }
                                                    },
                                                    "nodeType": "BinaryOperation",
                                                    "operator": "&&",
                                                    "rightExpression": {
                                                        "argumentTypes": null,
                                                        "commonType": {
                                                            "typeIdentifier": "t_int128",
                                                            "typeString": "int128"
                                                        },
                                                        "id": 6051,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "lValueRequested": false,
                                                        "leftExpression": {
                                                            "argumentTypes": null,
                                                            "id": 6048,
                                                            "name": "toIdx",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 6022,
                                                            "src": "1873:5:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_int128",
                                                                "typeString": "int128"
                                                            }
                                                        },
                                                        "nodeType": "BinaryOperation",
                                                        "operator": "!=",
                                                        "rightExpression": {
                                                            "argumentTypes": null,
                                                            "id": 6050,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "nodeType": "UnaryOperation",
                                                            "operator": "-",
                                                            "prefix": true,
                                                            "src": "1882:2:50",
                                                            "subExpression": {
                                                                "argumentTypes": null,
                                                                "hexValue": "31",
                                                                "id": 6049,
                                                                "isConstant": false,
                                                                "isLValue": false,
                                                                "isPure": true,
                                                                "kind": "number",
                                                                "lValueRequested": false,
                                                                "nodeType": "Literal",
                                                                "src": "1883:1:50",
                                                                "subdenomination": null,
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_rational_1_by_1",
                                                                    "typeString": "int_const 1"
                                                                },
                                                                "value": "1"
                                                            },
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_rational_minus_1_by_1",
                                                                "typeString": "int_const -1"
                                                            }
                                                        },
                                                        "src": "1873:11:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_bool",
                                                            "typeString": "bool"
                                                        }
                                                    },
                                                    "src": "1856:28:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    }
                                                },
                                                "falseBody": null,
                                                "id": 6055,
                                                "nodeType": "IfStatement",
                                                "src": "1852:110:50",
                                                "trueBody": {
                                                    "id": 6054,
                                                    "nodeType": "Block",
                                                    "src": "1886:76:50",
                                                    "statements": [
                                                        {
                                                            "id": 6053,
                                                            "nodeType": "Break",
                                                            "src": "1942:5:50"
                                                        }
                                                    ]
                                                }
                                            },
                                            {
                                                "assignments": [
                                                    6057
                                                ],
                                                "declarations": [
                                                    {
                                                        "constant": false,
                                                        "id": 6057,
                                                        "mutability": "mutable",
                                                        "name": "coin",
                                                        "nodeType": "VariableDeclaration",
                                                        "overrides": null,
                                                        "scope": 6081,
                                                        "src": "1975:12:50",
                                                        "stateVariable": false,
                                                        "storageLocation": "default",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        },
                                                        "typeName": {
                                                            "id": 6056,
                                                            "name": "address",
                                                            "nodeType": "ElementaryTypeName",
                                                            "src": "1975:7:50",
                                                            "stateMutability": "nonpayable",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_address",
                                                                "typeString": "address"
                                                            }
                                                        },
                                                        "value": null,
                                                        "visibility": "internal"
                                                    }
                                                ],
                                                "id": 6062,
                                                "initialValue": {
                                                    "argumentTypes": null,
                                                    "arguments": [
                                                        {
                                                            "argumentTypes": null,
                                                            "id": 6060,
                                                            "name": "idx",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 6025,
                                                            "src": "2005:3:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_uint8",
                                                                "typeString": "uint8"
                                                            }
                                                        }
                                                    ],
                                                    "expression": {
                                                        "argumentTypes": [
                                                            {
                                                                "typeIdentifier": "t_uint8",
                                                                "typeString": "uint8"
                                                            }
                                                        ],
                                                        "expression": {
                                                            "argumentTypes": null,
                                                            "id": 6058,
                                                            "name": "swapPool",
                                                            "nodeType": "Identifier",
                                                            "overloadedDeclarations": [],
                                                            "referencedDeclaration": 6013,
                                                            "src": "1990:8:50",
                                                            "typeDescriptions": {
                                                                "typeIdentifier": "t_contract$_ICurve_$1544",
                                                                "typeString": "contract ICurve"
                                                            }
                                                        },
                                                        "id": 6059,
                                                        "isConstant": false,
                                                        "isLValue": false,
                                                        "isPure": false,
                                                        "lValueRequested": false,
                                                        "memberName": "coins",
                                                        "nodeType": "MemberAccess",
                                                        "referencedDeclaration": 1507,
                                                        "src": "1990:14:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_address_$",
                                                            "typeString": "function (uint256) view external returns (address)"
                                                        }
                                                    },
                                                    "id": 6061,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "kind": "functionCall",
                                                    "lValueRequested": false,
                                                    "names": [],
                                                    "nodeType": "FunctionCall",
                                                    "src": "1990:19:50",
                                                    "tryCall": false,
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_address",
                                                        "typeString": "address"
                                                    }
                                                },
                                                "nodeType": "VariableDeclarationStatement",
                                                "src": "1975:34:50"
                                            },
                                            {
                                                "condition": {
                                                    "argumentTypes": null,
                                                    "commonType": {
                                                        "typeIdentifier": "t_address",
                                                        "typeString": "address"
                                                    },
                                                    "id": 6065,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "leftExpression": {
                                                        "argumentTypes": null,
                                                        "id": 6063,
                                                        "name": "coin",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 6057,
                                                        "src": "2027:4:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    "nodeType": "BinaryOperation",
                                                    "operator": "==",
                                                    "rightExpression": {
                                                        "argumentTypes": null,
                                                        "id": 6064,
                                                        "name": "input",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 6015,
                                                        "src": "2035:5:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    "src": "2027:13:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    }
                                                },
                                                "falseBody": null,
                                                "id": 6071,
                                                "nodeType": "IfStatement",
                                                "src": "2023:65:50",
                                                "trueBody": {
                                                    "id": 6070,
                                                    "nodeType": "Block",
                                                    "src": "2042:46:50",
                                                    "statements": [
                                                        {
                                                            "expression": {
                                                                "argumentTypes": null,
                                                                "id": 6068,
                                                                "isConstant": false,
                                                                "isLValue": false,
                                                                "isPure": false,
                                                                "lValueRequested": false,
                                                                "leftHandSide": {
                                                                    "argumentTypes": null,
                                                                    "id": 6066,
                                                                    "name": "fromIdx",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 6020,
                                                                    "src": "2060:7:50",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_int128",
                                                                        "typeString": "int128"
                                                                    }
                                                                },
                                                                "nodeType": "Assignment",
                                                                "operator": "=",
                                                                "rightHandSide": {
                                                                    "argumentTypes": null,
                                                                    "id": 6067,
                                                                    "name": "idx",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 6025,
                                                                    "src": "2070:3:50",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_uint8",
                                                                        "typeString": "uint8"
                                                                    }
                                                                },
                                                                "src": "2060:13:50",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                }
                                                            },
                                                            "id": 6069,
                                                            "nodeType": "ExpressionStatement",
                                                            "src": "2060:13:50"
                                                        }
                                                    ]
                                                }
                                            },
                                            {
                                                "condition": {
                                                    "argumentTypes": null,
                                                    "commonType": {
                                                        "typeIdentifier": "t_address",
                                                        "typeString": "address"
                                                    },
                                                    "id": 6074,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "leftExpression": {
                                                        "argumentTypes": null,
                                                        "id": 6072,
                                                        "name": "coin",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 6057,
                                                        "src": "2105:4:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    "nodeType": "BinaryOperation",
                                                    "operator": "==",
                                                    "rightExpression": {
                                                        "argumentTypes": null,
                                                        "id": 6073,
                                                        "name": "output",
                                                        "nodeType": "Identifier",
                                                        "overloadedDeclarations": [],
                                                        "referencedDeclaration": 6017,
                                                        "src": "2113:6:50",
                                                        "typeDescriptions": {
                                                            "typeIdentifier": "t_address",
                                                            "typeString": "address"
                                                        }
                                                    },
                                                    "src": "2105:14:50",
                                                    "typeDescriptions": {
                                                        "typeIdentifier": "t_bool",
                                                        "typeString": "bool"
                                                    }
                                                },
                                                "falseBody": null,
                                                "id": 6080,
                                                "nodeType": "IfStatement",
                                                "src": "2101:64:50",
                                                "trueBody": {
                                                    "id": 6079,
                                                    "nodeType": "Block",
                                                    "src": "2121:44:50",
                                                    "statements": [
                                                        {
                                                            "expression": {
                                                                "argumentTypes": null,
                                                                "id": 6077,
                                                                "isConstant": false,
                                                                "isLValue": false,
                                                                "isPure": false,
                                                                "lValueRequested": false,
                                                                "leftHandSide": {
                                                                    "argumentTypes": null,
                                                                    "id": 6075,
                                                                    "name": "toIdx",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 6022,
                                                                    "src": "2139:5:50",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_int128",
                                                                        "typeString": "int128"
                                                                    }
                                                                },
                                                                "nodeType": "Assignment",
                                                                "operator": "=",
                                                                "rightHandSide": {
                                                                    "argumentTypes": null,
                                                                    "id": 6076,
                                                                    "name": "idx",
                                                                    "nodeType": "Identifier",
                                                                    "overloadedDeclarations": [],
                                                                    "referencedDeclaration": 6025,
                                                                    "src": "2147:3:50",
                                                                    "typeDescriptions": {
                                                                        "typeIdentifier": "t_uint8",
                                                                        "typeString": "uint8"
                                                                    }
                                                                },
                                                                "src": "2139:11:50",
                                                                "typeDescriptions": {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                }
                                                            },
                                                            "id": 6078,
                                                            "nodeType": "ExpressionStatement",
                                                            "src": "2139:11:50"
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    },
                                    "condition": {
                                        "argumentTypes": null,
                                        "commonType": {
                                            "typeIdentifier": "t_uint8",
                                            "typeString": "uint8"
                                        },
                                        "id": 6040,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                            "argumentTypes": null,
                                            "id": 6038,
                                            "name": "idx",
                                            "nodeType": "Identifier",
                                            "overloadedDeclarations": [],
                                            "referencedDeclaration": 6025,
                                            "src": "1822:3:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint8",
                                                "typeString": "uint8"
                                            }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "<",
                                        "rightExpression": {
                                            "argumentTypes": null,
                                            "hexValue": "34",
                                            "id": 6039,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": true,
                                            "kind": "number",
                                            "lValueRequested": false,
                                            "nodeType": "Literal",
                                            "src": "1828:1:50",
                                            "subdenomination": null,
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_rational_4_by_1",
                                                "typeString": "int_const 4"
                                            },
                                            "value": "4"
                                        },
                                        "src": "1822:7:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_bool",
                                            "typeString": "bool"
                                        }
                                    },
                                    "id": 6082,
                                    "initializationExpression": {
                                        "expression": {
                                            "argumentTypes": null,
                                            "id": 6036,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "leftHandSide": {
                                                "argumentTypes": null,
                                                "id": 6034,
                                                "name": "idx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 6025,
                                                "src": "1813:3:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint8",
                                                    "typeString": "uint8"
                                                }
                                            },
                                            "nodeType": "Assignment",
                                            "operator": "=",
                                            "rightHandSide": {
                                                "argumentTypes": null,
                                                "hexValue": "30",
                                                "id": 6035,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "kind": "number",
                                                "lValueRequested": false,
                                                "nodeType": "Literal",
                                                "src": "1819:1:50",
                                                "subdenomination": null,
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_rational_0_by_1",
                                                    "typeString": "int_const 0"
                                                },
                                                "value": "0"
                                            },
                                            "src": "1813:7:50",
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint8",
                                                "typeString": "uint8"
                                            }
                                        },
                                        "id": 6037,
                                        "nodeType": "ExpressionStatement",
                                        "src": "1813:7:50"
                                    },
                                    "loopExpression": {
                                        "expression": {
                                            "argumentTypes": null,
                                            "id": 6042,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "nodeType": "UnaryOperation",
                                            "operator": "++",
                                            "prefix": false,
                                            "src": "1831:5:50",
                                            "subExpression": {
                                                "argumentTypes": null,
                                                "id": 6041,
                                                "name": "idx",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 6025,
                                                "src": "1831:3:50",
                                                "typeDescriptions": {
                                                    "typeIdentifier": "t_uint8",
                                                    "typeString": "uint8"
                                                }
                                            },
                                            "typeDescriptions": {
                                                "typeIdentifier": "t_uint8",
                                                "typeString": "uint8"
                                            }
                                        },
                                        "id": 6043,
                                        "nodeType": "ExpressionStatement",
                                        "src": "1831:5:50"
                                    },
                                    "nodeType": "ForStatement",
                                    "src": "1808:367:50"
                                }
                            ]
                        },
                        "documentation": null,
                        "id": 6084,
                        "implemented": true,
                        "kind": "function",
                        "modifiers": [],
                        "name": "getInputOutputIdx",
                        "nodeType": "FunctionDefinition",
                        "overrides": null,
                        "parameters": {
                            "id": 6018,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 6013,
                                    "mutability": "mutable",
                                    "name": "swapPool",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6084,
                                    "src": "1582:15:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_contract$_ICurve_$1544",
                                        "typeString": "contract ICurve"
                                    },
                                    "typeName": {
                                        "contractScope": null,
                                        "id": 6012,
                                        "name": "ICurve",
                                        "nodeType": "UserDefinedTypeName",
                                        "referencedDeclaration": 1544,
                                        "src": "1582:6:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_contract$_ICurve_$1544",
                                            "typeString": "contract ICurve"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 6015,
                                    "mutability": "mutable",
                                    "name": "input",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6084,
                                    "src": "1607:13:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 6014,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1607:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 6017,
                                    "mutability": "mutable",
                                    "name": "output",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6084,
                                    "src": "1630:14:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_address",
                                        "typeString": "address"
                                    },
                                    "typeName": {
                                        "id": 6016,
                                        "name": "address",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1630:7:50",
                                        "stateMutability": "nonpayable",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_address",
                                            "typeString": "address"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1572:78:50"
                        },
                        "returnParameters": {
                            "id": 6023,
                            "nodeType": "ParameterList",
                            "parameters": [
                                {
                                    "constant": false,
                                    "id": 6020,
                                    "mutability": "mutable",
                                    "name": "fromIdx",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6084,
                                    "src": "1673:14:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_int128",
                                        "typeString": "int128"
                                    },
                                    "typeName": {
                                        "id": 6019,
                                        "name": "int128",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1673:6:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_int128",
                                            "typeString": "int128"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                },
                                {
                                    "constant": false,
                                    "id": 6022,
                                    "mutability": "mutable",
                                    "name": "toIdx",
                                    "nodeType": "VariableDeclaration",
                                    "overrides": null,
                                    "scope": 6084,
                                    "src": "1689:12:50",
                                    "stateVariable": false,
                                    "storageLocation": "default",
                                    "typeDescriptions": {
                                        "typeIdentifier": "t_int128",
                                        "typeString": "int128"
                                    },
                                    "typeName": {
                                        "id": 6021,
                                        "name": "int128",
                                        "nodeType": "ElementaryTypeName",
                                        "src": "1689:6:50",
                                        "typeDescriptions": {
                                            "typeIdentifier": "t_int128",
                                            "typeString": "int128"
                                        }
                                    },
                                    "value": null,
                                    "visibility": "internal"
                                }
                            ],
                            "src": "1672:30:50"
                        },
                        "scope": 6085,
                        "src": "1546:635:50",
                        "stateMutability": "view",
                        "virtual": false,
                        "visibility": "private"
                    }
                ],
                "scope": 6086,
                "src": "237:1946:50"
            }
        ],
        "src": "32:2152:50"
    },
    "legacyAST": {
        "attributes": {
            "absolutePath": "project:/contracts/swappa/PairCurve.sol",
            "exportedSymbols": {
                "PairCurve": [
                    6085
                ]
            },
            "license": "MIT"
        },
        "children": [
            {
                "attributes": {
                    "literals": [
                        "solidity",
                        "^",
                        "0.6",
                        ".8"
                    ]
                },
                "id": 5862,
                "name": "PragmaDirective",
                "src": "32:23:50"
            },
            {
                "attributes": {
                    "SourceUnit": 219,
                    "absolutePath": "@openzeppelin/contracts/math/SafeMath.sol",
                    "file": "@openzeppelin/contracts/math/SafeMath.sol",
                    "scope": 6086,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 5863,
                "name": "ImportDirective",
                "src": "57:51:50"
            },
            {
                "attributes": {
                    "SourceUnit": 726,
                    "absolutePath": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
                    "file": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
                    "scope": 6086,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 5864,
                "name": "ImportDirective",
                "src": "109:55:50"
            },
            {
                "attributes": {
                    "SourceUnit": 1545,
                    "absolutePath": "project:/contracts/interfaces/curve/ICurve.sol",
                    "file": "../interfaces/curve/ICurve.sol",
                    "scope": 6086,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 5865,
                "name": "ImportDirective",
                "src": "165:40:50"
            },
            {
                "attributes": {
                    "SourceUnit": 5326,
                    "absolutePath": "project:/contracts/swappa/ISwappaPairV1.sol",
                    "file": "./ISwappaPairV1.sol",
                    "scope": 6086,
                    "symbolAliases": [
                        null
                    ],
                    "unitAlias": ""
                },
                "id": 5866,
                "name": "ImportDirective",
                "src": "206:29:50"
            },
            {
                "attributes": {
                    "abstract": false,
                    "contractDependencies": [
                        5325
                    ],
                    "contractKind": "contract",
                    "documentation": null,
                    "fullyImplemented": true,
                    "linearizedBaseContracts": [
                        6085,
                        5325
                    ],
                    "name": "PairCurve",
                    "scope": 6086
                },
                "children": [
                    {
                        "attributes": {
                            "arguments": null
                        },
                        "children": [
                            {
                                "attributes": {
                                    "contractScope": null,
                                    "name": "ISwappaPairV1",
                                    "referencedDeclaration": 5325,
                                    "type": "contract ISwappaPairV1"
                                },
                                "id": 5867,
                                "name": "UserDefinedTypeName",
                                "src": "259:13:50"
                            }
                        ],
                        "id": 5868,
                        "name": "InheritanceSpecifier",
                        "src": "259:13:50"
                    },
                    {
                        "children": [
                            {
                                "attributes": {
                                    "contractScope": null,
                                    "name": "SafeMath",
                                    "referencedDeclaration": 218,
                                    "type": "library SafeMath"
                                },
                                "id": 5869,
                                "name": "UserDefinedTypeName",
                                "src": "282:8:50"
                            },
                            {
                                "attributes": {
                                    "name": "uint256",
                                    "type": "uint256"
                                },
                                "id": 5870,
                                "name": "ElementaryTypeName",
                                "src": "295:7:50"
                            }
                        ],
                        "id": 5871,
                        "name": "UsingForDirective",
                        "src": "276:27:50"
                    },
                    {
                        "attributes": {
                            "baseFunctions": [
                                5311
                            ],
                            "documentation": null,
                            "functionSelector": "32ef8314",
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "swap",
                            "scope": 6085,
                            "stateMutability": "nonpayable",
                            "virtual": false,
                            "visibility": "external"
                        },
                        "children": [
                            {
                                "attributes": {
                                    "overrides": [
                                        null
                                    ]
                                },
                                "id": 5881,
                                "name": "OverrideSpecifier",
                                "src": "404:8:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "input",
                                            "overrides": null,
                                            "scope": 5950,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5872,
                                                "name": "ElementaryTypeName",
                                                "src": "323:7:50"
                                            }
                                        ],
                                        "id": 5873,
                                        "name": "VariableDeclaration",
                                        "src": "323:13:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "output",
                                            "overrides": null,
                                            "scope": 5950,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5874,
                                                "name": "ElementaryTypeName",
                                                "src": "340:7:50"
                                            }
                                        ],
                                        "id": 5875,
                                        "name": "VariableDeclaration",
                                        "src": "340:14:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "to",
                                            "overrides": null,
                                            "scope": 5950,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5876,
                                                "name": "ElementaryTypeName",
                                                "src": "358:7:50"
                                            }
                                        ],
                                        "id": 5877,
                                        "name": "VariableDeclaration",
                                        "src": "358:10:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "data",
                                            "overrides": null,
                                            "scope": 5950,
                                            "stateVariable": false,
                                            "storageLocation": "calldata",
                                            "type": "bytes",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "bytes",
                                                    "type": "bytes"
                                                },
                                                "id": 5878,
                                                "name": "ElementaryTypeName",
                                                "src": "372:5:50"
                                            }
                                        ],
                                        "id": 5879,
                                        "name": "VariableDeclaration",
                                        "src": "372:19:50"
                                    }
                                ],
                                "id": 5880,
                                "name": "ParameterList",
                                "src": "319:75:50"
                            },
                            {
                                "attributes": {
                                    "parameters": [
                                        null
                                    ]
                                },
                                "children": [],
                                "id": 5882,
                                "name": "ParameterList",
                                "src": "413:0:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5884
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "swapPoolAddr",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "address",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "address",
                                                            "stateMutability": "nonpayable",
                                                            "type": "address"
                                                        },
                                                        "id": 5883,
                                                        "name": "ElementaryTypeName",
                                                        "src": "417:7:50"
                                                    }
                                                ],
                                                "id": 5884,
                                                "name": "VariableDeclaration",
                                                "src": "417:20:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "address",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                                    "typeString": "bytes calldata"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5967,
                                                            "type": "function (bytes memory) pure returns (address)",
                                                            "value": "parseData"
                                                        },
                                                        "id": 5885,
                                                        "name": "Identifier",
                                                        "src": "440:9:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5879,
                                                            "type": "bytes calldata",
                                                            "value": "data"
                                                        },
                                                        "id": 5886,
                                                        "name": "Identifier",
                                                        "src": "450:4:50"
                                                    }
                                                ],
                                                "id": 5887,
                                                "name": "FunctionCall",
                                                "src": "440:15:50"
                                            }
                                        ],
                                        "id": 5888,
                                        "name": "VariableDeclarationStatement",
                                        "src": "417:38:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5890
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "inputAmount",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "uint256",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "uint256",
                                                            "type": "uint256"
                                                        },
                                                        "id": 5889,
                                                        "name": "ElementaryTypeName",
                                                        "src": "459:7:50"
                                                    }
                                                ],
                                                "id": 5890,
                                                "name": "VariableDeclaration",
                                                "src": "459:19:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "uint256",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "member_name": "balanceOf",
                                                            "referencedDeclaration": 325,
                                                            "type": "function (address) view external returns (uint256)"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "isStructConstructorCall": false,
                                                                    "lValueRequested": false,
                                                                    "names": [
                                                                        null
                                                                    ],
                                                                    "tryCall": false,
                                                                    "type": "contract ERC20",
                                                                    "type_conversion": true
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": [
                                                                                {
                                                                                    "typeIdentifier": "t_address",
                                                                                    "typeString": "address"
                                                                                }
                                                                            ],
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 725,
                                                                            "type": "type(contract ERC20)",
                                                                            "value": "ERC20"
                                                                        },
                                                                        "id": 5891,
                                                                        "name": "Identifier",
                                                                        "src": "481:5:50"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 5873,
                                                                            "type": "address",
                                                                            "value": "input"
                                                                        },
                                                                        "id": 5892,
                                                                        "name": "Identifier",
                                                                        "src": "487:5:50"
                                                                    }
                                                                ],
                                                                "id": 5893,
                                                                "name": "FunctionCall",
                                                                "src": "481:12:50"
                                                            }
                                                        ],
                                                        "id": 5894,
                                                        "name": "MemberAccess",
                                                        "src": "481:22:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "isStructConstructorCall": false,
                                                            "lValueRequested": false,
                                                            "names": [
                                                                null
                                                            ],
                                                            "tryCall": false,
                                                            "type": "address",
                                                            "type_conversion": true
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": [
                                                                        {
                                                                            "typeIdentifier": "t_contract$_PairCurve_$6085",
                                                                            "typeString": "contract PairCurve"
                                                                        }
                                                                    ],
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": true,
                                                                    "lValueRequested": false,
                                                                    "type": "type(address)"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "name": "address",
                                                                            "type": null
                                                                        },
                                                                        "id": 5895,
                                                                        "name": "ElementaryTypeName",
                                                                        "src": "504:7:50"
                                                                    }
                                                                ],
                                                                "id": 5896,
                                                                "name": "ElementaryTypeNameExpression",
                                                                "src": "504:7:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": -28,
                                                                    "type": "contract PairCurve",
                                                                    "value": "this"
                                                                },
                                                                "id": 5897,
                                                                "name": "Identifier",
                                                                "src": "512:4:50"
                                                            }
                                                        ],
                                                        "id": 5898,
                                                        "name": "FunctionCall",
                                                        "src": "504:13:50"
                                                    }
                                                ],
                                                "id": 5899,
                                                "name": "FunctionCall",
                                                "src": "481:37:50"
                                            }
                                        ],
                                        "id": 5900,
                                        "name": "VariableDeclarationStatement",
                                        "src": "459:59:50"
                                    },
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "tuple()",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_bool",
                                                                    "typeString": "bool"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_stringliteral_f45c90037d0958f6ad6114184549698690c0fce5d9e7f92af353db2bbe9f2f70",
                                                                    "typeString": "literal_string \"PairCurve: approve failed!\""
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                -18,
                                                                -18
                                                            ],
                                                            "referencedDeclaration": -18,
                                                            "type": "function (bool,string memory) pure",
                                                            "value": "require"
                                                        },
                                                        "id": 5901,
                                                        "name": "Identifier",
                                                        "src": "522:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "isStructConstructorCall": false,
                                                            "lValueRequested": false,
                                                            "names": [
                                                                null
                                                            ],
                                                            "tryCall": false,
                                                            "type": "bool",
                                                            "type_conversion": false
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": [
                                                                        {
                                                                            "typeIdentifier": "t_address",
                                                                            "typeString": "address"
                                                                        },
                                                                        {
                                                                            "typeIdentifier": "t_uint256",
                                                                            "typeString": "uint256"
                                                                        }
                                                                    ],
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "member_name": "approve",
                                                                    "referencedDeclaration": 385,
                                                                    "type": "function (address,uint256) external returns (bool)"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "isStructConstructorCall": false,
                                                                            "lValueRequested": false,
                                                                            "names": [
                                                                                null
                                                                            ],
                                                                            "tryCall": false,
                                                                            "type": "contract ERC20",
                                                                            "type_conversion": true
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": [
                                                                                        {
                                                                                            "typeIdentifier": "t_address",
                                                                                            "typeString": "address"
                                                                                        }
                                                                                    ],
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 725,
                                                                                    "type": "type(contract ERC20)",
                                                                                    "value": "ERC20"
                                                                                },
                                                                                "id": 5902,
                                                                                "name": "Identifier",
                                                                                "src": "534:5:50"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 5873,
                                                                                    "type": "address",
                                                                                    "value": "input"
                                                                                },
                                                                                "id": 5903,
                                                                                "name": "Identifier",
                                                                                "src": "540:5:50"
                                                                            }
                                                                        ],
                                                                        "id": 5904,
                                                                        "name": "FunctionCall",
                                                                        "src": "534:12:50"
                                                                    }
                                                                ],
                                                                "id": 5905,
                                                                "name": "MemberAccess",
                                                                "src": "534:20:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5884,
                                                                    "type": "address",
                                                                    "value": "swapPoolAddr"
                                                                },
                                                                "id": 5906,
                                                                "name": "Identifier",
                                                                "src": "555:12:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5890,
                                                                    "type": "uint256",
                                                                    "value": "inputAmount"
                                                                },
                                                                "id": 5907,
                                                                "name": "Identifier",
                                                                "src": "569:11:50"
                                                            }
                                                        ],
                                                        "id": 5908,
                                                        "name": "FunctionCall",
                                                        "src": "534:47:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "hexvalue": "5061697243757276653a20617070726f7665206661696c656421",
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "subdenomination": null,
                                                            "token": "string",
                                                            "type": "literal_string \"PairCurve: approve failed!\"",
                                                            "value": "PairCurve: approve failed!"
                                                        },
                                                        "id": 5909,
                                                        "name": "Literal",
                                                        "src": "586:28:50"
                                                    }
                                                ],
                                                "id": 5910,
                                                "name": "FunctionCall",
                                                "src": "522:96:50"
                                            }
                                        ],
                                        "id": 5911,
                                        "name": "ExpressionStatement",
                                        "src": "522:96:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5913
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "swapPool",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "contract ICurve",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "contractScope": null,
                                                            "name": "ICurve",
                                                            "referencedDeclaration": 1544,
                                                            "type": "contract ICurve"
                                                        },
                                                        "id": 5912,
                                                        "name": "UserDefinedTypeName",
                                                        "src": "622:6:50"
                                                    }
                                                ],
                                                "id": 5913,
                                                "name": "VariableDeclaration",
                                                "src": "622:15:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "contract ICurve",
                                                    "type_conversion": true
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1544,
                                                            "type": "type(contract ICurve)",
                                                            "value": "ICurve"
                                                        },
                                                        "id": 5914,
                                                        "name": "Identifier",
                                                        "src": "640:6:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5884,
                                                            "type": "address",
                                                            "value": "swapPoolAddr"
                                                        },
                                                        "id": 5915,
                                                        "name": "Identifier",
                                                        "src": "647:12:50"
                                                    }
                                                ],
                                                "id": 5916,
                                                "name": "FunctionCall",
                                                "src": "640:20:50"
                                            }
                                        ],
                                        "id": 5917,
                                        "name": "VariableDeclarationStatement",
                                        "src": "622:38:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5919,
                                                5921
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "fromIdx",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "int128",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "int128",
                                                            "type": "int128"
                                                        },
                                                        "id": 5918,
                                                        "name": "ElementaryTypeName",
                                                        "src": "665:6:50"
                                                    }
                                                ],
                                                "id": 5919,
                                                "name": "VariableDeclaration",
                                                "src": "665:14:50"
                                            },
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "toIdx",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "int128",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "int128",
                                                            "type": "int128"
                                                        },
                                                        "id": 5920,
                                                        "name": "ElementaryTypeName",
                                                        "src": "681:6:50"
                                                    }
                                                ],
                                                "id": 5921,
                                                "name": "VariableDeclaration",
                                                "src": "681:12:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "tuple(int128,int128)",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                                    "typeString": "contract ICurve"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 6084,
                                                            "type": "function (contract ICurve,address,address) view returns (int128,int128)",
                                                            "value": "getInputOutputIdx"
                                                        },
                                                        "id": 5922,
                                                        "name": "Identifier",
                                                        "src": "697:17:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5913,
                                                            "type": "contract ICurve",
                                                            "value": "swapPool"
                                                        },
                                                        "id": 5923,
                                                        "name": "Identifier",
                                                        "src": "719:8:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5873,
                                                            "type": "address",
                                                            "value": "input"
                                                        },
                                                        "id": 5924,
                                                        "name": "Identifier",
                                                        "src": "732:5:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5875,
                                                            "type": "address",
                                                            "value": "output"
                                                        },
                                                        "id": 5925,
                                                        "name": "Identifier",
                                                        "src": "742:6:50"
                                                    }
                                                ],
                                                "id": 5926,
                                                "name": "FunctionCall",
                                                "src": "697:55:50"
                                            }
                                        ],
                                        "id": 5927,
                                        "name": "VariableDeclarationStatement",
                                        "src": "664:88:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5929
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "outputAmount",
                                                    "overrides": null,
                                                    "scope": 5949,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "uint256",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "uint256",
                                                            "type": "uint256"
                                                        },
                                                        "id": 5928,
                                                        "name": "ElementaryTypeName",
                                                        "src": "756:7:50"
                                                    }
                                                ],
                                                "id": 5929,
                                                "name": "VariableDeclaration",
                                                "src": "756:20:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "uint256",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_uint256",
                                                                    "typeString": "uint256"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_rational_0_by_1",
                                                                    "typeString": "int_const 0"
                                                                }
                                                            ],
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "member_name": "exchange",
                                                            "referencedDeclaration": 1527,
                                                            "type": "function (int128,int128,uint256,uint256) external returns (uint256)"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5913,
                                                                    "type": "contract ICurve",
                                                                    "value": "swapPool"
                                                                },
                                                                "id": 5930,
                                                                "name": "Identifier",
                                                                "src": "779:8:50"
                                                            }
                                                        ],
                                                        "id": 5931,
                                                        "name": "MemberAccess",
                                                        "src": "779:17:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5919,
                                                            "type": "int128",
                                                            "value": "fromIdx"
                                                        },
                                                        "id": 5932,
                                                        "name": "Identifier",
                                                        "src": "801:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5921,
                                                            "type": "int128",
                                                            "value": "toIdx"
                                                        },
                                                        "id": 5933,
                                                        "name": "Identifier",
                                                        "src": "813:5:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5890,
                                                            "type": "uint256",
                                                            "value": "inputAmount"
                                                        },
                                                        "id": 5934,
                                                        "name": "Identifier",
                                                        "src": "823:11:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "hexvalue": "30",
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "subdenomination": null,
                                                            "token": "number",
                                                            "type": "int_const 0",
                                                            "value": "0"
                                                        },
                                                        "id": 5935,
                                                        "name": "Literal",
                                                        "src": "839:1:50"
                                                    }
                                                ],
                                                "id": 5936,
                                                "name": "FunctionCall",
                                                "src": "779:65:50"
                                            }
                                        ],
                                        "id": 5937,
                                        "name": "VariableDeclarationStatement",
                                        "src": "756:88:50"
                                    },
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "tuple()",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_bool",
                                                                    "typeString": "bool"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_stringliteral_9bdcee1997e408c6c127235b0677e6c10fa6f38a518199ee7e4a26f846bf5885",
                                                                    "typeString": "literal_string \"PairCurve: transfer failed!\""
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                -18,
                                                                -18
                                                            ],
                                                            "referencedDeclaration": -18,
                                                            "type": "function (bool,string memory) pure",
                                                            "value": "require"
                                                        },
                                                        "id": 5938,
                                                        "name": "Identifier",
                                                        "src": "848:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "isStructConstructorCall": false,
                                                            "lValueRequested": false,
                                                            "names": [
                                                                null
                                                            ],
                                                            "tryCall": false,
                                                            "type": "bool",
                                                            "type_conversion": false
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": [
                                                                        {
                                                                            "typeIdentifier": "t_address",
                                                                            "typeString": "address"
                                                                        },
                                                                        {
                                                                            "typeIdentifier": "t_uint256",
                                                                            "typeString": "uint256"
                                                                        }
                                                                    ],
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "member_name": "transfer",
                                                                    "referencedDeclaration": 346,
                                                                    "type": "function (address,uint256) external returns (bool)"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "isStructConstructorCall": false,
                                                                            "lValueRequested": false,
                                                                            "names": [
                                                                                null
                                                                            ],
                                                                            "tryCall": false,
                                                                            "type": "contract ERC20",
                                                                            "type_conversion": true
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": [
                                                                                        {
                                                                                            "typeIdentifier": "t_address",
                                                                                            "typeString": "address"
                                                                                        }
                                                                                    ],
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 725,
                                                                                    "type": "type(contract ERC20)",
                                                                                    "value": "ERC20"
                                                                                },
                                                                                "id": 5939,
                                                                                "name": "Identifier",
                                                                                "src": "860:5:50"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 5875,
                                                                                    "type": "address",
                                                                                    "value": "output"
                                                                                },
                                                                                "id": 5940,
                                                                                "name": "Identifier",
                                                                                "src": "866:6:50"
                                                                            }
                                                                        ],
                                                                        "id": 5941,
                                                                        "name": "FunctionCall",
                                                                        "src": "860:13:50"
                                                                    }
                                                                ],
                                                                "id": 5942,
                                                                "name": "MemberAccess",
                                                                "src": "860:22:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5877,
                                                                    "type": "address",
                                                                    "value": "to"
                                                                },
                                                                "id": 5943,
                                                                "name": "Identifier",
                                                                "src": "883:2:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5929,
                                                                    "type": "uint256",
                                                                    "value": "outputAmount"
                                                                },
                                                                "id": 5944,
                                                                "name": "Identifier",
                                                                "src": "887:12:50"
                                                            }
                                                        ],
                                                        "id": 5945,
                                                        "name": "FunctionCall",
                                                        "src": "860:40:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "hexvalue": "5061697243757276653a207472616e73666572206661696c656421",
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "subdenomination": null,
                                                            "token": "string",
                                                            "type": "literal_string \"PairCurve: transfer failed!\"",
                                                            "value": "PairCurve: transfer failed!"
                                                        },
                                                        "id": 5946,
                                                        "name": "Literal",
                                                        "src": "905:29:50"
                                                    }
                                                ],
                                                "id": 5947,
                                                "name": "FunctionCall",
                                                "src": "848:90:50"
                                            }
                                        ],
                                        "id": 5948,
                                        "name": "ExpressionStatement",
                                        "src": "848:90:50"
                                    }
                                ],
                                "id": 5949,
                                "name": "Block",
                                "src": "413:529:50"
                            }
                        ],
                        "id": 5950,
                        "name": "FunctionDefinition",
                        "src": "306:636:50"
                    },
                    {
                        "attributes": {
                            "documentation": null,
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "parseData",
                            "overrides": null,
                            "scope": 6085,
                            "stateMutability": "pure",
                            "virtual": false,
                            "visibility": "private"
                        },
                        "children": [
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "data",
                                            "overrides": null,
                                            "scope": 5967,
                                            "stateVariable": false,
                                            "storageLocation": "memory",
                                            "type": "bytes",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "bytes",
                                                    "type": "bytes"
                                                },
                                                "id": 5951,
                                                "name": "ElementaryTypeName",
                                                "src": "964:5:50"
                                            }
                                        ],
                                        "id": 5952,
                                        "name": "VariableDeclaration",
                                        "src": "964:17:50"
                                    }
                                ],
                                "id": 5953,
                                "name": "ParameterList",
                                "src": "963:19:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "swapPoolAddr",
                                            "overrides": null,
                                            "scope": 5967,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5954,
                                                "name": "ElementaryTypeName",
                                                "src": "1011:7:50"
                                            }
                                        ],
                                        "id": 5955,
                                        "name": "VariableDeclaration",
                                        "src": "1011:20:50"
                                    }
                                ],
                                "id": 5956,
                                "name": "ParameterList",
                                "src": "1010:22:50"
                            },
                            {
                                "children": [
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "tuple()",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_bool",
                                                                    "typeString": "bool"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_stringliteral_777d8255f673776d22a0d7fde49d7b7af3af8a4f0f5085651c5484bf11d8b1d5",
                                                                    "typeString": "literal_string \"PairCurve: invalid data!\""
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                -18,
                                                                -18
                                                            ],
                                                            "referencedDeclaration": -18,
                                                            "type": "function (bool,string memory) pure",
                                                            "value": "require"
                                                        },
                                                        "id": 5957,
                                                        "name": "Identifier",
                                                        "src": "1038:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "commonType": {
                                                                "typeIdentifier": "t_uint256",
                                                                "typeString": "uint256"
                                                            },
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "operator": "==",
                                                            "type": "bool"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "member_name": "length",
                                                                    "referencedDeclaration": null,
                                                                    "type": "uint256"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 5952,
                                                                            "type": "bytes memory",
                                                                            "value": "data"
                                                                        },
                                                                        "id": 5958,
                                                                        "name": "Identifier",
                                                                        "src": "1046:4:50"
                                                                    }
                                                                ],
                                                                "id": 5959,
                                                                "name": "MemberAccess",
                                                                "src": "1046:11:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "hexvalue": "3230",
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": true,
                                                                    "lValueRequested": false,
                                                                    "subdenomination": null,
                                                                    "token": "number",
                                                                    "type": "int_const 20",
                                                                    "value": "20"
                                                                },
                                                                "id": 5960,
                                                                "name": "Literal",
                                                                "src": "1061:2:50"
                                                            }
                                                        ],
                                                        "id": 5961,
                                                        "name": "BinaryOperation",
                                                        "src": "1046:17:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "hexvalue": "5061697243757276653a20696e76616c6964206461746121",
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "subdenomination": null,
                                                            "token": "string",
                                                            "type": "literal_string \"PairCurve: invalid data!\"",
                                                            "value": "PairCurve: invalid data!"
                                                        },
                                                        "id": 5962,
                                                        "name": "Literal",
                                                        "src": "1065:26:50"
                                                    }
                                                ],
                                                "id": 5963,
                                                "name": "FunctionCall",
                                                "src": "1038:54:50"
                                            }
                                        ],
                                        "id": 5964,
                                        "name": "ExpressionStatement",
                                        "src": "1038:54:50"
                                    },
                                    {
                                        "attributes": {
                                            "evmVersion": "istanbul",
                                            "externalReferences": [
                                                {
                                                    "declaration": 5952,
                                                    "isOffset": false,
                                                    "isSlot": false,
                                                    "src": "1136:4:50",
                                                    "valueSize": 1
                                                },
                                                {
                                                    "declaration": 5955,
                                                    "isOffset": false,
                                                    "isSlot": false,
                                                    "src": "1110:12:50",
                                                    "valueSize": 1
                                                }
                                            ],
                                            "operations": "{\n    swapPoolAddr := mload(add(data, 20))\n}"
                                        },
                                        "children": [],
                                        "id": 5965,
                                        "name": "InlineAssembly",
                                        "src": "1096:54:50"
                                    }
                                ],
                                "id": 5966,
                                "name": "Block",
                                "src": "1034:119:50"
                            }
                        ],
                        "id": 5967,
                        "name": "FunctionDefinition",
                        "src": "945:208:50"
                    },
                    {
                        "attributes": {
                            "baseFunctions": [
                                5324
                            ],
                            "documentation": null,
                            "functionSelector": "7eace892",
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "getOutputAmount",
                            "scope": 6085,
                            "stateMutability": "nonpayable",
                            "virtual": false,
                            "visibility": "external"
                        },
                        "children": [
                            {
                                "attributes": {
                                    "overrides": [
                                        null
                                    ]
                                },
                                "id": 5977,
                                "name": "OverrideSpecifier",
                                "src": "1271:8:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "input",
                                            "overrides": null,
                                            "scope": 6011,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5968,
                                                "name": "ElementaryTypeName",
                                                "src": "1184:7:50"
                                            }
                                        ],
                                        "id": 5969,
                                        "name": "VariableDeclaration",
                                        "src": "1184:13:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "output",
                                            "overrides": null,
                                            "scope": 6011,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 5970,
                                                "name": "ElementaryTypeName",
                                                "src": "1201:7:50"
                                            }
                                        ],
                                        "id": 5971,
                                        "name": "VariableDeclaration",
                                        "src": "1201:14:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "amountIn",
                                            "overrides": null,
                                            "scope": 6011,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "uint256",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "uint256",
                                                    "type": "uint256"
                                                },
                                                "id": 5972,
                                                "name": "ElementaryTypeName",
                                                "src": "1219:7:50"
                                            }
                                        ],
                                        "id": 5973,
                                        "name": "VariableDeclaration",
                                        "src": "1219:16:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "data",
                                            "overrides": null,
                                            "scope": 6011,
                                            "stateVariable": false,
                                            "storageLocation": "calldata",
                                            "type": "bytes",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "bytes",
                                                    "type": "bytes"
                                                },
                                                "id": 5974,
                                                "name": "ElementaryTypeName",
                                                "src": "1239:5:50"
                                            }
                                        ],
                                        "id": 5975,
                                        "name": "VariableDeclaration",
                                        "src": "1239:19:50"
                                    }
                                ],
                                "id": 5976,
                                "name": "ParameterList",
                                "src": "1180:81:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "amountOut",
                                            "overrides": null,
                                            "scope": 6011,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "uint256",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "uint256",
                                                    "type": "uint256"
                                                },
                                                "id": 5978,
                                                "name": "ElementaryTypeName",
                                                "src": "1289:7:50"
                                            }
                                        ],
                                        "id": 5979,
                                        "name": "VariableDeclaration",
                                        "src": "1289:17:50"
                                    }
                                ],
                                "id": 5980,
                                "name": "ParameterList",
                                "src": "1288:19:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5982
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "swapPoolAddr",
                                                    "overrides": null,
                                                    "scope": 6010,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "address",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "address",
                                                            "stateMutability": "nonpayable",
                                                            "type": "address"
                                                        },
                                                        "id": 5981,
                                                        "name": "ElementaryTypeName",
                                                        "src": "1312:7:50"
                                                    }
                                                ],
                                                "id": 5982,
                                                "name": "VariableDeclaration",
                                                "src": "1312:20:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "address",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_bytes_calldata_ptr",
                                                                    "typeString": "bytes calldata"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5967,
                                                            "type": "function (bytes memory) pure returns (address)",
                                                            "value": "parseData"
                                                        },
                                                        "id": 5983,
                                                        "name": "Identifier",
                                                        "src": "1335:9:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5975,
                                                            "type": "bytes calldata",
                                                            "value": "data"
                                                        },
                                                        "id": 5984,
                                                        "name": "Identifier",
                                                        "src": "1345:4:50"
                                                    }
                                                ],
                                                "id": 5985,
                                                "name": "FunctionCall",
                                                "src": "1335:15:50"
                                            }
                                        ],
                                        "id": 5986,
                                        "name": "VariableDeclarationStatement",
                                        "src": "1312:38:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5988
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "swapPool",
                                                    "overrides": null,
                                                    "scope": 6010,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "contract ICurve",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "contractScope": null,
                                                            "name": "ICurve",
                                                            "referencedDeclaration": 1544,
                                                            "type": "contract ICurve"
                                                        },
                                                        "id": 5987,
                                                        "name": "UserDefinedTypeName",
                                                        "src": "1354:6:50"
                                                    }
                                                ],
                                                "id": 5988,
                                                "name": "VariableDeclaration",
                                                "src": "1354:15:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "contract ICurve",
                                                    "type_conversion": true
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 1544,
                                                            "type": "type(contract ICurve)",
                                                            "value": "ICurve"
                                                        },
                                                        "id": 5989,
                                                        "name": "Identifier",
                                                        "src": "1372:6:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5982,
                                                            "type": "address",
                                                            "value": "swapPoolAddr"
                                                        },
                                                        "id": 5990,
                                                        "name": "Identifier",
                                                        "src": "1379:12:50"
                                                    }
                                                ],
                                                "id": 5991,
                                                "name": "FunctionCall",
                                                "src": "1372:20:50"
                                            }
                                        ],
                                        "id": 5992,
                                        "name": "VariableDeclarationStatement",
                                        "src": "1354:38:50"
                                    },
                                    {
                                        "attributes": {
                                            "assignments": [
                                                5994,
                                                5996
                                            ]
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "fromIdx",
                                                    "overrides": null,
                                                    "scope": 6010,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "int128",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "int128",
                                                            "type": "int128"
                                                        },
                                                        "id": 5993,
                                                        "name": "ElementaryTypeName",
                                                        "src": "1397:6:50"
                                                    }
                                                ],
                                                "id": 5994,
                                                "name": "VariableDeclaration",
                                                "src": "1397:14:50"
                                            },
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "toIdx",
                                                    "overrides": null,
                                                    "scope": 6010,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "int128",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "int128",
                                                            "type": "int128"
                                                        },
                                                        "id": 5995,
                                                        "name": "ElementaryTypeName",
                                                        "src": "1413:6:50"
                                                    }
                                                ],
                                                "id": 5996,
                                                "name": "VariableDeclaration",
                                                "src": "1413:12:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "tuple(int128,int128)",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_contract$_ICurve_$1544",
                                                                    "typeString": "contract ICurve"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_address",
                                                                    "typeString": "address"
                                                                }
                                                            ],
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 6084,
                                                            "type": "function (contract ICurve,address,address) view returns (int128,int128)",
                                                            "value": "getInputOutputIdx"
                                                        },
                                                        "id": 5997,
                                                        "name": "Identifier",
                                                        "src": "1429:17:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5988,
                                                            "type": "contract ICurve",
                                                            "value": "swapPool"
                                                        },
                                                        "id": 5998,
                                                        "name": "Identifier",
                                                        "src": "1451:8:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5969,
                                                            "type": "address",
                                                            "value": "input"
                                                        },
                                                        "id": 5999,
                                                        "name": "Identifier",
                                                        "src": "1464:5:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5971,
                                                            "type": "address",
                                                            "value": "output"
                                                        },
                                                        "id": 6000,
                                                        "name": "Identifier",
                                                        "src": "1474:6:50"
                                                    }
                                                ],
                                                "id": 6001,
                                                "name": "FunctionCall",
                                                "src": "1429:55:50"
                                            }
                                        ],
                                        "id": 6002,
                                        "name": "VariableDeclarationStatement",
                                        "src": "1396:88:50"
                                    },
                                    {
                                        "attributes": {
                                            "functionReturnParameters": 5980
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "isStructConstructorCall": false,
                                                    "lValueRequested": false,
                                                    "names": [
                                                        null
                                                    ],
                                                    "tryCall": false,
                                                    "type": "uint256",
                                                    "type_conversion": false
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": [
                                                                {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_int128",
                                                                    "typeString": "int128"
                                                                },
                                                                {
                                                                    "typeIdentifier": "t_uint256",
                                                                    "typeString": "uint256"
                                                                }
                                                            ],
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "member_name": "get_dy",
                                                            "referencedDeclaration": 1538,
                                                            "type": "function (int128,int128,uint256) view external returns (uint256)"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 5988,
                                                                    "type": "contract ICurve",
                                                                    "value": "swapPool"
                                                                },
                                                                "id": 6003,
                                                                "name": "Identifier",
                                                                "src": "1495:8:50"
                                                            }
                                                        ],
                                                        "id": 6004,
                                                        "name": "MemberAccess",
                                                        "src": "1495:15:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5994,
                                                            "type": "int128",
                                                            "value": "fromIdx"
                                                        },
                                                        "id": 6005,
                                                        "name": "Identifier",
                                                        "src": "1511:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5996,
                                                            "type": "int128",
                                                            "value": "toIdx"
                                                        },
                                                        "id": 6006,
                                                        "name": "Identifier",
                                                        "src": "1520:5:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 5973,
                                                            "type": "uint256",
                                                            "value": "amountIn"
                                                        },
                                                        "id": 6007,
                                                        "name": "Identifier",
                                                        "src": "1527:8:50"
                                                    }
                                                ],
                                                "id": 6008,
                                                "name": "FunctionCall",
                                                "src": "1495:41:50"
                                            }
                                        ],
                                        "id": 6009,
                                        "name": "Return",
                                        "src": "1488:48:50"
                                    }
                                ],
                                "id": 6010,
                                "name": "Block",
                                "src": "1308:232:50"
                            }
                        ],
                        "id": 6011,
                        "name": "FunctionDefinition",
                        "src": "1156:384:50"
                    },
                    {
                        "attributes": {
                            "documentation": null,
                            "implemented": true,
                            "isConstructor": false,
                            "kind": "function",
                            "modifiers": [
                                null
                            ],
                            "name": "getInputOutputIdx",
                            "overrides": null,
                            "scope": 6085,
                            "stateMutability": "view",
                            "virtual": false,
                            "visibility": "private"
                        },
                        "children": [
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "swapPool",
                                            "overrides": null,
                                            "scope": 6084,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "contract ICurve",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "contractScope": null,
                                                    "name": "ICurve",
                                                    "referencedDeclaration": 1544,
                                                    "type": "contract ICurve"
                                                },
                                                "id": 6012,
                                                "name": "UserDefinedTypeName",
                                                "src": "1582:6:50"
                                            }
                                        ],
                                        "id": 6013,
                                        "name": "VariableDeclaration",
                                        "src": "1582:15:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "input",
                                            "overrides": null,
                                            "scope": 6084,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 6014,
                                                "name": "ElementaryTypeName",
                                                "src": "1607:7:50"
                                            }
                                        ],
                                        "id": 6015,
                                        "name": "VariableDeclaration",
                                        "src": "1607:13:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "output",
                                            "overrides": null,
                                            "scope": 6084,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "address",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "address",
                                                    "stateMutability": "nonpayable",
                                                    "type": "address"
                                                },
                                                "id": 6016,
                                                "name": "ElementaryTypeName",
                                                "src": "1630:7:50"
                                            }
                                        ],
                                        "id": 6017,
                                        "name": "VariableDeclaration",
                                        "src": "1630:14:50"
                                    }
                                ],
                                "id": 6018,
                                "name": "ParameterList",
                                "src": "1572:78:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "fromIdx",
                                            "overrides": null,
                                            "scope": 6084,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "int128",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "int128",
                                                    "type": "int128"
                                                },
                                                "id": 6019,
                                                "name": "ElementaryTypeName",
                                                "src": "1673:6:50"
                                            }
                                        ],
                                        "id": 6020,
                                        "name": "VariableDeclaration",
                                        "src": "1673:14:50"
                                    },
                                    {
                                        "attributes": {
                                            "constant": false,
                                            "mutability": "mutable",
                                            "name": "toIdx",
                                            "overrides": null,
                                            "scope": 6084,
                                            "stateVariable": false,
                                            "storageLocation": "default",
                                            "type": "int128",
                                            "value": null,
                                            "visibility": "internal"
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "name": "int128",
                                                    "type": "int128"
                                                },
                                                "id": 6021,
                                                "name": "ElementaryTypeName",
                                                "src": "1689:6:50"
                                            }
                                        ],
                                        "id": 6022,
                                        "name": "VariableDeclaration",
                                        "src": "1689:12:50"
                                    }
                                ],
                                "id": 6023,
                                "name": "ParameterList",
                                "src": "1672:30:50"
                            },
                            {
                                "children": [
                                    {
                                        "attributes": {
                                            "assignments": [
                                                6025
                                            ],
                                            "initialValue": null
                                        },
                                        "children": [
                                            {
                                                "attributes": {
                                                    "constant": false,
                                                    "mutability": "mutable",
                                                    "name": "idx",
                                                    "overrides": null,
                                                    "scope": 6083,
                                                    "stateVariable": false,
                                                    "storageLocation": "default",
                                                    "type": "uint8",
                                                    "value": null,
                                                    "visibility": "internal"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "name": "uint8",
                                                            "type": "uint8"
                                                        },
                                                        "id": 6024,
                                                        "name": "ElementaryTypeName",
                                                        "src": "1713:5:50"
                                                    }
                                                ],
                                                "id": 6025,
                                                "name": "VariableDeclaration",
                                                "src": "1713:9:50"
                                            }
                                        ],
                                        "id": 6026,
                                        "name": "VariableDeclarationStatement",
                                        "src": "1713:9:50"
                                    },
                                    {
                                        "children": [
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "operator": "=",
                                                    "type": "int128"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 6020,
                                                            "type": "int128",
                                                            "value": "fromIdx"
                                                        },
                                                        "id": 6027,
                                                        "name": "Identifier",
                                                        "src": "1732:7:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "operator": "=",
                                                            "type": "int128"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 6022,
                                                                    "type": "int128",
                                                                    "value": "toIdx"
                                                                },
                                                                "id": 6028,
                                                                "name": "Identifier",
                                                                "src": "1742:5:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": true,
                                                                    "lValueRequested": false,
                                                                    "operator": "-",
                                                                    "prefix": true,
                                                                    "type": "int_const -1"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "hexvalue": "31",
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": true,
                                                                            "lValueRequested": false,
                                                                            "subdenomination": null,
                                                                            "token": "number",
                                                                            "type": "int_const 1",
                                                                            "value": "1"
                                                                        },
                                                                        "id": 6029,
                                                                        "name": "Literal",
                                                                        "src": "1751:1:50"
                                                                    }
                                                                ],
                                                                "id": 6030,
                                                                "name": "UnaryOperation",
                                                                "src": "1750:2:50"
                                                            }
                                                        ],
                                                        "id": 6031,
                                                        "name": "Assignment",
                                                        "src": "1742:10:50"
                                                    }
                                                ],
                                                "id": 6032,
                                                "name": "Assignment",
                                                "src": "1732:20:50"
                                            }
                                        ],
                                        "id": 6033,
                                        "name": "ExpressionStatement",
                                        "src": "1732:20:50"
                                    },
                                    {
                                        "children": [
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "operator": "=",
                                                            "type": "uint8"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 6025,
                                                                    "type": "uint8",
                                                                    "value": "idx"
                                                                },
                                                                "id": 6034,
                                                                "name": "Identifier",
                                                                "src": "1813:3:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "hexvalue": "30",
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": true,
                                                                    "lValueRequested": false,
                                                                    "subdenomination": null,
                                                                    "token": "number",
                                                                    "type": "int_const 0",
                                                                    "value": "0"
                                                                },
                                                                "id": 6035,
                                                                "name": "Literal",
                                                                "src": "1819:1:50"
                                                            }
                                                        ],
                                                        "id": 6036,
                                                        "name": "Assignment",
                                                        "src": "1813:7:50"
                                                    }
                                                ],
                                                "id": 6037,
                                                "name": "ExpressionStatement",
                                                "src": "1813:7:50"
                                            },
                                            {
                                                "attributes": {
                                                    "argumentTypes": null,
                                                    "commonType": {
                                                        "typeIdentifier": "t_uint8",
                                                        "typeString": "uint8"
                                                    },
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "operator": "<",
                                                    "type": "bool"
                                                },
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "overloadedDeclarations": [
                                                                null
                                                            ],
                                                            "referencedDeclaration": 6025,
                                                            "type": "uint8",
                                                            "value": "idx"
                                                        },
                                                        "id": 6038,
                                                        "name": "Identifier",
                                                        "src": "1822:3:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "hexvalue": "34",
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": true,
                                                            "lValueRequested": false,
                                                            "subdenomination": null,
                                                            "token": "number",
                                                            "type": "int_const 4",
                                                            "value": "4"
                                                        },
                                                        "id": 6039,
                                                        "name": "Literal",
                                                        "src": "1828:1:50"
                                                    }
                                                ],
                                                "id": 6040,
                                                "name": "BinaryOperation",
                                                "src": "1822:7:50"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "argumentTypes": null,
                                                            "isConstant": false,
                                                            "isLValue": false,
                                                            "isPure": false,
                                                            "lValueRequested": false,
                                                            "operator": "++",
                                                            "prefix": false,
                                                            "type": "uint8"
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "overloadedDeclarations": [
                                                                        null
                                                                    ],
                                                                    "referencedDeclaration": 6025,
                                                                    "type": "uint8",
                                                                    "value": "idx"
                                                                },
                                                                "id": 6041,
                                                                "name": "Identifier",
                                                                "src": "1831:3:50"
                                                            }
                                                        ],
                                                        "id": 6042,
                                                        "name": "UnaryOperation",
                                                        "src": "1831:5:50"
                                                    }
                                                ],
                                                "id": 6043,
                                                "name": "ExpressionStatement",
                                                "src": "1831:5:50"
                                            },
                                            {
                                                "children": [
                                                    {
                                                        "attributes": {
                                                            "falseBody": null
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "commonType": {
                                                                        "typeIdentifier": "t_bool",
                                                                        "typeString": "bool"
                                                                    },
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "operator": "&&",
                                                                    "type": "bool"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "commonType": {
                                                                                "typeIdentifier": "t_int128",
                                                                                "typeString": "int128"
                                                                            },
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "lValueRequested": false,
                                                                            "operator": "!=",
                                                                            "type": "bool"
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 6020,
                                                                                    "type": "int128",
                                                                                    "value": "fromIdx"
                                                                                },
                                                                                "id": 6044,
                                                                                "name": "Identifier",
                                                                                "src": "1856:7:50"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": true,
                                                                                    "lValueRequested": false,
                                                                                    "operator": "-",
                                                                                    "prefix": true,
                                                                                    "type": "int_const -1"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "hexvalue": "31",
                                                                                            "isConstant": false,
                                                                                            "isLValue": false,
                                                                                            "isPure": true,
                                                                                            "lValueRequested": false,
                                                                                            "subdenomination": null,
                                                                                            "token": "number",
                                                                                            "type": "int_const 1",
                                                                                            "value": "1"
                                                                                        },
                                                                                        "id": 6045,
                                                                                        "name": "Literal",
                                                                                        "src": "1868:1:50"
                                                                                    }
                                                                                ],
                                                                                "id": 6046,
                                                                                "name": "UnaryOperation",
                                                                                "src": "1867:2:50"
                                                                            }
                                                                        ],
                                                                        "id": 6047,
                                                                        "name": "BinaryOperation",
                                                                        "src": "1856:13:50"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "commonType": {
                                                                                "typeIdentifier": "t_int128",
                                                                                "typeString": "int128"
                                                                            },
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "lValueRequested": false,
                                                                            "operator": "!=",
                                                                            "type": "bool"
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 6022,
                                                                                    "type": "int128",
                                                                                    "value": "toIdx"
                                                                                },
                                                                                "id": 6048,
                                                                                "name": "Identifier",
                                                                                "src": "1873:5:50"
                                                                            },
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": true,
                                                                                    "lValueRequested": false,
                                                                                    "operator": "-",
                                                                                    "prefix": true,
                                                                                    "type": "int_const -1"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "hexvalue": "31",
                                                                                            "isConstant": false,
                                                                                            "isLValue": false,
                                                                                            "isPure": true,
                                                                                            "lValueRequested": false,
                                                                                            "subdenomination": null,
                                                                                            "token": "number",
                                                                                            "type": "int_const 1",
                                                                                            "value": "1"
                                                                                        },
                                                                                        "id": 6049,
                                                                                        "name": "Literal",
                                                                                        "src": "1883:1:50"
                                                                                    }
                                                                                ],
                                                                                "id": 6050,
                                                                                "name": "UnaryOperation",
                                                                                "src": "1882:2:50"
                                                                            }
                                                                        ],
                                                                        "id": 6051,
                                                                        "name": "BinaryOperation",
                                                                        "src": "1873:11:50"
                                                                    }
                                                                ],
                                                                "id": 6052,
                                                                "name": "BinaryOperation",
                                                                "src": "1856:28:50"
                                                            },
                                                            {
                                                                "children": [
                                                                    {
                                                                        "id": 6053,
                                                                        "name": "Break",
                                                                        "src": "1942:5:50"
                                                                    }
                                                                ],
                                                                "id": 6054,
                                                                "name": "Block",
                                                                "src": "1886:76:50"
                                                            }
                                                        ],
                                                        "id": 6055,
                                                        "name": "IfStatement",
                                                        "src": "1852:110:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "assignments": [
                                                                6057
                                                            ]
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "constant": false,
                                                                    "mutability": "mutable",
                                                                    "name": "coin",
                                                                    "overrides": null,
                                                                    "scope": 6081,
                                                                    "stateVariable": false,
                                                                    "storageLocation": "default",
                                                                    "type": "address",
                                                                    "value": null,
                                                                    "visibility": "internal"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "name": "address",
                                                                            "stateMutability": "nonpayable",
                                                                            "type": "address"
                                                                        },
                                                                        "id": 6056,
                                                                        "name": "ElementaryTypeName",
                                                                        "src": "1975:7:50"
                                                                    }
                                                                ],
                                                                "id": 6057,
                                                                "name": "VariableDeclaration",
                                                                "src": "1975:12:50"
                                                            },
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "isStructConstructorCall": false,
                                                                    "lValueRequested": false,
                                                                    "names": [
                                                                        null
                                                                    ],
                                                                    "tryCall": false,
                                                                    "type": "address",
                                                                    "type_conversion": false
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": [
                                                                                {
                                                                                    "typeIdentifier": "t_uint8",
                                                                                    "typeString": "uint8"
                                                                                }
                                                                            ],
                                                                            "isConstant": false,
                                                                            "isLValue": false,
                                                                            "isPure": false,
                                                                            "lValueRequested": false,
                                                                            "member_name": "coins",
                                                                            "referencedDeclaration": 1507,
                                                                            "type": "function (uint256) view external returns (address)"
                                                                        },
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "overloadedDeclarations": [
                                                                                        null
                                                                                    ],
                                                                                    "referencedDeclaration": 6013,
                                                                                    "type": "contract ICurve",
                                                                                    "value": "swapPool"
                                                                                },
                                                                                "id": 6058,
                                                                                "name": "Identifier",
                                                                                "src": "1990:8:50"
                                                                            }
                                                                        ],
                                                                        "id": 6059,
                                                                        "name": "MemberAccess",
                                                                        "src": "1990:14:50"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 6025,
                                                                            "type": "uint8",
                                                                            "value": "idx"
                                                                        },
                                                                        "id": 6060,
                                                                        "name": "Identifier",
                                                                        "src": "2005:3:50"
                                                                    }
                                                                ],
                                                                "id": 6061,
                                                                "name": "FunctionCall",
                                                                "src": "1990:19:50"
                                                            }
                                                        ],
                                                        "id": 6062,
                                                        "name": "VariableDeclarationStatement",
                                                        "src": "1975:34:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "falseBody": null
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "commonType": {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    },
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "operator": "==",
                                                                    "type": "bool"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 6057,
                                                                            "type": "address",
                                                                            "value": "coin"
                                                                        },
                                                                        "id": 6063,
                                                                        "name": "Identifier",
                                                                        "src": "2027:4:50"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 6015,
                                                                            "type": "address",
                                                                            "value": "input"
                                                                        },
                                                                        "id": 6064,
                                                                        "name": "Identifier",
                                                                        "src": "2035:5:50"
                                                                    }
                                                                ],
                                                                "id": 6065,
                                                                "name": "BinaryOperation",
                                                                "src": "2027:13:50"
                                                            },
                                                            {
                                                                "children": [
                                                                    {
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": false,
                                                                                    "lValueRequested": false,
                                                                                    "operator": "=",
                                                                                    "type": "int128"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6020,
                                                                                            "type": "int128",
                                                                                            "value": "fromIdx"
                                                                                        },
                                                                                        "id": 6066,
                                                                                        "name": "Identifier",
                                                                                        "src": "2060:7:50"
                                                                                    },
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6025,
                                                                                            "type": "uint8",
                                                                                            "value": "idx"
                                                                                        },
                                                                                        "id": 6067,
                                                                                        "name": "Identifier",
                                                                                        "src": "2070:3:50"
                                                                                    }
                                                                                ],
                                                                                "id": 6068,
                                                                                "name": "Assignment",
                                                                                "src": "2060:13:50"
                                                                            }
                                                                        ],
                                                                        "id": 6069,
                                                                        "name": "ExpressionStatement",
                                                                        "src": "2060:13:50"
                                                                    }
                                                                ],
                                                                "id": 6070,
                                                                "name": "Block",
                                                                "src": "2042:46:50"
                                                            }
                                                        ],
                                                        "id": 6071,
                                                        "name": "IfStatement",
                                                        "src": "2023:65:50"
                                                    },
                                                    {
                                                        "attributes": {
                                                            "falseBody": null
                                                        },
                                                        "children": [
                                                            {
                                                                "attributes": {
                                                                    "argumentTypes": null,
                                                                    "commonType": {
                                                                        "typeIdentifier": "t_address",
                                                                        "typeString": "address"
                                                                    },
                                                                    "isConstant": false,
                                                                    "isLValue": false,
                                                                    "isPure": false,
                                                                    "lValueRequested": false,
                                                                    "operator": "==",
                                                                    "type": "bool"
                                                                },
                                                                "children": [
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 6057,
                                                                            "type": "address",
                                                                            "value": "coin"
                                                                        },
                                                                        "id": 6072,
                                                                        "name": "Identifier",
                                                                        "src": "2105:4:50"
                                                                    },
                                                                    {
                                                                        "attributes": {
                                                                            "argumentTypes": null,
                                                                            "overloadedDeclarations": [
                                                                                null
                                                                            ],
                                                                            "referencedDeclaration": 6017,
                                                                            "type": "address",
                                                                            "value": "output"
                                                                        },
                                                                        "id": 6073,
                                                                        "name": "Identifier",
                                                                        "src": "2113:6:50"
                                                                    }
                                                                ],
                                                                "id": 6074,
                                                                "name": "BinaryOperation",
                                                                "src": "2105:14:50"
                                                            },
                                                            {
                                                                "children": [
                                                                    {
                                                                        "children": [
                                                                            {
                                                                                "attributes": {
                                                                                    "argumentTypes": null,
                                                                                    "isConstant": false,
                                                                                    "isLValue": false,
                                                                                    "isPure": false,
                                                                                    "lValueRequested": false,
                                                                                    "operator": "=",
                                                                                    "type": "int128"
                                                                                },
                                                                                "children": [
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6022,
                                                                                            "type": "int128",
                                                                                            "value": "toIdx"
                                                                                        },
                                                                                        "id": 6075,
                                                                                        "name": "Identifier",
                                                                                        "src": "2139:5:50"
                                                                                    },
                                                                                    {
                                                                                        "attributes": {
                                                                                            "argumentTypes": null,
                                                                                            "overloadedDeclarations": [
                                                                                                null
                                                                                            ],
                                                                                            "referencedDeclaration": 6025,
                                                                                            "type": "uint8",
                                                                                            "value": "idx"
                                                                                        },
                                                                                        "id": 6076,
                                                                                        "name": "Identifier",
                                                                                        "src": "2147:3:50"
                                                                                    }
                                                                                ],
                                                                                "id": 6077,
                                                                                "name": "Assignment",
                                                                                "src": "2139:11:50"
                                                                            }
                                                                        ],
                                                                        "id": 6078,
                                                                        "name": "ExpressionStatement",
                                                                        "src": "2139:11:50"
                                                                    }
                                                                ],
                                                                "id": 6079,
                                                                "name": "Block",
                                                                "src": "2121:44:50"
                                                            }
                                                        ],
                                                        "id": 6080,
                                                        "name": "IfStatement",
                                                        "src": "2101:64:50"
                                                    }
                                                ],
                                                "id": 6081,
                                                "name": "Block",
                                                "src": "1838:337:50"
                                            }
                                        ],
                                        "id": 6082,
                                        "name": "ForStatement",
                                        "src": "1808:367:50"
                                    }
                                ],
                                "id": 6083,
                                "name": "Block",
                                "src": "1703:478:50"
                            }
                        ],
                        "id": 6084,
                        "name": "FunctionDefinition",
                        "src": "1546:635:50"
                    }
                ],
                "id": 6085,
                "name": "ContractDefinition",
                "src": "237:1946:50"
            }
        ],
        "id": 6086,
        "name": "SourceUnit",
        "src": "32:2152:50"
    },
    "compiler": {
        "name": "solc",
        "version": "0.6.8+commit.0bbfe453.Emscripten.clang"
    },
    "networks": {},
    "schemaVersion": "3.4.16",
    "updatedAt": "2025-02-07T17:50:42.829Z",
    "devdoc": {
        "methods": {}
    },
    "userdoc": {
        "methods": {}
    }
}
