From b42b992e84a0c6f8723db3a6f5a8395e71bdd4f9 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Mon, 6 Jul 2020 00:21:38 -0700 Subject: [PATCH] first cut --- src/balancer/artifacts/BFactory.json | 4105 ++ src/balancer/artifacts/BPool.json | 61759 +++++++++++++++++++++++++ src/balancer/balancerlib.ts | 941 + test/BalancerContractHandler.ts | 48 + test/unit/balancer/Balancer.test.ts | 164 + 5 files changed, 67017 insertions(+) create mode 100644 src/balancer/artifacts/BFactory.json create mode 100644 src/balancer/artifacts/BPool.json create mode 100644 src/balancer/balancerlib.ts create mode 100644 test/BalancerContractHandler.ts create mode 100644 test/unit/balancer/Balancer.test.ts diff --git a/src/balancer/artifacts/BFactory.json b/src/balancer/artifacts/BFactory.json new file mode 100644 index 00000000..99ec04be --- /dev/null +++ b/src/balancer/artifacts/BFactory.json @@ -0,0 +1,4105 @@ +{ + "contractName": "BFactory", + "abi": [ + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "blabs", + "type": "address" + } + ], + "name": "LOG_BLABS", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "LOG_NEW_POOL", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "getColor", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "b", + "type": "address" + } + ], + "name": "isBPool", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "newBPool", + "outputs": [ + { + "internalType": "contract BPool", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBLabs", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "b", + "type": "address" + } + ], + "name": "setBLabs", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract BPool", + "name": "pool", + "type": "address" + } + ], + "name": "collect", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.12+commit.7709ece9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"blabs\",\"type\":\"address\"}],\"name\":\"LOG_BLABS\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"LOG_NEW_POOL\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract BPool\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getBLabs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getColor\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"b\",\"type\":\"address\"}],\"name\":\"isBPool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"newBPool\",\"outputs\":[{\"internalType\":\"contract BPool\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"b\",\"type\":\"address\"}],\"name\":\"setBLabs\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/ocean/non-ocean/balancer-core/contracts/BFactory.sol\":\"BFactory\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"/ocean/non-ocean/balancer-core/contracts/BColor.sol\":{\"keccak256\":\"0xcf1ed6a3a6fae7926257262ea583e26b725a94902d0ca3b018e32cce3426404e\",\"urls\":[\"bzz-raw://c410c554680e9a4056cbb935b9f56c1e2a729ef401f8e827e99627867af655df\",\"dweb:/ipfs/QmQrdGdsT7katEUiH2jeM13qB7y27YosM75uDHhVAnm3sR\"]},\"/ocean/non-ocean/balancer-core/contracts/BConst.sol\":{\"keccak256\":\"0x841f1505feab665c28396a5e596e7ef538087847234f1b93e656a33b3eb283eb\",\"urls\":[\"bzz-raw://b24431b6242c142cb500503043b8876405a3d5e07cca4678bfa592cd76d33061\",\"dweb:/ipfs/QmNvyFrhATrRwQKWbSH3Unh8uHonEwdtYwnddtgKheUj3C\"]},\"/ocean/non-ocean/balancer-core/contracts/BFactory.sol\":{\"keccak256\":\"0xc96b48f6833e244357b5decadbae602401b72dff99bec02063fe8f7ce40969fc\",\"urls\":[\"bzz-raw://8b4bda2be617f0af79ae3dbc47d612840f29199f260aabbedec1ad67de2247e3\",\"dweb:/ipfs/QmSNJSoEiZQTYgitBtcbuPDFoqeAvxssfGLGMUJH1QdYc9\"]},\"/ocean/non-ocean/balancer-core/contracts/BMath.sol\":{\"keccak256\":\"0x33b23f581e9ca463b4989ebf1edc353d5490215d43921149a9090f7c007d9b93\",\"urls\":[\"bzz-raw://0ab26658da6983cd325bfc04364e02b3fa71552a7c01348294b0515d626dd55d\",\"dweb:/ipfs/QmXFpjj6Q1BoXYv8kz6vRkj2tyGGyGwW48haHKCw1oz8i4\"]},\"/ocean/non-ocean/balancer-core/contracts/BNum.sol\":{\"keccak256\":\"0x35ee281928601b5cc0b64fe87cd992f11c3ec53b59d046e2e344f6c343cd1c88\",\"urls\":[\"bzz-raw://a10e27baeb6a82e23829746854f43e1ea7733631d0426d084e0e114f4b873454\",\"dweb:/ipfs/QmdpjsU8rkemMGc3FRfYEvVwkj5LF641KVUGCnLNvkjJBn\"]},\"/ocean/non-ocean/balancer-core/contracts/BPool.sol\":{\"keccak256\":\"0xaf889738e49ce11952add4e5da8cfa0055a2f2cc4c082200fc4305648fa3307b\",\"urls\":[\"bzz-raw://3e7bdaed776af5209691d114a6455bd8fc0c85a9bc51bd8c45a0eee226623945\",\"dweb:/ipfs/QmUekZRLSj8PMHCg2nbhZNnUy4TEHLqwfDncjbYhQ75WrK\"]},\"/ocean/non-ocean/balancer-core/contracts/BToken.sol\":{\"keccak256\":\"0x8168aa8ac2bda34f49c3b045e9daafca461dcd1484f394608efd17a6cc830f6b\",\"urls\":[\"bzz-raw://2138263f13e99de7749446b23af6d8410a133508fa3a006eb603b91ed688aaef\",\"dweb:/ipfs/QmX45CPbyaCBMMFB18s6oBmywwYrdz5D14AKVR6KWrvLs2\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060018054600160a060020a03191633179055615fb1806100326000396000f3fe608060405234801561001057600080fd5b506004361061007e577c0100000000000000000000000000000000000000000000000000000000600035046306ec16f8811461008357806336ffb167146100ab5780639a86139b146100cf578063c2bb6dc2146100e9578063c6ce34fb14610123578063d556c5dc14610149575b600080fd5b6100a96004803603602081101561009957600080fd5b5035600160a060020a0316610151565b005b6100b361033e565b60408051600160a060020a039092168252519081900360200190f35b6100d761034d565b60408051918252519081900360200190f35b61010f600480360360208110156100ff57600080fd5b5035600160a060020a0316610371565b604080519115158252519081900360200190f35b6100a96004803603602081101561013957600080fd5b5035600160a060020a031661038f565b6100b3610456565b600154600160a060020a031633146101b3576040805160e560020a62461bcd02815260206004820152600d60248201527f4552525f4e4f545f424c41425300000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038416916370a0823191602480820192602092909190829003018186803b15801561021657600080fd5b505afa15801561022a573d6000803e3d6000fd5b505050506040513d602081101561024057600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050506040513d60208110156102e057600080fd5b5051905080610339576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f45524332305f4641494c454400000000000000000000000000000000604482015290519081900360640190fd5b505050565b600154600160a060020a031690565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600160a060020a031660009081526020819052604090205460ff1690565b600154600160a060020a031633146103f1576040805160e560020a62461bcd02815260206004820152600d60248201527f4552525f4e4f545f424c41425300000000000000000000000000000000000000604482015290519081900360640190fd5b604051600160a060020a0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806040516104659061054f565b604051809103906000f080158015610481573d6000803e3d6000fd5b50600160a060020a038116600081815260208190526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080517f92eefe9b0000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a038316916392eefe9b91602480830192600092919082900301818387803b15801561053157600080fd5b505af1158015610545573d6000803e3d6000fd5b5092935050505090565b615a208061055d8339019056fe60c0604052601360808190527f42616c616e63657220506f6f6c20546f6b656e0000000000000000000000000060a0908152620000409160039190620000f7565b506040805180820190915260038082527f425054000000000000000000000000000000000000000000000000000000000060209092019182526200008791600491620000f7565b506005805460ff19166012179055348015620000a257600080fd5b5060068054600580546201000060b060020a031916336201000081029190911790915564e8d4a51000600755600160a060020a03199091161760a060020a60ff02191690556008805460ff191690556200019c565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200013a57805160ff19168380011785556200016a565b828001600101855582156200016a579182015b828111156200016a5782518255916020019190600101906200014d565b50620001789291506200017c565b5090565b6200019991905b8082111562000178576000815560010162000183565b90565b61587480620001ac6000396000f3fe608060405234801561001057600080fd5b5060043610610378576000357c0100000000000000000000000000000000000000000000000000000000900480638d4e4083116101e7578063bc694ea211610122578063d73dd623116100c5578063d73dd62314610b7f578063dd62ed3e14610bab578063e4a28a521461047e578063e4e1e53814610bd9578063ec09302114610c0b578063f1b8a9b714610c13578063f8b2cb4f14610c39578063f8d6aed414610c5f578063fde924f714610c9a57610378565b8063bc694ea214610ad9578063be3bbd2e14610ae1578063c36596a6146104f2578063c6580d1214610b39578063cc77828d14610b41578063cd2ed8fb14610b49578063cf5e7bd314610b51578063d4cadf6814610b7757610378565b8063a221ee491161018a578063a221ee49146109a6578063a9059cbb146109db578063b02f0b7314610a07578063b0e0d13614610a7e578063b7b800a414610a86578063ba019dab14610a8e578063ba9530a614610a96578063bc063e1a14610ad157610378565b80638d4e40831461092a57806392eefe9b14610932578063936c3477146109585780639381cd2b14610960578063948d8ce61461096857806395d89b411461098e578063992e2a92146109965780639a86139b1461099e57610378565b806349b59552116102b757806376c7a3c71161025a57806376c7a3c7146107aa5780637c5e9ea4146107b25780638201aa3f1461080b57806382f652ad1461084b5780638656b65314610886578063867378c5146108c157806389298012146108c95780638c28cbe81461090457610378565b806349b595521461061b5780634bb278f31461063a5780634f69c0d4146106425780635c1bbaf7146106b95780635db34277146106f457806366188463146107265780636d06dfa01461075257806370a082311461078457610378565b8063218b53821161031f578063218b5382146104f257806323b872dd146104fa5780632f37b624146105305780633018205f14610556578063313ce5671461057a57806334e19907146105985780633fdddaa2146105b757806346ab38f1146105e957610378565b806302c967481461037d57806306fdde03146103c1578063095ea7b31461043e57806309a3bbe41461047e5780631446a7ff1461048657806315e84af9146104b457806318160ddd146104e2578063189d00ca146104ea575b600080fd5b6103af6004803603606081101561039357600080fd5b50600160a060020a038135169060208101359060400135610ca2565b60408051918252519081900360200190f35b6103c9610fef565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104035781810151838201526020016103eb565b50505050905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61046a6004803603604081101561045457600080fd5b50600160a060020a038135169060200135611085565b604080519115158252519081900360200190f35b6103af6110da565b6103af6004803603604081101561049c57600080fd5b50600160a060020a03813581169160200135166110e7565b6103af600480360360408110156104ca57600080fd5b50600160a060020a0381358116916020013516611241565b6103af611392565b6103af611398565b6103af6113ac565b61046a6004803603606081101561051057600080fd5b50600160a060020a038135811691602081013590911690604001356113b8565b61046a6004803603602081101561054657600080fd5b5035600160a060020a031661151d565b61055e61153b565b60408051600160a060020a039092168252519081900360200190f35b61058261159c565b6040805160ff9092168252519081900360200190f35b6105b5600480360360208110156105ae57600080fd5b50356115a5565b005b6105b5600480360360608110156105cd57600080fd5b50600160a060020a0381351690602081013590604001356117c9565b6103af600480360360608110156105ff57600080fd5b50600160a060020a038135169060208101359060400135611c15565b6105b56004803603602081101561063157600080fd5b50351515611f01565b6105b5612092565b6105b56004803603604081101561065857600080fd5b8135919081019060408101602082013564010000000081111561067a57600080fd5b82018360208201111561068c57600080fd5b803590602001918460208302840111640100000000831117156106ae57600080fd5b5090925090506122a9565b6103af600480360360c08110156106cf57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612590565b6103af6004803603606081101561070a57600080fd5b50600160a060020a038135169060208101359060400135612648565b61046a6004803603604081101561073c57600080fd5b50600160a060020a038135169060200135612919565b6103af6004803603606081101561076857600080fd5b50600160a060020a0381351690602081013590604001356129f1565b6103af6004803603602081101561079a57600080fd5b5035600160a060020a0316612cf0565b6103af612d0b565b6107f2600480360360a08110156107c857600080fd5b50600160a060020a0381358116916020810135916040820135169060608101359060800135612d1d565b6040805192835260208301919091528051918290030190f35b6107f2600480360360a081101561082157600080fd5b50600160a060020a038135811691602081013591604082013516906060810135906080013561320d565b6103af600480360360c081101561086157600080fd5b5080359060208101359060408101359060608101359060808101359060a001356136e4565b6103af600480360360c081101561089c57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356137a3565b6103af613844565b6103af600480360360c08110156108df57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613858565b6105b56004803603602081101561091a57600080fd5b5035600160a060020a0316613908565b61046a613ad9565b6105b56004803603602081101561094857600080fd5b5035600160a060020a0316613ae2565b6103af613c2c565b6103af613c84565b6103af6004803603602081101561097e57600080fd5b5035600160a060020a0316613c91565b6103c9613d5f565b6103af613dc0565b6103af613dcc565b6103af600480360360a08110156109bc57600080fd5b5080359060208101359060408101359060608101359060800135613df0565b61046a600480360360408110156109f157600080fd5b50600160a060020a038135169060200135613e55565b6105b560048036036040811015610a1d57600080fd5b81359190810190604081016020820135640100000000811115610a3f57600080fd5b820183602082011115610a5157600080fd5b80359060200191846020830284011164010000000083111715610a7357600080fd5b509092509050613e6b565b6103af61419f565b6103af6141a4565b6103af6141a9565b6103af600480360360c0811015610aac57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356141ae565b6103af61422f565b6103af61423f565b610ae961424b565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b25578181015183820152602001610b0d565b505050509050019250505060405180910390f35b6103af614343565b610ae9614348565b6103af614399565b6105b560048036036020811015610b6757600080fd5b5035600160a060020a031661439f565b6103af61472c565b61046a60048036036040811015610b9557600080fd5b50600160a060020a038135169060200135614784565b6103af60048036036040811015610bc157600080fd5b50600160a060020a0381358116916020013516614805565b6105b560048036036060811015610bef57600080fd5b50600160a060020a038135169060208101359060400135614830565b6103af614ab4565b6103af60048036036020811015610c2957600080fd5b5035600160a060020a0316614ac4565b6103af60048036036020811015610c4f57600080fd5b5035600160a060020a0316614ba4565b6103af600480360360c0811015610c7557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135614c72565b61046a614cf5565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610d53576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16610daa576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16610e08576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600390810154610e3d91670de0b6b3a76400005b04600101614d05565b831115610e82576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754610ebc949392919089906136e4565b915081610f01576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115610f47576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b610f55816003015485614dee565b60038201556000610f668382614d05565b604080518781529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3610fa23384614e5f565b610fb4610faf8483614dee565b614e6d565b600554610fd090620100009004600160a060020a031682614e79565b610fdb863387614e83565b50506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390926000805160206157c0833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff1615611138576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611196576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff166111f4576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682528120600380840154600280860154928401549084015493946112389492939290613df0565b95945050505050565b600554600090610100900460ff1615611292576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff166112f0576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff1661134e576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682529020600380830154600280850154928401549084015460075461123894929190613df0565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a03851614806113f45750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b611448576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b611453848484614f78565b33600160a060020a038516148015906114915750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b1561151357600160a060020a03841660009081526001602090815260408083203384529091529020546114c49083614dee565b600160a060020a03858116600090815260016020908152604080832033808552908352928190208590558051948552519287169391926000805160206157c08339815191529281900390910190a35b5060019392505050565b600160a060020a03166000908152600a602052604090205460ff1690565b600554600090610100900460ff161561158c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600654600160a060020a031690565b60055460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611654576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156116ac576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a031633146116fc576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b64e8d4a51000811015611759576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d494e5f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b67016345785d8a00008111156117b9576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d41585f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b6007556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611878576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146118d9576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611937576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615611980576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b670de0b6b3a76400008110156119e0576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b6802b5e3af16b1880000811115611a41576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b620f4240821015611a9c576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4d494e5f42414c414e43450000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206002015480821115611b3f57611ad5600b54611ad08484614dee565b615082565b600b8190556802b5e3af16b18800001015611b3a576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f4d41585f544f54414c5f574549474854000000000000000000000000604482015290519081900360640190fd5b611b60565b80821015611b6057611b5c600b54611b578385614dee565b614dee565b600b555b600160a060020a0384166000908152600a602052604090206002810183905560030180549084905580841115611ba957611ba48533611b9f8785614dee565b6150df565b611c03565b80841015611c03576000611bbd8286614dee565b90506000611bcc826000614d05565b9050611be28733611bdd8585614dee565b614e83565b600554611c00908890620100009004600160a060020a031683614e83565b50505b50506005805461ff0019169055505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611cc6576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16611d1d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16611d7b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754611db594939291908990613858565b915082821015611dfd576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a60205260409020600390810154611e2d91670de0b6b3a7640000610e34565b821115611e72576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b611e80816003015483614dee565b60038201556000611e918582614d05565b604080518581529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3611ecd3386614e5f565b611eda610faf8683614dee565b600554611ef690620100009004600160a060020a031682614e79565b610fdb863385614e83565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611fb0576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff1615612008576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a03163314612058576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805491151560a060020a0274ff0000000000000000000000000000000000000000199092169190911790556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612141576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146121a2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b60085460ff16156121eb576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b60095460021115612246576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191660011790556006805474ff0000000000000000000000000000000000000000191660a060020a17905561228968056bc75e2d63100000615151565b61229c3368056bc75e2d63100000614e79565b6005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612358576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff166123af576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b60006123b9611392565b905060006123c7858361515a565b90508061240c576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b60005b60095481101561257c5760006009828154811061242857fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061245d8583614d05565b9050806124a2576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8787858181106124ae57fe5b905060200201358111156124fa576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a60205260409020600301546125209082615082565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157008339815191529281900390910190a36125718333836150df565b50505060010161240f565b5061258685615151565b611c033386614e79565b60008061259d878661515a565b905060006125ab8786615082565b905060006125b9828961515a565b905060006125cf670de0b6b3a76400008561515a565b905060006125dd8383615296565b905060006125eb828e614d05565b905060006125f9828f614dee565b90506000612618612612670de0b6b3a76400008a614dee565b8b614d05565b905061263582612630670de0b6b3a764000084614dee565b61515a565b9f9e505050505050505050505050505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156126f9576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612750576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff166127ae576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600301546127e0906002670de0b6b3a76400005b04614d05565b831115612825576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b5460075461285f949392919089906137a3565b9150828210156128a7576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b6128b5816003015485615082565b6003820155604080518581529051600160a060020a0387169133916000805160206157008339815191529181900360200190a36128f182615151565b6128fb3383614e79565b6129068533866150df565b506005805461ff00191690559392505050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561296e57336000908152600160209081526040808320600160a060020a038816845290915281205561299d565b6129788184614dee565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293926000805160206157c0833981519152929181900390910190a35060019392505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612aa2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612af9576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16612b57576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754612b9194939291908990612590565b915081612bd6576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115612c1c576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a6020526040902060030154612c4c906002670de0b6b3a76400006127da565b821115612c91576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b612c9f816003015483615082565b6003820155604080518381529051600160a060020a0387169133916000805160206157008339815191529181900360200190a3612cdb84615151565b612ce53385614e79565b6129068533846150df565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a76400006113a8565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612dbd576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff16612e2a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16612e88576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff16612ee9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a602052604080822092881682529020600380820154612f2291670de0b6b3a7640000610e34565b861115612f67576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b6000612f888360030154846002015484600301548560020154600754613df0565b905085811115612fe2576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b61300283600301548460020154846003015485600201548b600754614c72565b94508885111561304a576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b613058836003015486615082565b836003018190555061306e826003015488614dee565b600380840182905584015460028086015490850154600754613091949190613df0565b9350808410156130d9576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613131576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61313b858861515a565b811115613180576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a46131e88a33876150df565b6131f3883389614e83565b5050506005805461ff001916905590969095509350505050565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156132ad576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff1661331a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16613378576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff166133d9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a6020526040808220928816825290206003820154613413906002670de0b6b3a76400006127da565b881115613458576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b60006134798360030154846002015484600301548560020154600754613df0565b9050858111156134d3576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b6134f383600301548460020154846003015485600201548d6007546141ae565b94508685101561353b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b61354983600301548a615082565b836003018190555061355f826003015486614dee565b600380840182905584015460028086015490850154600754613582949190613df0565b9350808410156135ca576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613622576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61362c898661515a565b811115613671576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46136d98a338b6150df565b6131f3883387614e83565b6000806136f1878661515a565b90506000613707670de0b6b3a764000083614dee565b905060006137158286614d05565b9050600061372f87612630670de0b6b3a764000085614dee565b9050600061373d8c83614dee565b9050600061374b828e61515a565b905060006137598288615296565b90506000613767828e614d05565b905060006137758e83614dee565b905061378e81612630670de0b6b3a76400006000614dee565b99505050505050505050509695505050505050565b6000806137b0878661515a565b905060006137cf6137c9670de0b6b3a764000084614dee565b85614d05565b905060006137ee866137e9670de0b6b3a764000085614dee565b614d05565b905060006137fc8b83615082565b9050600061380a828d61515a565b905060006138188287615296565b90506000613826828d614d05565b9050613832818d614dee565b9e9d5050505050505050505050505050565b64e8d4a51000670de0b6b3a76400006113a8565b600080613865878661515a565b90506000613880856137e9670de0b6b3a76400006000614dee565b9050600061388e8883614dee565b9050600061389c828a61515a565b905060006138bb826138b6670de0b6b3a76400008861515a565b615296565b905060006138c9828e614d05565b905060006138d78e83614dee565b905060006138f0612612670de0b6b3a76400008a614dee565b9050612635826137e9670de0b6b3a764000084614dee565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156139b7576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0381166000908152600a602052604090205460ff16613a24576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038316916370a08231916024808301926020929190829003018186803b158015613a8357600080fd5b505afa158015613a97573d6000803e3d6000fd5b505050506040513d6020811015613aad57600080fd5b5051600160a060020a039091166000908152600a60205260409020600301556005805461ff0019169055565b60085460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613b91576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a0390911614613bf2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615613c7d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600b5490565b68056bc75e2d6310000081565b600554600090610100900460ff1615613ce2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16613d40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b6704a03ce68d21555681565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600080613dfd878761515a565b90506000613e0b868661515a565b90506000613e19838361515a565b90506000613e3b670de0b6b3a7640000612630670de0b6b3a764000089614dee565b9050613e478282614d05565b9a9950505050505050505050565b6000613e62338484614f78565b50600192915050565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613f1a576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16613f71576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b6000613f7b611392565b90506000613f8a856000614d05565b90506000613f988683614dee565b90506000613fa6828561515a565b905080613feb576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b613ff53388614e5f565b60055461401190620100009004600160a060020a031684614e79565b61401a82614e6d565b60005b60095481101561418a5760006009828154811061403657fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061406b8583614d05565b9050806140b0576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8989858181106140bc57fe5b90506020020135811015614108576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206003015461412e9082614dee565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157a08339815191529281900390910190a361417f833383614e83565b50505060010161401d565b50506005805461ff0019169055505050505050565b600881565b600281565b600181565b6000806141bb878661515a565b905060006141d1670de0b6b3a764000085614dee565b90506141dd8582614d05565b905060006141ef8a6126308c85615082565b905060006141fd8285615296565b90506000614213670de0b6b3a764000083614dee565b905061421f8a82614d05565b9c9b505050505050505050505050565b600a670de0b6b3a76400006113a8565b671bc16d674ec7ffff81565b600554606090610100900460ff161561429c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60085460ff166142e4576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600980548060200260200160405190810160405280929190818152602001828054801561107b57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161431c575050505050905090565b600081565b600554606090610100900460ff16156142e4576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60095490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561444e576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146144af576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a602052604090205460ff1661450d576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615614556576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a60205260408120600301549061457d8282614d05565b600b54600160a060020a0385166000908152600a60205260409020600201549192506145a891614dee565b600b55600160a060020a0383166000908152600a60205260409020600101546009805460001981019190829081106145dc57fe5b60009182526020909120015460098054600160a060020a03909216918490811061460257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a0316021790555081600a60006009858154811061464257fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060010155600980548061467557fe5b600082815260208082206000199084018101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556040805160808101825283815280830184815281830185815260608301868152600160a060020a038c168752600a909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561470e8533611bdd8787614dee565b600554611c03908690620100009004600160a060020a031685614e83565b600554600090610100900460ff161561477d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b5060075490565b336000908152600160209081526040808320600160a060020a03861684529091528120546147b29083615082565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191936000805160206157c0833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600654600160a060020a031633146148e1576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff1615614952576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f49535f424f554e440000000000000000000000000000000000000000604482015290519081900360640190fd5b60085460ff161561499b576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b6009546008116149f5576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b604080516080810182526001808252600980546020808501918252600085870181815260608701828152600160a060020a038c16808452600a9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19169091179055614aaf8383836117c9565b505050565b6002670de0b6b3a76400006113a8565b600554600090610100900460ff1615614b15576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614b73576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a6020526040902060020154600b54614b9d90829061515a565b9392505050565b600554600090610100900460ff1615614bf5576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614c53576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206003015490565b600080614c7f858861515a565b90506000614c8d8786614dee565b90506000614c9b888361515a565b90506000614ca98285615296565b9050614cbd81670de0b6b3a7640000614dee565b9050614cd1670de0b6b3a764000087614dee565b9450614ce6614ce08c83614d05565b8661515a565b9b9a5050505050505050505050565b60065460a060020a900460ff1690565b6000828202831580614d1f575082848281614d1c57fe5b04145b614d73576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6706f05b59d3b20000810181811015614dd6576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6000670de0b6b3a7640000825b049695505050505050565b6000806000614dfd85856153b9565b915091508015614e57576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b614e6982826153de565b5050565b614e76816153e9565b50565b614e6982826154b3565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015614eef57600080fd5b505af1158015614f03573d6000803e3d6000fd5b505050506040513d6020811015614f1957600080fd5b5051905080614f72576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f45524332305f46414c53450000000000000000000000000000000000604482015290519081900360640190fd5b50505050565b600160a060020a038316600090815260208190526040902054811115614fe8576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526020819052604090205461500b9082614dee565b600160a060020a03808516600090815260208190526040808220939093559084168152205461503a9082615082565b600160a060020a0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061576083398151915292918290030190a3505050565b600082820183811015614b9d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015614eef57600080fd5b614e76816154be565b6000816151b1576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4449565f5a45524f0000000000000000000000000000000000000000604482015290519081900360640190fd5b670de0b6b3a764000083028315806151d95750670de0b6b3a76400008482816151d657fe5b04145b61522d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6002830481018181101561528b576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6000848281614de357fe5b600060018310156152f1576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42504f575f424153455f544f4f5f4c4f570000000000000000000000604482015290519081900360640190fd5b671bc16d674ec7ffff831115615351576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f42504f575f424153455f544f4f5f4849474800000000000000000000604482015290519081900360640190fd5b600061535c83615521565b9050600061536a8483614dee565b905060006153808661537b8561553c565b61554a565b9050816153915792506110d4915050565b60006153a287846305f5e1006155a1565b90506153ae8282614d05565b979650505050505050565b6000808284106153cf57505080820360006153d7565b505081810360015b9250929050565b614e69823083614f78565b30600090815260208190526040902054811115615450576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b3060009081526020819052604090205461546a9082614dee565b306000908152602081905260409020556002546154879082614dee565b60025560408051828152905160009130916000805160206157608339815191529181900360200190a350565b614e69308383614f78565b306000908152602081905260409020546154d89082615082565b306000908152602081905260409020556002546154f59082615082565b60025560408051828152905130916000916000805160206157608339815191529181900360200190a350565b6000670de0b6b3a76400006155358361553c565b0292915050565b670de0b6b3a7640000900490565b6000806002830661556357670de0b6b3a7640000615565565b835b90506002830492505b8215614b9d5761557e8485614d05565b93506002830615615596576155938185614d05565b90505b60028304925061556e565b60008281806155b887670de0b6b3a76400006153b9565b9092509050670de0b6b3a764000080600060015b888410615670576000670de0b6b3a7640000820290506000806156008a6155fb85670de0b6b3a7640000614dee565b6153b9565b91509150615612876137e9848c614d05565b965061561e878461515a565b96508661562d57505050615670565b8715615637579315935b8015615641579315935b8415615658576156518688614dee565b9550615665565b6156628688615082565b95505b5050506001016155cc565b5090999850505050505050505056fe4552525f4e4f545f46494e414c495a45440000000000000000000000000000004552525f5245454e5452590000000000000000000000000000000000000000004552525f4c494d49545f494e00000000000000000000000000000000000000004552525f4d41585f4f55545f524154494f00000000000000000000000000000063982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a4552525f4e4f545f434f4e54524f4c4c455200000000000000000000000000004552525f4d41585f494e5f524154494f00000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552525f4e4f545f424f554e4400000000000000000000000000000000000000e74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9254552525f49535f46494e414c495a4544000000000000000000000000000000004552525f4c494d49545f4f5554000000000000000000000000000000000000004552525f4d4154485f415050524f580000000000000000000000000000000000a265627a7a72315820f3cd1bf05ff9d2e4dbad16fd31665ab67326ac6112987074d3c59993d329a0d764736f6c634300050c0032a265627a7a7231582036f8df06b4677a8ebf021335be56a5563b1e9426377a750e3047bd1e636872e264736f6c634300050c0032", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007e577c0100000000000000000000000000000000000000000000000000000000600035046306ec16f8811461008357806336ffb167146100ab5780639a86139b146100cf578063c2bb6dc2146100e9578063c6ce34fb14610123578063d556c5dc14610149575b600080fd5b6100a96004803603602081101561009957600080fd5b5035600160a060020a0316610151565b005b6100b361033e565b60408051600160a060020a039092168252519081900360200190f35b6100d761034d565b60408051918252519081900360200190f35b61010f600480360360208110156100ff57600080fd5b5035600160a060020a0316610371565b604080519115158252519081900360200190f35b6100a96004803603602081101561013957600080fd5b5035600160a060020a031661038f565b6100b3610456565b600154600160a060020a031633146101b3576040805160e560020a62461bcd02815260206004820152600d60248201527f4552525f4e4f545f424c41425300000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038416916370a0823191602480820192602092909190829003018186803b15801561021657600080fd5b505afa15801561022a573d6000803e3d6000fd5b505050506040513d602081101561024057600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050506040513d60208110156102e057600080fd5b5051905080610339576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f45524332305f4641494c454400000000000000000000000000000000604482015290519081900360640190fd5b505050565b600154600160a060020a031690565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600160a060020a031660009081526020819052604090205460ff1690565b600154600160a060020a031633146103f1576040805160e560020a62461bcd02815260206004820152600d60248201527f4552525f4e4f545f424c41425300000000000000000000000000000000000000604482015290519081900360640190fd5b604051600160a060020a0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806040516104659061054f565b604051809103906000f080158015610481573d6000803e3d6000fd5b50600160a060020a038116600081815260208190526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080517f92eefe9b0000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a038316916392eefe9b91602480830192600092919082900301818387803b15801561053157600080fd5b505af1158015610545573d6000803e3d6000fd5b5092935050505090565b615a208061055d8339019056fe60c0604052601360808190527f42616c616e63657220506f6f6c20546f6b656e0000000000000000000000000060a0908152620000409160039190620000f7565b506040805180820190915260038082527f425054000000000000000000000000000000000000000000000000000000000060209092019182526200008791600491620000f7565b506005805460ff19166012179055348015620000a257600080fd5b5060068054600580546201000060b060020a031916336201000081029190911790915564e8d4a51000600755600160a060020a03199091161760a060020a60ff02191690556008805460ff191690556200019c565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200013a57805160ff19168380011785556200016a565b828001600101855582156200016a579182015b828111156200016a5782518255916020019190600101906200014d565b50620001789291506200017c565b5090565b6200019991905b8082111562000178576000815560010162000183565b90565b61587480620001ac6000396000f3fe608060405234801561001057600080fd5b5060043610610378576000357c0100000000000000000000000000000000000000000000000000000000900480638d4e4083116101e7578063bc694ea211610122578063d73dd623116100c5578063d73dd62314610b7f578063dd62ed3e14610bab578063e4a28a521461047e578063e4e1e53814610bd9578063ec09302114610c0b578063f1b8a9b714610c13578063f8b2cb4f14610c39578063f8d6aed414610c5f578063fde924f714610c9a57610378565b8063bc694ea214610ad9578063be3bbd2e14610ae1578063c36596a6146104f2578063c6580d1214610b39578063cc77828d14610b41578063cd2ed8fb14610b49578063cf5e7bd314610b51578063d4cadf6814610b7757610378565b8063a221ee491161018a578063a221ee49146109a6578063a9059cbb146109db578063b02f0b7314610a07578063b0e0d13614610a7e578063b7b800a414610a86578063ba019dab14610a8e578063ba9530a614610a96578063bc063e1a14610ad157610378565b80638d4e40831461092a57806392eefe9b14610932578063936c3477146109585780639381cd2b14610960578063948d8ce61461096857806395d89b411461098e578063992e2a92146109965780639a86139b1461099e57610378565b806349b59552116102b757806376c7a3c71161025a57806376c7a3c7146107aa5780637c5e9ea4146107b25780638201aa3f1461080b57806382f652ad1461084b5780638656b65314610886578063867378c5146108c157806389298012146108c95780638c28cbe81461090457610378565b806349b595521461061b5780634bb278f31461063a5780634f69c0d4146106425780635c1bbaf7146106b95780635db34277146106f457806366188463146107265780636d06dfa01461075257806370a082311461078457610378565b8063218b53821161031f578063218b5382146104f257806323b872dd146104fa5780632f37b624146105305780633018205f14610556578063313ce5671461057a57806334e19907146105985780633fdddaa2146105b757806346ab38f1146105e957610378565b806302c967481461037d57806306fdde03146103c1578063095ea7b31461043e57806309a3bbe41461047e5780631446a7ff1461048657806315e84af9146104b457806318160ddd146104e2578063189d00ca146104ea575b600080fd5b6103af6004803603606081101561039357600080fd5b50600160a060020a038135169060208101359060400135610ca2565b60408051918252519081900360200190f35b6103c9610fef565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104035781810151838201526020016103eb565b50505050905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61046a6004803603604081101561045457600080fd5b50600160a060020a038135169060200135611085565b604080519115158252519081900360200190f35b6103af6110da565b6103af6004803603604081101561049c57600080fd5b50600160a060020a03813581169160200135166110e7565b6103af600480360360408110156104ca57600080fd5b50600160a060020a0381358116916020013516611241565b6103af611392565b6103af611398565b6103af6113ac565b61046a6004803603606081101561051057600080fd5b50600160a060020a038135811691602081013590911690604001356113b8565b61046a6004803603602081101561054657600080fd5b5035600160a060020a031661151d565b61055e61153b565b60408051600160a060020a039092168252519081900360200190f35b61058261159c565b6040805160ff9092168252519081900360200190f35b6105b5600480360360208110156105ae57600080fd5b50356115a5565b005b6105b5600480360360608110156105cd57600080fd5b50600160a060020a0381351690602081013590604001356117c9565b6103af600480360360608110156105ff57600080fd5b50600160a060020a038135169060208101359060400135611c15565b6105b56004803603602081101561063157600080fd5b50351515611f01565b6105b5612092565b6105b56004803603604081101561065857600080fd5b8135919081019060408101602082013564010000000081111561067a57600080fd5b82018360208201111561068c57600080fd5b803590602001918460208302840111640100000000831117156106ae57600080fd5b5090925090506122a9565b6103af600480360360c08110156106cf57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612590565b6103af6004803603606081101561070a57600080fd5b50600160a060020a038135169060208101359060400135612648565b61046a6004803603604081101561073c57600080fd5b50600160a060020a038135169060200135612919565b6103af6004803603606081101561076857600080fd5b50600160a060020a0381351690602081013590604001356129f1565b6103af6004803603602081101561079a57600080fd5b5035600160a060020a0316612cf0565b6103af612d0b565b6107f2600480360360a08110156107c857600080fd5b50600160a060020a0381358116916020810135916040820135169060608101359060800135612d1d565b6040805192835260208301919091528051918290030190f35b6107f2600480360360a081101561082157600080fd5b50600160a060020a038135811691602081013591604082013516906060810135906080013561320d565b6103af600480360360c081101561086157600080fd5b5080359060208101359060408101359060608101359060808101359060a001356136e4565b6103af600480360360c081101561089c57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356137a3565b6103af613844565b6103af600480360360c08110156108df57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613858565b6105b56004803603602081101561091a57600080fd5b5035600160a060020a0316613908565b61046a613ad9565b6105b56004803603602081101561094857600080fd5b5035600160a060020a0316613ae2565b6103af613c2c565b6103af613c84565b6103af6004803603602081101561097e57600080fd5b5035600160a060020a0316613c91565b6103c9613d5f565b6103af613dc0565b6103af613dcc565b6103af600480360360a08110156109bc57600080fd5b5080359060208101359060408101359060608101359060800135613df0565b61046a600480360360408110156109f157600080fd5b50600160a060020a038135169060200135613e55565b6105b560048036036040811015610a1d57600080fd5b81359190810190604081016020820135640100000000811115610a3f57600080fd5b820183602082011115610a5157600080fd5b80359060200191846020830284011164010000000083111715610a7357600080fd5b509092509050613e6b565b6103af61419f565b6103af6141a4565b6103af6141a9565b6103af600480360360c0811015610aac57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356141ae565b6103af61422f565b6103af61423f565b610ae961424b565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b25578181015183820152602001610b0d565b505050509050019250505060405180910390f35b6103af614343565b610ae9614348565b6103af614399565b6105b560048036036020811015610b6757600080fd5b5035600160a060020a031661439f565b6103af61472c565b61046a60048036036040811015610b9557600080fd5b50600160a060020a038135169060200135614784565b6103af60048036036040811015610bc157600080fd5b50600160a060020a0381358116916020013516614805565b6105b560048036036060811015610bef57600080fd5b50600160a060020a038135169060208101359060400135614830565b6103af614ab4565b6103af60048036036020811015610c2957600080fd5b5035600160a060020a0316614ac4565b6103af60048036036020811015610c4f57600080fd5b5035600160a060020a0316614ba4565b6103af600480360360c0811015610c7557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135614c72565b61046a614cf5565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610d53576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16610daa576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16610e08576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600390810154610e3d91670de0b6b3a76400005b04600101614d05565b831115610e82576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754610ebc949392919089906136e4565b915081610f01576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115610f47576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b610f55816003015485614dee565b60038201556000610f668382614d05565b604080518781529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3610fa23384614e5f565b610fb4610faf8483614dee565b614e6d565b600554610fd090620100009004600160a060020a031682614e79565b610fdb863387614e83565b50506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390926000805160206157c0833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff1615611138576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611196576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff166111f4576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682528120600380840154600280860154928401549084015493946112389492939290613df0565b95945050505050565b600554600090610100900460ff1615611292576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff166112f0576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff1661134e576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682529020600380830154600280850154928401549084015460075461123894929190613df0565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a03851614806113f45750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b611448576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b611453848484614f78565b33600160a060020a038516148015906114915750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b1561151357600160a060020a03841660009081526001602090815260408083203384529091529020546114c49083614dee565b600160a060020a03858116600090815260016020908152604080832033808552908352928190208590558051948552519287169391926000805160206157c08339815191529281900390910190a35b5060019392505050565b600160a060020a03166000908152600a602052604090205460ff1690565b600554600090610100900460ff161561158c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600654600160a060020a031690565b60055460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611654576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156116ac576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a031633146116fc576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b64e8d4a51000811015611759576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d494e5f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b67016345785d8a00008111156117b9576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d41585f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b6007556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611878576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146118d9576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611937576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615611980576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b670de0b6b3a76400008110156119e0576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b6802b5e3af16b1880000811115611a41576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b620f4240821015611a9c576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4d494e5f42414c414e43450000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206002015480821115611b3f57611ad5600b54611ad08484614dee565b615082565b600b8190556802b5e3af16b18800001015611b3a576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f4d41585f544f54414c5f574549474854000000000000000000000000604482015290519081900360640190fd5b611b60565b80821015611b6057611b5c600b54611b578385614dee565b614dee565b600b555b600160a060020a0384166000908152600a602052604090206002810183905560030180549084905580841115611ba957611ba48533611b9f8785614dee565b6150df565b611c03565b80841015611c03576000611bbd8286614dee565b90506000611bcc826000614d05565b9050611be28733611bdd8585614dee565b614e83565b600554611c00908890620100009004600160a060020a031683614e83565b50505b50506005805461ff0019169055505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611cc6576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16611d1d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16611d7b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754611db594939291908990613858565b915082821015611dfd576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a60205260409020600390810154611e2d91670de0b6b3a7640000610e34565b821115611e72576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b611e80816003015483614dee565b60038201556000611e918582614d05565b604080518581529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3611ecd3386614e5f565b611eda610faf8683614dee565b600554611ef690620100009004600160a060020a031682614e79565b610fdb863385614e83565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611fb0576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff1615612008576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a03163314612058576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805491151560a060020a0274ff0000000000000000000000000000000000000000199092169190911790556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612141576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146121a2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b60085460ff16156121eb576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b60095460021115612246576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191660011790556006805474ff0000000000000000000000000000000000000000191660a060020a17905561228968056bc75e2d63100000615151565b61229c3368056bc75e2d63100000614e79565b6005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612358576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff166123af576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b60006123b9611392565b905060006123c7858361515a565b90508061240c576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b60005b60095481101561257c5760006009828154811061242857fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061245d8583614d05565b9050806124a2576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8787858181106124ae57fe5b905060200201358111156124fa576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a60205260409020600301546125209082615082565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157008339815191529281900390910190a36125718333836150df565b50505060010161240f565b5061258685615151565b611c033386614e79565b60008061259d878661515a565b905060006125ab8786615082565b905060006125b9828961515a565b905060006125cf670de0b6b3a76400008561515a565b905060006125dd8383615296565b905060006125eb828e614d05565b905060006125f9828f614dee565b90506000612618612612670de0b6b3a76400008a614dee565b8b614d05565b905061263582612630670de0b6b3a764000084614dee565b61515a565b9f9e505050505050505050505050505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156126f9576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612750576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff166127ae576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600301546127e0906002670de0b6b3a76400005b04614d05565b831115612825576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b5460075461285f949392919089906137a3565b9150828210156128a7576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b6128b5816003015485615082565b6003820155604080518581529051600160a060020a0387169133916000805160206157008339815191529181900360200190a36128f182615151565b6128fb3383614e79565b6129068533866150df565b506005805461ff00191690559392505050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561296e57336000908152600160209081526040808320600160a060020a038816845290915281205561299d565b6129788184614dee565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293926000805160206157c0833981519152929181900390910190a35060019392505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612aa2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612af9576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16612b57576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754612b9194939291908990612590565b915081612bd6576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115612c1c576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a6020526040902060030154612c4c906002670de0b6b3a76400006127da565b821115612c91576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b612c9f816003015483615082565b6003820155604080518381529051600160a060020a0387169133916000805160206157008339815191529181900360200190a3612cdb84615151565b612ce53385614e79565b6129068533846150df565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a76400006113a8565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612dbd576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff16612e2a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16612e88576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff16612ee9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a602052604080822092881682529020600380820154612f2291670de0b6b3a7640000610e34565b861115612f67576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b6000612f888360030154846002015484600301548560020154600754613df0565b905085811115612fe2576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b61300283600301548460020154846003015485600201548b600754614c72565b94508885111561304a576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b613058836003015486615082565b836003018190555061306e826003015488614dee565b600380840182905584015460028086015490850154600754613091949190613df0565b9350808410156130d9576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613131576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61313b858861515a565b811115613180576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a46131e88a33876150df565b6131f3883389614e83565b5050506005805461ff001916905590969095509350505050565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156132ad576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff1661331a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16613378576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff166133d9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a6020526040808220928816825290206003820154613413906002670de0b6b3a76400006127da565b881115613458576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b60006134798360030154846002015484600301548560020154600754613df0565b9050858111156134d3576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b6134f383600301548460020154846003015485600201548d6007546141ae565b94508685101561353b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b61354983600301548a615082565b836003018190555061355f826003015486614dee565b600380840182905584015460028086015490850154600754613582949190613df0565b9350808410156135ca576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613622576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61362c898661515a565b811115613671576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46136d98a338b6150df565b6131f3883387614e83565b6000806136f1878661515a565b90506000613707670de0b6b3a764000083614dee565b905060006137158286614d05565b9050600061372f87612630670de0b6b3a764000085614dee565b9050600061373d8c83614dee565b9050600061374b828e61515a565b905060006137598288615296565b90506000613767828e614d05565b905060006137758e83614dee565b905061378e81612630670de0b6b3a76400006000614dee565b99505050505050505050509695505050505050565b6000806137b0878661515a565b905060006137cf6137c9670de0b6b3a764000084614dee565b85614d05565b905060006137ee866137e9670de0b6b3a764000085614dee565b614d05565b905060006137fc8b83615082565b9050600061380a828d61515a565b905060006138188287615296565b90506000613826828d614d05565b9050613832818d614dee565b9e9d5050505050505050505050505050565b64e8d4a51000670de0b6b3a76400006113a8565b600080613865878661515a565b90506000613880856137e9670de0b6b3a76400006000614dee565b9050600061388e8883614dee565b9050600061389c828a61515a565b905060006138bb826138b6670de0b6b3a76400008861515a565b615296565b905060006138c9828e614d05565b905060006138d78e83614dee565b905060006138f0612612670de0b6b3a76400008a614dee565b9050612635826137e9670de0b6b3a764000084614dee565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156139b7576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0381166000908152600a602052604090205460ff16613a24576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038316916370a08231916024808301926020929190829003018186803b158015613a8357600080fd5b505afa158015613a97573d6000803e3d6000fd5b505050506040513d6020811015613aad57600080fd5b5051600160a060020a039091166000908152600a60205260409020600301556005805461ff0019169055565b60085460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613b91576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a0390911614613bf2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615613c7d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600b5490565b68056bc75e2d6310000081565b600554600090610100900460ff1615613ce2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16613d40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b6704a03ce68d21555681565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600080613dfd878761515a565b90506000613e0b868661515a565b90506000613e19838361515a565b90506000613e3b670de0b6b3a7640000612630670de0b6b3a764000089614dee565b9050613e478282614d05565b9a9950505050505050505050565b6000613e62338484614f78565b50600192915050565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613f1a576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16613f71576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b6000613f7b611392565b90506000613f8a856000614d05565b90506000613f988683614dee565b90506000613fa6828561515a565b905080613feb576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b613ff53388614e5f565b60055461401190620100009004600160a060020a031684614e79565b61401a82614e6d565b60005b60095481101561418a5760006009828154811061403657fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061406b8583614d05565b9050806140b0576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8989858181106140bc57fe5b90506020020135811015614108576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206003015461412e9082614dee565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157a08339815191529281900390910190a361417f833383614e83565b50505060010161401d565b50506005805461ff0019169055505050505050565b600881565b600281565b600181565b6000806141bb878661515a565b905060006141d1670de0b6b3a764000085614dee565b90506141dd8582614d05565b905060006141ef8a6126308c85615082565b905060006141fd8285615296565b90506000614213670de0b6b3a764000083614dee565b905061421f8a82614d05565b9c9b505050505050505050505050565b600a670de0b6b3a76400006113a8565b671bc16d674ec7ffff81565b600554606090610100900460ff161561429c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60085460ff166142e4576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600980548060200260200160405190810160405280929190818152602001828054801561107b57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161431c575050505050905090565b600081565b600554606090610100900460ff16156142e4576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60095490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561444e576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146144af576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a602052604090205460ff1661450d576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615614556576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a60205260408120600301549061457d8282614d05565b600b54600160a060020a0385166000908152600a60205260409020600201549192506145a891614dee565b600b55600160a060020a0383166000908152600a60205260409020600101546009805460001981019190829081106145dc57fe5b60009182526020909120015460098054600160a060020a03909216918490811061460257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a0316021790555081600a60006009858154811061464257fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060010155600980548061467557fe5b600082815260208082206000199084018101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556040805160808101825283815280830184815281830185815260608301868152600160a060020a038c168752600a909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561470e8533611bdd8787614dee565b600554611c03908690620100009004600160a060020a031685614e83565b600554600090610100900460ff161561477d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b5060075490565b336000908152600160209081526040808320600160a060020a03861684529091528120546147b29083615082565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191936000805160206157c0833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600654600160a060020a031633146148e1576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff1615614952576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f49535f424f554e440000000000000000000000000000000000000000604482015290519081900360640190fd5b60085460ff161561499b576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b6009546008116149f5576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b604080516080810182526001808252600980546020808501918252600085870181815260608701828152600160a060020a038c16808452600a9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19169091179055614aaf8383836117c9565b505050565b6002670de0b6b3a76400006113a8565b600554600090610100900460ff1615614b15576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614b73576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a6020526040902060020154600b54614b9d90829061515a565b9392505050565b600554600090610100900460ff1615614bf5576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614c53576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206003015490565b600080614c7f858861515a565b90506000614c8d8786614dee565b90506000614c9b888361515a565b90506000614ca98285615296565b9050614cbd81670de0b6b3a7640000614dee565b9050614cd1670de0b6b3a764000087614dee565b9450614ce6614ce08c83614d05565b8661515a565b9b9a5050505050505050505050565b60065460a060020a900460ff1690565b6000828202831580614d1f575082848281614d1c57fe5b04145b614d73576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6706f05b59d3b20000810181811015614dd6576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6000670de0b6b3a7640000825b049695505050505050565b6000806000614dfd85856153b9565b915091508015614e57576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b614e6982826153de565b5050565b614e76816153e9565b50565b614e6982826154b3565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015614eef57600080fd5b505af1158015614f03573d6000803e3d6000fd5b505050506040513d6020811015614f1957600080fd5b5051905080614f72576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f45524332305f46414c53450000000000000000000000000000000000604482015290519081900360640190fd5b50505050565b600160a060020a038316600090815260208190526040902054811115614fe8576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526020819052604090205461500b9082614dee565b600160a060020a03808516600090815260208190526040808220939093559084168152205461503a9082615082565b600160a060020a0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061576083398151915292918290030190a3505050565b600082820183811015614b9d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015614eef57600080fd5b614e76816154be565b6000816151b1576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4449565f5a45524f0000000000000000000000000000000000000000604482015290519081900360640190fd5b670de0b6b3a764000083028315806151d95750670de0b6b3a76400008482816151d657fe5b04145b61522d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6002830481018181101561528b576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6000848281614de357fe5b600060018310156152f1576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42504f575f424153455f544f4f5f4c4f570000000000000000000000604482015290519081900360640190fd5b671bc16d674ec7ffff831115615351576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f42504f575f424153455f544f4f5f4849474800000000000000000000604482015290519081900360640190fd5b600061535c83615521565b9050600061536a8483614dee565b905060006153808661537b8561553c565b61554a565b9050816153915792506110d4915050565b60006153a287846305f5e1006155a1565b90506153ae8282614d05565b979650505050505050565b6000808284106153cf57505080820360006153d7565b505081810360015b9250929050565b614e69823083614f78565b30600090815260208190526040902054811115615450576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b3060009081526020819052604090205461546a9082614dee565b306000908152602081905260409020556002546154879082614dee565b60025560408051828152905160009130916000805160206157608339815191529181900360200190a350565b614e69308383614f78565b306000908152602081905260409020546154d89082615082565b306000908152602081905260409020556002546154f59082615082565b60025560408051828152905130916000916000805160206157608339815191529181900360200190a350565b6000670de0b6b3a76400006155358361553c565b0292915050565b670de0b6b3a7640000900490565b6000806002830661556357670de0b6b3a7640000615565565b835b90506002830492505b8215614b9d5761557e8485614d05565b93506002830615615596576155938185614d05565b90505b60028304925061556e565b60008281806155b887670de0b6b3a76400006153b9565b9092509050670de0b6b3a764000080600060015b888410615670576000670de0b6b3a7640000820290506000806156008a6155fb85670de0b6b3a7640000614dee565b6153b9565b91509150615612876137e9848c614d05565b965061561e878461515a565b96508661562d57505050615670565b8715615637579315935b8015615641579315935b8415615658576156518688614dee565b9550615665565b6156628688615082565b95505b5050506001016155cc565b5090999850505050505050505056fe4552525f4e4f545f46494e414c495a45440000000000000000000000000000004552525f5245454e5452590000000000000000000000000000000000000000004552525f4c494d49545f494e00000000000000000000000000000000000000004552525f4d41585f4f55545f524154494f00000000000000000000000000000063982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a4552525f4e4f545f434f4e54524f4c4c455200000000000000000000000000004552525f4d41585f494e5f524154494f00000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552525f4e4f545f424f554e4400000000000000000000000000000000000000e74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9254552525f49535f46494e414c495a4544000000000000000000000000000000004552525f4c494d49545f4f5554000000000000000000000000000000000000004552525f4d4154485f415050524f580000000000000000000000000000000000a265627a7a72315820f3cd1bf05ff9d2e4dbad16fd31665ab67326ac6112987074d3c59993d329a0d764736f6c634300050c0032a265627a7a7231582036f8df06b4677a8ebf021335be56a5563b1e9426377a750e3047bd1e636872e264736f6c634300050c0032", + "sourceMap": "782:1302:2:-;;;1458:57;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1489:6:2;:19;;-1:-1:-1;;;;;;1489:19:2;1498:10;1489:19;;;782:1302;;;;;;", + "deployedSourceMap": "782:1302:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;782:1302:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1807:275;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1807:275:2;-1:-1:-1;;;;;1807:275:2;;:::i;:::-;;1521:102;;;:::i;:::-;;;;-1:-1:-1;;;;;1521:102:2;;;;;;;;;;;;;;795:117:0;;;:::i;:::-;;;;;;;;;;;;;;;;1047:104:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1047:104:2;-1:-1:-1;;;;;1047:104:2;;:::i;:::-;;;;;;;;;;;;;;;;;;1629:172;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1629:172:2;-1:-1:-1;;;;;1629:172:2;;:::i;1157:266::-;;;:::i;1807:275::-;1890:6;;-1:-1:-1;;;;;1890:6:2;1876:10;:20;1868:46;;;;;-1:-1:-1;;;;;1868:46:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1941:37;;;;;;1972:4;1941:37;;;;;;1924:14;;-1:-1:-1;;;;;1941:22:2;;;;;:37;;;;;;;;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;1941:37:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1941:37:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1941:37:2;2014:6;;2000:32;;;;;;-1:-1:-1;;;;;2014:6:2;;;2000:32;;;;;;;;;;;;1941:37;;-1:-1:-1;1988:9:2;;2000:13;;;;;;:32;;;;;1941:37;;2000:32;;;;;;;;1988:9;2000:13;:32;;;5:2:-1;;;;30:1;27;20:12;5:2;2000:32:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2000:32:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2000:32:2;;-1:-1:-1;2000:32:2;2042:33;;;;;-1:-1:-1;;;;;2042:33:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1807:275;;;:::o;1521:102::-;1610:6;;-1:-1:-1;;;;;1610:6:2;1521:102;:::o;795:117:0:-;884:17;795:117;:::o;1047:104:2:-;-1:-1:-1;;;;;1133:11:2;1106:4;1133:11;;;;;;;;;;;;;;1047:104::o;1629:172::-;1711:6;;-1:-1:-1;;;;;1711:6:2;1697:10;:20;1689:46;;;;;-1:-1:-1;;;;;1689:46:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1750:24;;-1:-1:-1;;;;;1750:24:2;;;1760:10;;1750:24;;;;;1784:6;:10;;-1:-1:-1;;1784:10:2;-1:-1:-1;;;;;1784:10:2;;;;;;;;;;1629:172::o;1157:266::-;1211:5;1232:11;1246;;;;;:::i;:::-;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;;;;1267:24:2;;:8;:24;;;;;;;;;;;:31;;-1:-1:-1;;1267:31:2;1294:4;1267:31;;;1313:40;1232:25;;-1:-1:-1;1267:24:2;;1326:10;;1313:40;;;1363:31;;;;;;1383:10;1363:31;;;;;;-1:-1:-1;;;;;1363:19:2;;;;;:31;;;;;-1:-1:-1;;1363:31:2;;;;;;;-1:-1:-1;1363:19:2;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;1363:31:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1411:5:2;;-1:-1:-1;;;;1157:266:2;:::o;782:1302::-;;;;;;;;:::o", + "source": "// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is disstributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity 0.5.12;\n\n// Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)`\n\nimport \"./BPool.sol\";\n\ncontract BFactory is BBronze {\n event LOG_NEW_POOL(\n address indexed caller,\n address indexed pool\n );\n\n event LOG_BLABS(\n address indexed caller,\n address indexed blabs\n );\n\n mapping(address=>bool) private _isBPool;\n\n function isBPool(address b)\n external view returns (bool)\n {\n return _isBPool[b];\n }\n\n function newBPool()\n external\n returns (BPool)\n {\n BPool bpool = new BPool();\n _isBPool[address(bpool)] = true;\n emit LOG_NEW_POOL(msg.sender, address(bpool));\n bpool.setController(msg.sender);\n return bpool;\n }\n\n address private _blabs;\n\n constructor() public {\n _blabs = msg.sender;\n }\n\n function getBLabs()\n external view\n returns (address)\n {\n return _blabs;\n }\n\n function setBLabs(address b)\n external\n {\n require(msg.sender == _blabs, \"ERR_NOT_BLABS\");\n emit LOG_BLABS(msg.sender, b);\n _blabs = b;\n }\n\n function collect(BPool pool)\n external \n {\n require(msg.sender == _blabs, \"ERR_NOT_BLABS\");\n uint collected = IERC20(pool).balanceOf(address(this));\n bool xfer = pool.transfer(_blabs, collected);\n require(xfer, \"ERR_ERC20_FAILED\");\n }\n}\n", + "sourcePath": "/ocean/non-ocean/balancer-core/contracts/BFactory.sol", + "ast": { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BFactory.sol", + "exportedSymbols": { + "BFactory": [ + 260 + ] + }, + "id": 261, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 110, + "literals": [ + "solidity", + "0.5", + ".12" + ], + "nodeType": "PragmaDirective", + "src": "644:23:2" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BPool.sol", + "file": "./BPool.sol", + "id": 111, + "nodeType": "ImportDirective", + "scope": 261, + "sourceUnit": 3474, + "src": "759:21:2", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 112, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 20, + "src": "803:7:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$20", + "typeString": "contract BBronze" + } + }, + "id": 113, + "nodeType": "InheritanceSpecifier", + "src": "803:7:2" + } + ], + "contractDependencies": [ + 7, + 20, + 3473 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 260, + "linearizedBaseContracts": [ + 260, + 20, + 7 + ], + "name": "BFactory", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 119, + "name": "LOG_NEW_POOL", + "nodeType": "EventDefinition", + "parameters": { + "id": 118, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 115, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "845:22:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "845:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": true, + "name": "pool", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "877:20:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "877:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "835:68:2" + }, + "src": "817:87:2" + }, + { + "anonymous": false, + "documentation": null, + "id": 125, + "name": "LOG_BLABS", + "nodeType": "EventDefinition", + "parameters": { + "id": 124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 121, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "935:22:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 120, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "935:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 123, + "indexed": true, + "name": "blabs", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "967:21:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 122, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "967:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "925:69:2" + }, + "src": "910:85:2" + }, + { + "constant": false, + "id": 129, + "name": "_isBPool", + "nodeType": "VariableDeclaration", + "scope": 260, + "src": "1001:39:2", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 128, + "keyType": { + "id": 126, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1009:7:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1001:22:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "valueType": { + "id": 127, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1018:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 140, + "nodeType": "Block", + "src": "1116:35:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 136, + "name": "_isBPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 129, + "src": "1133:8:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 138, + "indexExpression": { + "argumentTypes": null, + "id": 137, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 131, + "src": "1142:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1133:11:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 135, + "id": 139, + "nodeType": "Return", + "src": "1126:18:2" + } + ] + }, + "documentation": null, + "id": 141, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 131, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "1064:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 130, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1064:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1063:11:2" + }, + "returnParameters": { + "id": 135, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 134, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "1106:4:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 133, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1106:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1105:6:2" + }, + "scope": 260, + "src": "1047:104:2", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 177, + "nodeType": "Block", + "src": "1222:201:2", + "statements": [ + { + "assignments": [ + 147 + ], + "declarations": [ + { + "constant": false, + "id": 147, + "name": "bpool", + "nodeType": "VariableDeclaration", + "scope": 177, + "src": "1232:11:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 146, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1232:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 151, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1246:9:2", + "typeDescriptions": { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_BPool_$3473_$", + "typeString": "function () returns (contract BPool)" + }, + "typeName": { + "contractScope": null, + "id": 148, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1250:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + }, + "id": 150, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1246:11:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1232:25:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 152, + "name": "_isBPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 129, + "src": "1267:8:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 156, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 154, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1284:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1276:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1276:14:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1267:24:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1294:4:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1267:31:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 159, + "nodeType": "ExpressionStatement", + "src": "1267:31:2" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 161, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1326:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1326:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 164, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1346:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1338:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1338:14:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 160, + "name": "LOG_NEW_POOL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 119, + "src": "1313:12:2", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1313:40:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 167, + "nodeType": "EmitStatement", + "src": "1308:45:2" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 171, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1383:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1383:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 168, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1363:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "setController", + "nodeType": "MemberAccess", + "referencedDeclaration": 1682, + "src": "1363:19:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", + "typeString": "function (address) external" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1363:31:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 174, + "nodeType": "ExpressionStatement", + "src": "1363:31:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 175, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1411:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "functionReturnParameters": 145, + "id": 176, + "nodeType": "Return", + "src": "1404:12:2" + } + ] + }, + "documentation": null, + "id": 178, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "newBPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 142, + "nodeType": "ParameterList", + "parameters": [], + "src": "1174:2:2" + }, + "returnParameters": { + "id": 145, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 144, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 178, + "src": "1211:5:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 143, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1211:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1210:7:2" + }, + "scope": 260, + "src": "1157:266:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "constant": false, + "id": 180, + "name": "_blabs", + "nodeType": "VariableDeclaration", + "scope": 260, + "src": "1429:22:2", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 179, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1429:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 188, + "nodeType": "Block", + "src": "1479:36:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 183, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1489:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 184, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1498:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1498:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1489:19:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "1489:19:2" + } + ] + }, + "documentation": null, + "id": 189, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 181, + "nodeType": "ParameterList", + "parameters": [], + "src": "1469:2:2" + }, + "returnParameters": { + "id": 182, + "nodeType": "ParameterList", + "parameters": [], + "src": "1479:0:2" + }, + "scope": 260, + "src": "1458:57:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 196, + "nodeType": "Block", + "src": "1593:30:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 194, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1610:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 193, + "id": 195, + "nodeType": "Return", + "src": "1603:13:2" + } + ] + }, + "documentation": null, + "id": 197, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getBLabs", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 190, + "nodeType": "ParameterList", + "parameters": [], + "src": "1538:2:2" + }, + "returnParameters": { + "id": 193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 192, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 197, + "src": "1580:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 191, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1580:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1579:9:2" + }, + "scope": 260, + "src": "1521:102:2", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 220, + "nodeType": "Block", + "src": "1679:122:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1697:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1697:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 205, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1711:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1697:20:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424c414253", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1719:15:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + }, + "value": "ERR_NOT_BLABS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + } + ], + "id": 202, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1689:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1689:46:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1689:46:2" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 211, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1760:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1760:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 213, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 199, + "src": "1772:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 210, + "name": "LOG_BLABS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "1750:9:2", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1750:24:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 215, + "nodeType": "EmitStatement", + "src": "1745:29:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 216, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1784:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 217, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 199, + "src": "1793:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1784:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 219, + "nodeType": "ExpressionStatement", + "src": "1784:10:2" + } + ] + }, + "documentation": null, + "id": 221, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setBLabs", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 200, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 199, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 221, + "src": "1647:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 198, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1647:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1646:11:2" + }, + "returnParameters": { + "id": 201, + "nodeType": "ParameterList", + "parameters": [], + "src": "1679:0:2" + }, + "scope": 260, + "src": "1629:172:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 258, + "nodeType": "Block", + "src": "1858:224:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1876:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1876:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 229, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1890:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1876:20:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424c414253", + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1898:15:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + }, + "value": "ERR_NOT_BLABS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + } + ], + "id": 226, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1868:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1868:46:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 233, + "nodeType": "ExpressionStatement", + "src": "1868:46:2" + }, + { + "assignments": [ + 235 + ], + "declarations": [ + { + "constant": false, + "id": 235, + "name": "collected", + "nodeType": "VariableDeclaration", + "scope": 258, + "src": "1924:14:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 234, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1924:4:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 244, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 241, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5282, + "src": "1972:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BFactory_$260", + "typeString": "contract BFactory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BFactory_$260", + "typeString": "contract BFactory" + } + ], + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1964:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1964:13:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 237, + "name": "pool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "1948:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 236, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "1941:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1941:12:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3504, + "src": "1941:22:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1941:37:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1924:54:2" + }, + { + "assignments": [ + 246 + ], + "declarations": [ + { + "constant": false, + "id": 246, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 258, + "src": "1988:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 245, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1988:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 252, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 249, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "2014:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 250, + "name": "collected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "2022:9:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 247, + "name": "pool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "2000:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 3961, + "src": "2000:13:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 251, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2000:32:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1988:44:2" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 254, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 246, + "src": "2050:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f4641494c4544", + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2056:18:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e057873e5425869a9e6345fe2f36a14a5f4218d0a2f5463c21b9f13bfe9b5a8", + "typeString": "literal_string \"ERR_ERC20_FAILED\"" + }, + "value": "ERR_ERC20_FAILED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e057873e5425869a9e6345fe2f36a14a5f4218d0a2f5463c21b9f13bfe9b5a8", + "typeString": "literal_string \"ERR_ERC20_FAILED\"" + } + ], + "id": 253, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "2042:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2042:33:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 257, + "nodeType": "ExpressionStatement", + "src": "2042:33:2" + } + ] + }, + "documentation": null, + "id": 259, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "collect", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 223, + "name": "pool", + "nodeType": "VariableDeclaration", + "scope": 259, + "src": "1824:10:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 222, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1824:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1823:12:2" + }, + "returnParameters": { + "id": 225, + "nodeType": "ParameterList", + "parameters": [], + "src": "1858:0:2" + }, + "scope": 260, + "src": "1807:275:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 261, + "src": "782:1302:2" + } + ], + "src": "644:1441:2" + }, + "legacyAST": { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BFactory.sol", + "exportedSymbols": { + "BFactory": [ + 260 + ] + }, + "id": 261, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 110, + "literals": [ + "solidity", + "0.5", + ".12" + ], + "nodeType": "PragmaDirective", + "src": "644:23:2" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BPool.sol", + "file": "./BPool.sol", + "id": 111, + "nodeType": "ImportDirective", + "scope": 261, + "sourceUnit": 3474, + "src": "759:21:2", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 112, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 20, + "src": "803:7:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$20", + "typeString": "contract BBronze" + } + }, + "id": 113, + "nodeType": "InheritanceSpecifier", + "src": "803:7:2" + } + ], + "contractDependencies": [ + 7, + 20, + 3473 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 260, + "linearizedBaseContracts": [ + 260, + 20, + 7 + ], + "name": "BFactory", + "nodeType": "ContractDefinition", + "nodes": [ + { + "anonymous": false, + "documentation": null, + "id": 119, + "name": "LOG_NEW_POOL", + "nodeType": "EventDefinition", + "parameters": { + "id": 118, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 115, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "845:22:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 114, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "845:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 117, + "indexed": true, + "name": "pool", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "877:20:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 116, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "877:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "835:68:2" + }, + "src": "817:87:2" + }, + { + "anonymous": false, + "documentation": null, + "id": 125, + "name": "LOG_BLABS", + "nodeType": "EventDefinition", + "parameters": { + "id": 124, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 121, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "935:22:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 120, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "935:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 123, + "indexed": true, + "name": "blabs", + "nodeType": "VariableDeclaration", + "scope": 125, + "src": "967:21:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 122, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "967:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "925:69:2" + }, + "src": "910:85:2" + }, + { + "constant": false, + "id": 129, + "name": "_isBPool", + "nodeType": "VariableDeclaration", + "scope": 260, + "src": "1001:39:2", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 128, + "keyType": { + "id": 126, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1009:7:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "1001:22:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "valueType": { + "id": 127, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1018:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 140, + "nodeType": "Block", + "src": "1116:35:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 136, + "name": "_isBPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 129, + "src": "1133:8:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 138, + "indexExpression": { + "argumentTypes": null, + "id": 137, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 131, + "src": "1142:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1133:11:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 135, + "id": 139, + "nodeType": "Return", + "src": "1126:18:2" + } + ] + }, + "documentation": null, + "id": 141, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 132, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 131, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "1064:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 130, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1064:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1063:11:2" + }, + "returnParameters": { + "id": 135, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 134, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 141, + "src": "1106:4:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 133, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1106:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1105:6:2" + }, + "scope": 260, + "src": "1047:104:2", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 177, + "nodeType": "Block", + "src": "1222:201:2", + "statements": [ + { + "assignments": [ + 147 + ], + "declarations": [ + { + "constant": false, + "id": 147, + "name": "bpool", + "nodeType": "VariableDeclaration", + "scope": 177, + "src": "1232:11:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 146, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1232:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 151, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1246:9:2", + "typeDescriptions": { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_BPool_$3473_$", + "typeString": "function () returns (contract BPool)" + }, + "typeName": { + "contractScope": null, + "id": 148, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1250:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + }, + "id": 150, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1246:11:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1232:25:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 152, + "name": "_isBPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 129, + "src": "1267:8:2", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 156, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 154, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1284:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1276:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1276:14:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1267:24:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 157, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1294:4:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1267:31:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 159, + "nodeType": "ExpressionStatement", + "src": "1267:31:2" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 161, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1326:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1326:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 164, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1346:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1338:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1338:14:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 160, + "name": "LOG_NEW_POOL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 119, + "src": "1313:12:2", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 166, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1313:40:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 167, + "nodeType": "EmitStatement", + "src": "1308:45:2" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 171, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1383:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1383:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "id": 168, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1363:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "setController", + "nodeType": "MemberAccess", + "referencedDeclaration": 1682, + "src": "1363:19:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", + "typeString": "function (address) external" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1363:31:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 174, + "nodeType": "ExpressionStatement", + "src": "1363:31:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 175, + "name": "bpool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 147, + "src": "1411:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "functionReturnParameters": 145, + "id": 176, + "nodeType": "Return", + "src": "1404:12:2" + } + ] + }, + "documentation": null, + "id": 178, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "newBPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 142, + "nodeType": "ParameterList", + "parameters": [], + "src": "1174:2:2" + }, + "returnParameters": { + "id": 145, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 144, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 178, + "src": "1211:5:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 143, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1211:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1210:7:2" + }, + "scope": 260, + "src": "1157:266:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "constant": false, + "id": 180, + "name": "_blabs", + "nodeType": "VariableDeclaration", + "scope": 260, + "src": "1429:22:2", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 179, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1429:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 188, + "nodeType": "Block", + "src": "1479:36:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 183, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1489:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 184, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1498:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1498:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "1489:19:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "1489:19:2" + } + ] + }, + "documentation": null, + "id": 189, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 181, + "nodeType": "ParameterList", + "parameters": [], + "src": "1469:2:2" + }, + "returnParameters": { + "id": 182, + "nodeType": "ParameterList", + "parameters": [], + "src": "1479:0:2" + }, + "scope": 260, + "src": "1458:57:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 196, + "nodeType": "Block", + "src": "1593:30:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 194, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1610:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 193, + "id": 195, + "nodeType": "Return", + "src": "1603:13:2" + } + ] + }, + "documentation": null, + "id": 197, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getBLabs", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 190, + "nodeType": "ParameterList", + "parameters": [], + "src": "1538:2:2" + }, + "returnParameters": { + "id": 193, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 192, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 197, + "src": "1580:7:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 191, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1580:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1579:9:2" + }, + "scope": 260, + "src": "1521:102:2", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 220, + "nodeType": "Block", + "src": "1679:122:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 206, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 203, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1697:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 204, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1697:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 205, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1711:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1697:20:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424c414253", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1719:15:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + }, + "value": "ERR_NOT_BLABS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + } + ], + "id": 202, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1689:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1689:46:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1689:46:2" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 211, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1760:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1760:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 213, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 199, + "src": "1772:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 210, + "name": "LOG_BLABS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "1750:9:2", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1750:24:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 215, + "nodeType": "EmitStatement", + "src": "1745:29:2" + }, + { + "expression": { + "argumentTypes": null, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 216, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1784:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 217, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 199, + "src": "1793:1:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1784:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 219, + "nodeType": "ExpressionStatement", + "src": "1784:10:2" + } + ] + }, + "documentation": null, + "id": 221, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setBLabs", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 200, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 199, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 221, + "src": "1647:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 198, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1647:7:2", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1646:11:2" + }, + "returnParameters": { + "id": 201, + "nodeType": "ParameterList", + "parameters": [], + "src": "1679:0:2" + }, + "scope": 260, + "src": "1629:172:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 258, + "nodeType": "Block", + "src": "1858:224:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1876:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1876:10:2", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 229, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "1890:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1876:20:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424c414253", + "id": 231, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1898:15:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + }, + "value": "ERR_NOT_BLABS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_11166b4d2c4afd95cfe504c2b26aa462eae0dde4c2ed80df98d12f943b14e4b9", + "typeString": "literal_string \"ERR_NOT_BLABS\"" + } + ], + "id": 226, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1868:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1868:46:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 233, + "nodeType": "ExpressionStatement", + "src": "1868:46:2" + }, + { + "assignments": [ + 235 + ], + "declarations": [ + { + "constant": false, + "id": 235, + "name": "collected", + "nodeType": "VariableDeclaration", + "scope": 258, + "src": "1924:14:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 234, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1924:4:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 244, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 241, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5282, + "src": "1972:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BFactory_$260", + "typeString": "contract BFactory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BFactory_$260", + "typeString": "contract BFactory" + } + ], + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1964:7:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1964:13:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 237, + "name": "pool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "1948:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 236, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "1941:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1941:12:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 239, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3504, + "src": "1941:22:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1941:37:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1924:54:2" + }, + { + "assignments": [ + 246 + ], + "declarations": [ + { + "constant": false, + "id": 246, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 258, + "src": "1988:9:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 245, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1988:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 252, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 249, + "name": "_blabs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 180, + "src": "2014:6:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 250, + "name": "collected", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "2022:9:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 247, + "name": "pool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "2000:4:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 3961, + "src": "2000:13:2", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 251, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2000:32:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1988:44:2" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 254, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 246, + "src": "2050:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f4641494c4544", + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2056:18:2", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e057873e5425869a9e6345fe2f36a14a5f4218d0a2f5463c21b9f13bfe9b5a8", + "typeString": "literal_string \"ERR_ERC20_FAILED\"" + }, + "value": "ERR_ERC20_FAILED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e057873e5425869a9e6345fe2f36a14a5f4218d0a2f5463c21b9f13bfe9b5a8", + "typeString": "literal_string \"ERR_ERC20_FAILED\"" + } + ], + "id": 253, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "2042:7:2", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2042:33:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 257, + "nodeType": "ExpressionStatement", + "src": "2042:33:2" + } + ] + }, + "documentation": null, + "id": 259, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "collect", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 224, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 223, + "name": "pool", + "nodeType": "VariableDeclaration", + "scope": 259, + "src": "1824:10:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + }, + "typeName": { + "contractScope": null, + "id": 222, + "name": "BPool", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 3473, + "src": "1824:5:2", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1823:12:2" + }, + "returnParameters": { + "id": 225, + "nodeType": "ParameterList", + "parameters": [], + "src": "1858:0:2" + }, + "scope": 260, + "src": "1807:275:2", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + } + ], + "scope": 261, + "src": "782:1302:2" + } + ], + "src": "644:1441:2" + }, + "compiler": { + "name": "solc", + "version": "0.5.12+commit.7709ece9.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.0.16", + "updatedAt": "2020-06-15T08:14:20.612Z", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} \ No newline at end of file diff --git a/src/balancer/artifacts/BPool.json b/src/balancer/artifacts/BPool.json new file mode 100644 index 00000000..da12e652 --- /dev/null +++ b/src/balancer/artifacts/BPool.json @@ -0,0 +1,61759 @@ +{ + "contractName": "BPool", + "abi": [ + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "internalType": "bytes4", + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "LOG_CALL", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "name": "LOG_EXIT", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "name": "LOG_JOIN", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "name": "LOG_SWAP", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "BONE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "BPOW_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "EXIT_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "INIT_POOL_SUPPLY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BOUND_TOKENS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_BPOW_BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_IN_RATIO", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_OUT_RATIO", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_TOTAL_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BALANCE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BOUND_TOKENS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_BPOW_BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "whom", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcInGivenOut", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcOutGivenIn", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcPoolInGivenSingleOut", + "outputs": [ + { + "internalType": "uint256", + "name": "poolAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcPoolOutGivenSingleIn", + "outputs": [ + { + "internalType": "uint256", + "name": "poolAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSingleInGivenPoolOut", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalWeight", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSingleOutGivenPoolIn", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "tokenBalanceIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenBalanceOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenWeightOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "calcSpotPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getColor", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isPublicSwap", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isFinalized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "t", + "type": "address" + } + ], + "name": "isBound", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNumTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCurrentTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFinalTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getDenormalizedWeight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalDenormalizedWeight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getNormalizedWeight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getSwapFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getController", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "swapFee", + "type": "uint256" + } + ], + "name": "setSwapFee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "setController", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bool", + "name": "public_", + "type": "bool" + } + ], + "name": "setPublicSwap", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "finalize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "denorm", + "type": "uint256" + } + ], + "name": "bind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "denorm", + "type": "uint256" + } + ], + "name": "rebind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "unbind", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "gulp", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + } + ], + "name": "getSpotPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + } + ], + "name": "getSpotPriceSansFee", + "outputs": [ + { + "internalType": "uint256", + "name": "spotPrice", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "poolAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "maxAmountsIn", + "type": "uint256[]" + } + ], + "name": "joinPool", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "poolAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "minAmountsOut", + "type": "uint256[]" + } + ], + "name": "exitPool", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "swapExactAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceAfter", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "swapExactAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spotPriceAfter", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPoolAmountOut", + "type": "uint256" + } + ], + "name": "joinswapExternAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "poolAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + } + ], + "name": "joinswapPoolAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + } + ], + "name": "exitswapPoolAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPoolAmountIn", + "type": "uint256" + } + ], + "name": "exitswapExternAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "poolAmountIn", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.5.12+commit.7709ece9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":true,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sig\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"LOG_CALL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"name\":\"LOG_EXIT\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"name\":\"LOG_JOIN\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"name\":\"LOG_SWAP\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"BONE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BPOW_PRECISION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"EXIT_FEE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INIT_POOL_SUPPLY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BOUND_TOKENS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BPOW_BASE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_FEE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_IN_RATIO\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_OUT_RATIO\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOTAL_WEIGHT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_WEIGHT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BALANCE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BOUND_TOKENS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BPOW_BASE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_FEE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_WEIGHT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"whom\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denorm\",\"type\":\"uint256\"}],\"name\":\"bind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcInGivenOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcOutGivenIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcPoolInGivenSingleOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcPoolOutGivenSingleIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSingleInGivenPoolOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalWeight\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSingleOutGivenPoolIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalanceIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenBalanceOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenWeightOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"calcSpotPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"minAmountsOut\",\"type\":\"uint256[]\"}],\"name\":\"exitPool\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPoolAmountIn\",\"type\":\"uint256\"}],\"name\":\"exitswapExternAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountOut\",\"type\":\"uint256\"}],\"name\":\"exitswapPoolAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getColor\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getController\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getDenormalizedWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getFinalTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getNormalizedWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"getSpotPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"}],\"name\":\"getSpotPriceSansFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"spotPrice\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSwapFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTotalDenormalizedWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"gulp\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"t\",\"type\":\"address\"}],\"name\":\"isBound\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isPublicSwap\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"maxAmountsIn\",\"type\":\"uint256[]\"}],\"name\":\"joinPool\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minPoolAmountOut\",\"type\":\"uint256\"}],\"name\":\"joinswapExternAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"poolAmountOut\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxAmountIn\",\"type\":\"uint256\"}],\"name\":\"joinswapPoolAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denorm\",\"type\":\"uint256\"}],\"name\":\"rebind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bool\",\"name\":\"public_\",\"type\":\"bool\"}],\"name\":\"setPublicSwap\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"swapFee\",\"type\":\"uint256\"}],\"name\":\"setSwapFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPrice\",\"type\":\"uint256\"}],\"name\":\"swapExactAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"spotPriceAfter\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenOut\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPrice\",\"type\":\"uint256\"}],\"name\":\"swapExactAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"spotPriceAfter\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"unbind\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{\"calcInGivenOut(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcInGivenOut // // aI = tokenAmountIn // // bO = tokenBalanceOut / / bO \\\\ (wO / wI) \\\\ // // bI = tokenBalanceIn bI * | | ------------ | ^ - 1 | // // aO = tokenAmountOut aI = \\\\ \\\\ ( bO - aO ) / / // // wI = tokenWeightIn -------------------------------------------- // // wO = tokenWeightOut ( 1 - sF ) // // sF = swapFee //*********************************************************************************************\"},\"calcOutGivenIn(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcOutGivenIn // // aO = tokenAmountOut // // bO = tokenBalanceOut // // bI = tokenBalanceIn / / bI \\\\ (wI / wO) \\\\ // // aI = tokenAmountIn aO = bO * | 1 - | -------------------------- | ^ | // // wI = tokenWeightIn \\\\ \\\\ ( bI + ( aI * ( 1 - sF )) / / // // wO = tokenWeightOut // // sF = swapFee //*********************************************************************************************\"},\"calcPoolInGivenSingleOut(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcPoolInGivenSingleOut // // pAi = poolAmountIn // / tAo \\\\\\\\ / wO \\\\ \\\\ // // bO = tokenBalanceOut // | bO - -------------------------- |\\\\ | ---- | \\\\ // // tAo = tokenAmountOut pS - || \\\\ 1 - ((1 - (tO / tW)) * sF)/ | ^ \\\\ tW / * pS | // // ps = poolSupply \\\\\\\\ -----------------------------------/ / // // wO = tokenWeightOut pAi = \\\\\\\\ bO / / // // tW = totalWeight ------------------------------------------------------------- // // sF = swapFee ( 1 - eF ) // // eF = exitFee //*********************************************************************************************\"},\"calcPoolOutGivenSingleIn(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcPoolOutGivenSingleIn // // pAo = poolAmountOut / \\\\ // // tAi = tokenAmountIn /// / // wI \\\\ \\\\\\\\ \\\\ wI \\\\ // // wI = tokenWeightIn //| tAi *| 1 - || 1 - -- | * sF || + tBi \\\\ -- \\\\ // // tW = totalWeight pAo=|| \\\\ \\\\ \\\\\\\\ tW / // | ^ tW | * pS - pS // // tBi = tokenBalanceIn \\\\\\\\ ------------------------------------- / / // // pS = poolSupply \\\\\\\\ tBi / / // // sF = swapFee \\\\ / //*********************************************************************************************\"},\"calcSingleInGivenPoolOut(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcSingleInGivenPoolOut // // tAi = tokenAmountIn //(pS + pAo)\\\\ / 1 \\\\\\\\ // // pS = poolSupply || --------- | ^ | --------- || * bI - bI // // pAo = poolAmountOut \\\\\\\\ pS / \\\\(wI / tW)// // // bI = balanceIn tAi = -------------------------------------------- // // wI = weightIn / wI \\\\ // // tW = totalWeight | 1 - ---- | * sF // // sF = swapFee \\\\ tW / //*********************************************************************************************\"},\"calcSingleOutGivenPoolIn(uint256,uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcSingleOutGivenPoolIn // // tAo = tokenAmountOut / / \\\\\\\\ // // bO = tokenBalanceOut / // pS - (pAi * (1 - eF)) \\\\ / 1 \\\\ \\\\\\\\ // // pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || // // ps = poolSupply \\\\ \\\\\\\\ pS / \\\\(wO / tW)/ // // // wI = tokenWeightIn tAo = \\\\ \\\\ // // // tW = totalWeight / / wO \\\\ \\\\ // // sF = swapFee * | 1 - | 1 - ---- | * sF | // // eF = exitFee \\\\ \\\\ tW / / //*********************************************************************************************\"},\"calcSpotPrice(uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"******************************************************************************************** // calcSpotPrice // // sP = spotPrice // // bI = tokenBalanceIn ( bI / wI ) 1 // // bO = tokenBalanceOut sP = ----------- * ---------- // // wI = tokenWeightIn ( bO / wO ) ( 1 - sF ) // // wO = tokenWeightOut // // sF = swapFee //*********************************************************************************************\"}}}},\"settings\":{\"compilationTarget\":{\"/ocean/non-ocean/balancer-core/contracts/BPool.sol\":\"BPool\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"/ocean/non-ocean/balancer-core/contracts/BColor.sol\":{\"keccak256\":\"0xcf1ed6a3a6fae7926257262ea583e26b725a94902d0ca3b018e32cce3426404e\",\"urls\":[\"bzz-raw://c410c554680e9a4056cbb935b9f56c1e2a729ef401f8e827e99627867af655df\",\"dweb:/ipfs/QmQrdGdsT7katEUiH2jeM13qB7y27YosM75uDHhVAnm3sR\"]},\"/ocean/non-ocean/balancer-core/contracts/BConst.sol\":{\"keccak256\":\"0x841f1505feab665c28396a5e596e7ef538087847234f1b93e656a33b3eb283eb\",\"urls\":[\"bzz-raw://b24431b6242c142cb500503043b8876405a3d5e07cca4678bfa592cd76d33061\",\"dweb:/ipfs/QmNvyFrhATrRwQKWbSH3Unh8uHonEwdtYwnddtgKheUj3C\"]},\"/ocean/non-ocean/balancer-core/contracts/BMath.sol\":{\"keccak256\":\"0x33b23f581e9ca463b4989ebf1edc353d5490215d43921149a9090f7c007d9b93\",\"urls\":[\"bzz-raw://0ab26658da6983cd325bfc04364e02b3fa71552a7c01348294b0515d626dd55d\",\"dweb:/ipfs/QmXFpjj6Q1BoXYv8kz6vRkj2tyGGyGwW48haHKCw1oz8i4\"]},\"/ocean/non-ocean/balancer-core/contracts/BNum.sol\":{\"keccak256\":\"0x35ee281928601b5cc0b64fe87cd992f11c3ec53b59d046e2e344f6c343cd1c88\",\"urls\":[\"bzz-raw://a10e27baeb6a82e23829746854f43e1ea7733631d0426d084e0e114f4b873454\",\"dweb:/ipfs/QmdpjsU8rkemMGc3FRfYEvVwkj5LF641KVUGCnLNvkjJBn\"]},\"/ocean/non-ocean/balancer-core/contracts/BPool.sol\":{\"keccak256\":\"0xaf889738e49ce11952add4e5da8cfa0055a2f2cc4c082200fc4305648fa3307b\",\"urls\":[\"bzz-raw://3e7bdaed776af5209691d114a6455bd8fc0c85a9bc51bd8c45a0eee226623945\",\"dweb:/ipfs/QmUekZRLSj8PMHCg2nbhZNnUy4TEHLqwfDncjbYhQ75WrK\"]},\"/ocean/non-ocean/balancer-core/contracts/BToken.sol\":{\"keccak256\":\"0x8168aa8ac2bda34f49c3b045e9daafca461dcd1484f394608efd17a6cc830f6b\",\"urls\":[\"bzz-raw://2138263f13e99de7749446b23af6d8410a133508fa3a006eb603b91ed688aaef\",\"dweb:/ipfs/QmX45CPbyaCBMMFB18s6oBmywwYrdz5D14AKVR6KWrvLs2\"]}},\"version\":1}", + "bytecode": "0x60c0604052601360808190527f42616c616e63657220506f6f6c20546f6b656e0000000000000000000000000060a0908152620000409160039190620000f7565b506040805180820190915260038082527f425054000000000000000000000000000000000000000000000000000000000060209092019182526200008791600491620000f7565b506005805460ff19166012179055348015620000a257600080fd5b5060068054600580546201000060b060020a031916336201000081029190911790915564e8d4a51000600755600160a060020a03199091161760a060020a60ff02191690556008805460ff191690556200019c565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200013a57805160ff19168380011785556200016a565b828001600101855582156200016a579182015b828111156200016a5782518255916020019190600101906200014d565b50620001789291506200017c565b5090565b6200019991905b8082111562000178576000815560010162000183565b90565b61587480620001ac6000396000f3fe608060405234801561001057600080fd5b5060043610610378576000357c0100000000000000000000000000000000000000000000000000000000900480638d4e4083116101e7578063bc694ea211610122578063d73dd623116100c5578063d73dd62314610b7f578063dd62ed3e14610bab578063e4a28a521461047e578063e4e1e53814610bd9578063ec09302114610c0b578063f1b8a9b714610c13578063f8b2cb4f14610c39578063f8d6aed414610c5f578063fde924f714610c9a57610378565b8063bc694ea214610ad9578063be3bbd2e14610ae1578063c36596a6146104f2578063c6580d1214610b39578063cc77828d14610b41578063cd2ed8fb14610b49578063cf5e7bd314610b51578063d4cadf6814610b7757610378565b8063a221ee491161018a578063a221ee49146109a6578063a9059cbb146109db578063b02f0b7314610a07578063b0e0d13614610a7e578063b7b800a414610a86578063ba019dab14610a8e578063ba9530a614610a96578063bc063e1a14610ad157610378565b80638d4e40831461092a57806392eefe9b14610932578063936c3477146109585780639381cd2b14610960578063948d8ce61461096857806395d89b411461098e578063992e2a92146109965780639a86139b1461099e57610378565b806349b59552116102b757806376c7a3c71161025a57806376c7a3c7146107aa5780637c5e9ea4146107b25780638201aa3f1461080b57806382f652ad1461084b5780638656b65314610886578063867378c5146108c157806389298012146108c95780638c28cbe81461090457610378565b806349b595521461061b5780634bb278f31461063a5780634f69c0d4146106425780635c1bbaf7146106b95780635db34277146106f457806366188463146107265780636d06dfa01461075257806370a082311461078457610378565b8063218b53821161031f578063218b5382146104f257806323b872dd146104fa5780632f37b624146105305780633018205f14610556578063313ce5671461057a57806334e19907146105985780633fdddaa2146105b757806346ab38f1146105e957610378565b806302c967481461037d57806306fdde03146103c1578063095ea7b31461043e57806309a3bbe41461047e5780631446a7ff1461048657806315e84af9146104b457806318160ddd146104e2578063189d00ca146104ea575b600080fd5b6103af6004803603606081101561039357600080fd5b50600160a060020a038135169060208101359060400135610ca2565b60408051918252519081900360200190f35b6103c9610fef565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104035781810151838201526020016103eb565b50505050905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61046a6004803603604081101561045457600080fd5b50600160a060020a038135169060200135611085565b604080519115158252519081900360200190f35b6103af6110da565b6103af6004803603604081101561049c57600080fd5b50600160a060020a03813581169160200135166110e7565b6103af600480360360408110156104ca57600080fd5b50600160a060020a0381358116916020013516611241565b6103af611392565b6103af611398565b6103af6113ac565b61046a6004803603606081101561051057600080fd5b50600160a060020a038135811691602081013590911690604001356113b8565b61046a6004803603602081101561054657600080fd5b5035600160a060020a031661151d565b61055e61153b565b60408051600160a060020a039092168252519081900360200190f35b61058261159c565b6040805160ff9092168252519081900360200190f35b6105b5600480360360208110156105ae57600080fd5b50356115a5565b005b6105b5600480360360608110156105cd57600080fd5b50600160a060020a0381351690602081013590604001356117c9565b6103af600480360360608110156105ff57600080fd5b50600160a060020a038135169060208101359060400135611c15565b6105b56004803603602081101561063157600080fd5b50351515611f01565b6105b5612092565b6105b56004803603604081101561065857600080fd5b8135919081019060408101602082013564010000000081111561067a57600080fd5b82018360208201111561068c57600080fd5b803590602001918460208302840111640100000000831117156106ae57600080fd5b5090925090506122a9565b6103af600480360360c08110156106cf57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612590565b6103af6004803603606081101561070a57600080fd5b50600160a060020a038135169060208101359060400135612648565b61046a6004803603604081101561073c57600080fd5b50600160a060020a038135169060200135612919565b6103af6004803603606081101561076857600080fd5b50600160a060020a0381351690602081013590604001356129f1565b6103af6004803603602081101561079a57600080fd5b5035600160a060020a0316612cf0565b6103af612d0b565b6107f2600480360360a08110156107c857600080fd5b50600160a060020a0381358116916020810135916040820135169060608101359060800135612d1d565b6040805192835260208301919091528051918290030190f35b6107f2600480360360a081101561082157600080fd5b50600160a060020a038135811691602081013591604082013516906060810135906080013561320d565b6103af600480360360c081101561086157600080fd5b5080359060208101359060408101359060608101359060808101359060a001356136e4565b6103af600480360360c081101561089c57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356137a3565b6103af613844565b6103af600480360360c08110156108df57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613858565b6105b56004803603602081101561091a57600080fd5b5035600160a060020a0316613908565b61046a613ad9565b6105b56004803603602081101561094857600080fd5b5035600160a060020a0316613ae2565b6103af613c2c565b6103af613c84565b6103af6004803603602081101561097e57600080fd5b5035600160a060020a0316613c91565b6103c9613d5f565b6103af613dc0565b6103af613dcc565b6103af600480360360a08110156109bc57600080fd5b5080359060208101359060408101359060608101359060800135613df0565b61046a600480360360408110156109f157600080fd5b50600160a060020a038135169060200135613e55565b6105b560048036036040811015610a1d57600080fd5b81359190810190604081016020820135640100000000811115610a3f57600080fd5b820183602082011115610a5157600080fd5b80359060200191846020830284011164010000000083111715610a7357600080fd5b509092509050613e6b565b6103af61419f565b6103af6141a4565b6103af6141a9565b6103af600480360360c0811015610aac57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356141ae565b6103af61422f565b6103af61423f565b610ae961424b565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b25578181015183820152602001610b0d565b505050509050019250505060405180910390f35b6103af614343565b610ae9614348565b6103af614399565b6105b560048036036020811015610b6757600080fd5b5035600160a060020a031661439f565b6103af61472c565b61046a60048036036040811015610b9557600080fd5b50600160a060020a038135169060200135614784565b6103af60048036036040811015610bc157600080fd5b50600160a060020a0381358116916020013516614805565b6105b560048036036060811015610bef57600080fd5b50600160a060020a038135169060208101359060400135614830565b6103af614ab4565b6103af60048036036020811015610c2957600080fd5b5035600160a060020a0316614ac4565b6103af60048036036020811015610c4f57600080fd5b5035600160a060020a0316614ba4565b6103af600480360360c0811015610c7557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135614c72565b61046a614cf5565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610d53576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16610daa576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16610e08576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600390810154610e3d91670de0b6b3a76400005b04600101614d05565b831115610e82576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754610ebc949392919089906136e4565b915081610f01576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115610f47576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b610f55816003015485614dee565b60038201556000610f668382614d05565b604080518781529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3610fa23384614e5f565b610fb4610faf8483614dee565b614e6d565b600554610fd090620100009004600160a060020a031682614e79565b610fdb863387614e83565b50506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390926000805160206157c0833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff1615611138576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611196576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff166111f4576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682528120600380840154600280860154928401549084015493946112389492939290613df0565b95945050505050565b600554600090610100900460ff1615611292576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff166112f0576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff1661134e576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682529020600380830154600280850154928401549084015460075461123894929190613df0565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a03851614806113f45750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b611448576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b611453848484614f78565b33600160a060020a038516148015906114915750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b1561151357600160a060020a03841660009081526001602090815260408083203384529091529020546114c49083614dee565b600160a060020a03858116600090815260016020908152604080832033808552908352928190208590558051948552519287169391926000805160206157c08339815191529281900390910190a35b5060019392505050565b600160a060020a03166000908152600a602052604090205460ff1690565b600554600090610100900460ff161561158c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600654600160a060020a031690565b60055460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611654576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156116ac576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a031633146116fc576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b64e8d4a51000811015611759576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d494e5f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b67016345785d8a00008111156117b9576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d41585f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b6007556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611878576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146118d9576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611937576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615611980576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b670de0b6b3a76400008110156119e0576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b6802b5e3af16b1880000811115611a41576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b620f4240821015611a9c576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4d494e5f42414c414e43450000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206002015480821115611b3f57611ad5600b54611ad08484614dee565b615082565b600b8190556802b5e3af16b18800001015611b3a576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f4d41585f544f54414c5f574549474854000000000000000000000000604482015290519081900360640190fd5b611b60565b80821015611b6057611b5c600b54611b578385614dee565b614dee565b600b555b600160a060020a0384166000908152600a602052604090206002810183905560030180549084905580841115611ba957611ba48533611b9f8785614dee565b6150df565b611c03565b80841015611c03576000611bbd8286614dee565b90506000611bcc826000614d05565b9050611be28733611bdd8585614dee565b614e83565b600554611c00908890620100009004600160a060020a031683614e83565b50505b50506005805461ff0019169055505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611cc6576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16611d1d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16611d7b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754611db594939291908990613858565b915082821015611dfd576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a60205260409020600390810154611e2d91670de0b6b3a7640000610e34565b821115611e72576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b611e80816003015483614dee565b60038201556000611e918582614d05565b604080518581529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3611ecd3386614e5f565b611eda610faf8683614dee565b600554611ef690620100009004600160a060020a031682614e79565b610fdb863385614e83565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611fb0576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff1615612008576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a03163314612058576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805491151560a060020a0274ff0000000000000000000000000000000000000000199092169190911790556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612141576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146121a2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b60085460ff16156121eb576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b60095460021115612246576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191660011790556006805474ff0000000000000000000000000000000000000000191660a060020a17905561228968056bc75e2d63100000615151565b61229c3368056bc75e2d63100000614e79565b6005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612358576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff166123af576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b60006123b9611392565b905060006123c7858361515a565b90508061240c576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b60005b60095481101561257c5760006009828154811061242857fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061245d8583614d05565b9050806124a2576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8787858181106124ae57fe5b905060200201358111156124fa576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a60205260409020600301546125209082615082565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157008339815191529281900390910190a36125718333836150df565b50505060010161240f565b5061258685615151565b611c033386614e79565b60008061259d878661515a565b905060006125ab8786615082565b905060006125b9828961515a565b905060006125cf670de0b6b3a76400008561515a565b905060006125dd8383615296565b905060006125eb828e614d05565b905060006125f9828f614dee565b90506000612618612612670de0b6b3a76400008a614dee565b8b614d05565b905061263582612630670de0b6b3a764000084614dee565b61515a565b9f9e505050505050505050505050505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156126f9576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612750576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff166127ae576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600301546127e0906002670de0b6b3a76400005b04614d05565b831115612825576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b5460075461285f949392919089906137a3565b9150828210156128a7576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b6128b5816003015485615082565b6003820155604080518581529051600160a060020a0387169133916000805160206157008339815191529181900360200190a36128f182615151565b6128fb3383614e79565b6129068533866150df565b506005805461ff00191690559392505050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561296e57336000908152600160209081526040808320600160a060020a038816845290915281205561299d565b6129788184614dee565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293926000805160206157c0833981519152929181900390910190a35060019392505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612aa2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612af9576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16612b57576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754612b9194939291908990612590565b915081612bd6576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115612c1c576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a6020526040902060030154612c4c906002670de0b6b3a76400006127da565b821115612c91576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b612c9f816003015483615082565b6003820155604080518381529051600160a060020a0387169133916000805160206157008339815191529181900360200190a3612cdb84615151565b612ce53385614e79565b6129068533846150df565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a76400006113a8565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612dbd576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff16612e2a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16612e88576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff16612ee9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a602052604080822092881682529020600380820154612f2291670de0b6b3a7640000610e34565b861115612f67576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b6000612f888360030154846002015484600301548560020154600754613df0565b905085811115612fe2576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b61300283600301548460020154846003015485600201548b600754614c72565b94508885111561304a576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b613058836003015486615082565b836003018190555061306e826003015488614dee565b600380840182905584015460028086015490850154600754613091949190613df0565b9350808410156130d9576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613131576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61313b858861515a565b811115613180576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a46131e88a33876150df565b6131f3883389614e83565b5050506005805461ff001916905590969095509350505050565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156132ad576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff1661331a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16613378576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff166133d9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a6020526040808220928816825290206003820154613413906002670de0b6b3a76400006127da565b881115613458576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b60006134798360030154846002015484600301548560020154600754613df0565b9050858111156134d3576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b6134f383600301548460020154846003015485600201548d6007546141ae565b94508685101561353b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b61354983600301548a615082565b836003018190555061355f826003015486614dee565b600380840182905584015460028086015490850154600754613582949190613df0565b9350808410156135ca576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613622576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61362c898661515a565b811115613671576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46136d98a338b6150df565b6131f3883387614e83565b6000806136f1878661515a565b90506000613707670de0b6b3a764000083614dee565b905060006137158286614d05565b9050600061372f87612630670de0b6b3a764000085614dee565b9050600061373d8c83614dee565b9050600061374b828e61515a565b905060006137598288615296565b90506000613767828e614d05565b905060006137758e83614dee565b905061378e81612630670de0b6b3a76400006000614dee565b99505050505050505050509695505050505050565b6000806137b0878661515a565b905060006137cf6137c9670de0b6b3a764000084614dee565b85614d05565b905060006137ee866137e9670de0b6b3a764000085614dee565b614d05565b905060006137fc8b83615082565b9050600061380a828d61515a565b905060006138188287615296565b90506000613826828d614d05565b9050613832818d614dee565b9e9d5050505050505050505050505050565b64e8d4a51000670de0b6b3a76400006113a8565b600080613865878661515a565b90506000613880856137e9670de0b6b3a76400006000614dee565b9050600061388e8883614dee565b9050600061389c828a61515a565b905060006138bb826138b6670de0b6b3a76400008861515a565b615296565b905060006138c9828e614d05565b905060006138d78e83614dee565b905060006138f0612612670de0b6b3a76400008a614dee565b9050612635826137e9670de0b6b3a764000084614dee565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156139b7576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0381166000908152600a602052604090205460ff16613a24576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038316916370a08231916024808301926020929190829003018186803b158015613a8357600080fd5b505afa158015613a97573d6000803e3d6000fd5b505050506040513d6020811015613aad57600080fd5b5051600160a060020a039091166000908152600a60205260409020600301556005805461ff0019169055565b60085460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613b91576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a0390911614613bf2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615613c7d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600b5490565b68056bc75e2d6310000081565b600554600090610100900460ff1615613ce2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16613d40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b6704a03ce68d21555681565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600080613dfd878761515a565b90506000613e0b868661515a565b90506000613e19838361515a565b90506000613e3b670de0b6b3a7640000612630670de0b6b3a764000089614dee565b9050613e478282614d05565b9a9950505050505050505050565b6000613e62338484614f78565b50600192915050565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613f1a576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16613f71576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b6000613f7b611392565b90506000613f8a856000614d05565b90506000613f988683614dee565b90506000613fa6828561515a565b905080613feb576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b613ff53388614e5f565b60055461401190620100009004600160a060020a031684614e79565b61401a82614e6d565b60005b60095481101561418a5760006009828154811061403657fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061406b8583614d05565b9050806140b0576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8989858181106140bc57fe5b90506020020135811015614108576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206003015461412e9082614dee565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157a08339815191529281900390910190a361417f833383614e83565b50505060010161401d565b50506005805461ff0019169055505050505050565b600881565b600281565b600181565b6000806141bb878661515a565b905060006141d1670de0b6b3a764000085614dee565b90506141dd8582614d05565b905060006141ef8a6126308c85615082565b905060006141fd8285615296565b90506000614213670de0b6b3a764000083614dee565b905061421f8a82614d05565b9c9b505050505050505050505050565b600a670de0b6b3a76400006113a8565b671bc16d674ec7ffff81565b600554606090610100900460ff161561429c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60085460ff166142e4576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600980548060200260200160405190810160405280929190818152602001828054801561107b57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161431c575050505050905090565b600081565b600554606090610100900460ff16156142e4576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60095490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561444e576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146144af576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a602052604090205460ff1661450d576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615614556576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a60205260408120600301549061457d8282614d05565b600b54600160a060020a0385166000908152600a60205260409020600201549192506145a891614dee565b600b55600160a060020a0383166000908152600a60205260409020600101546009805460001981019190829081106145dc57fe5b60009182526020909120015460098054600160a060020a03909216918490811061460257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a0316021790555081600a60006009858154811061464257fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060010155600980548061467557fe5b600082815260208082206000199084018101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556040805160808101825283815280830184815281830185815260608301868152600160a060020a038c168752600a909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561470e8533611bdd8787614dee565b600554611c03908690620100009004600160a060020a031685614e83565b600554600090610100900460ff161561477d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b5060075490565b336000908152600160209081526040808320600160a060020a03861684529091528120546147b29083615082565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191936000805160206157c0833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600654600160a060020a031633146148e1576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff1615614952576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f49535f424f554e440000000000000000000000000000000000000000604482015290519081900360640190fd5b60085460ff161561499b576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b6009546008116149f5576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b604080516080810182526001808252600980546020808501918252600085870181815260608701828152600160a060020a038c16808452600a9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19169091179055614aaf8383836117c9565b505050565b6002670de0b6b3a76400006113a8565b600554600090610100900460ff1615614b15576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614b73576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a6020526040902060020154600b54614b9d90829061515a565b9392505050565b600554600090610100900460ff1615614bf5576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614c53576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206003015490565b600080614c7f858861515a565b90506000614c8d8786614dee565b90506000614c9b888361515a565b90506000614ca98285615296565b9050614cbd81670de0b6b3a7640000614dee565b9050614cd1670de0b6b3a764000087614dee565b9450614ce6614ce08c83614d05565b8661515a565b9b9a5050505050505050505050565b60065460a060020a900460ff1690565b6000828202831580614d1f575082848281614d1c57fe5b04145b614d73576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6706f05b59d3b20000810181811015614dd6576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6000670de0b6b3a7640000825b049695505050505050565b6000806000614dfd85856153b9565b915091508015614e57576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b614e6982826153de565b5050565b614e76816153e9565b50565b614e6982826154b3565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015614eef57600080fd5b505af1158015614f03573d6000803e3d6000fd5b505050506040513d6020811015614f1957600080fd5b5051905080614f72576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f45524332305f46414c53450000000000000000000000000000000000604482015290519081900360640190fd5b50505050565b600160a060020a038316600090815260208190526040902054811115614fe8576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526020819052604090205461500b9082614dee565b600160a060020a03808516600090815260208190526040808220939093559084168152205461503a9082615082565b600160a060020a0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061576083398151915292918290030190a3505050565b600082820183811015614b9d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015614eef57600080fd5b614e76816154be565b6000816151b1576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4449565f5a45524f0000000000000000000000000000000000000000604482015290519081900360640190fd5b670de0b6b3a764000083028315806151d95750670de0b6b3a76400008482816151d657fe5b04145b61522d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6002830481018181101561528b576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6000848281614de357fe5b600060018310156152f1576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42504f575f424153455f544f4f5f4c4f570000000000000000000000604482015290519081900360640190fd5b671bc16d674ec7ffff831115615351576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f42504f575f424153455f544f4f5f4849474800000000000000000000604482015290519081900360640190fd5b600061535c83615521565b9050600061536a8483614dee565b905060006153808661537b8561553c565b61554a565b9050816153915792506110d4915050565b60006153a287846305f5e1006155a1565b90506153ae8282614d05565b979650505050505050565b6000808284106153cf57505080820360006153d7565b505081810360015b9250929050565b614e69823083614f78565b30600090815260208190526040902054811115615450576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b3060009081526020819052604090205461546a9082614dee565b306000908152602081905260409020556002546154879082614dee565b60025560408051828152905160009130916000805160206157608339815191529181900360200190a350565b614e69308383614f78565b306000908152602081905260409020546154d89082615082565b306000908152602081905260409020556002546154f59082615082565b60025560408051828152905130916000916000805160206157608339815191529181900360200190a350565b6000670de0b6b3a76400006155358361553c565b0292915050565b670de0b6b3a7640000900490565b6000806002830661556357670de0b6b3a7640000615565565b835b90506002830492505b8215614b9d5761557e8485614d05565b93506002830615615596576155938185614d05565b90505b60028304925061556e565b60008281806155b887670de0b6b3a76400006153b9565b9092509050670de0b6b3a764000080600060015b888410615670576000670de0b6b3a7640000820290506000806156008a6155fb85670de0b6b3a7640000614dee565b6153b9565b91509150615612876137e9848c614d05565b965061561e878461515a565b96508661562d57505050615670565b8715615637579315935b8015615641579315935b8415615658576156518688614dee565b9550615665565b6156628688615082565b95505b5050506001016155cc565b5090999850505050505050505056fe4552525f4e4f545f46494e414c495a45440000000000000000000000000000004552525f5245454e5452590000000000000000000000000000000000000000004552525f4c494d49545f494e00000000000000000000000000000000000000004552525f4d41585f4f55545f524154494f00000000000000000000000000000063982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a4552525f4e4f545f434f4e54524f4c4c455200000000000000000000000000004552525f4d41585f494e5f524154494f00000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552525f4e4f545f424f554e4400000000000000000000000000000000000000e74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9254552525f49535f46494e414c495a4544000000000000000000000000000000004552525f4c494d49545f4f5554000000000000000000000000000000000000004552525f4d4154485f415050524f580000000000000000000000000000000000a265627a7a72315820f3cd1bf05ff9d2e4dbad16fd31665ab67326ac6112987074d3c59993d329a0d764736f6c634300050c0032", + "deployedBytecode": "0x608060405234801561001057600080fd5b5060043610610378576000357c0100000000000000000000000000000000000000000000000000000000900480638d4e4083116101e7578063bc694ea211610122578063d73dd623116100c5578063d73dd62314610b7f578063dd62ed3e14610bab578063e4a28a521461047e578063e4e1e53814610bd9578063ec09302114610c0b578063f1b8a9b714610c13578063f8b2cb4f14610c39578063f8d6aed414610c5f578063fde924f714610c9a57610378565b8063bc694ea214610ad9578063be3bbd2e14610ae1578063c36596a6146104f2578063c6580d1214610b39578063cc77828d14610b41578063cd2ed8fb14610b49578063cf5e7bd314610b51578063d4cadf6814610b7757610378565b8063a221ee491161018a578063a221ee49146109a6578063a9059cbb146109db578063b02f0b7314610a07578063b0e0d13614610a7e578063b7b800a414610a86578063ba019dab14610a8e578063ba9530a614610a96578063bc063e1a14610ad157610378565b80638d4e40831461092a57806392eefe9b14610932578063936c3477146109585780639381cd2b14610960578063948d8ce61461096857806395d89b411461098e578063992e2a92146109965780639a86139b1461099e57610378565b806349b59552116102b757806376c7a3c71161025a57806376c7a3c7146107aa5780637c5e9ea4146107b25780638201aa3f1461080b57806382f652ad1461084b5780638656b65314610886578063867378c5146108c157806389298012146108c95780638c28cbe81461090457610378565b806349b595521461061b5780634bb278f31461063a5780634f69c0d4146106425780635c1bbaf7146106b95780635db34277146106f457806366188463146107265780636d06dfa01461075257806370a082311461078457610378565b8063218b53821161031f578063218b5382146104f257806323b872dd146104fa5780632f37b624146105305780633018205f14610556578063313ce5671461057a57806334e19907146105985780633fdddaa2146105b757806346ab38f1146105e957610378565b806302c967481461037d57806306fdde03146103c1578063095ea7b31461043e57806309a3bbe41461047e5780631446a7ff1461048657806315e84af9146104b457806318160ddd146104e2578063189d00ca146104ea575b600080fd5b6103af6004803603606081101561039357600080fd5b50600160a060020a038135169060208101359060400135610ca2565b60408051918252519081900360200190f35b6103c9610fef565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104035781810151838201526020016103eb565b50505050905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61046a6004803603604081101561045457600080fd5b50600160a060020a038135169060200135611085565b604080519115158252519081900360200190f35b6103af6110da565b6103af6004803603604081101561049c57600080fd5b50600160a060020a03813581169160200135166110e7565b6103af600480360360408110156104ca57600080fd5b50600160a060020a0381358116916020013516611241565b6103af611392565b6103af611398565b6103af6113ac565b61046a6004803603606081101561051057600080fd5b50600160a060020a038135811691602081013590911690604001356113b8565b61046a6004803603602081101561054657600080fd5b5035600160a060020a031661151d565b61055e61153b565b60408051600160a060020a039092168252519081900360200190f35b61058261159c565b6040805160ff9092168252519081900360200190f35b6105b5600480360360208110156105ae57600080fd5b50356115a5565b005b6105b5600480360360608110156105cd57600080fd5b50600160a060020a0381351690602081013590604001356117c9565b6103af600480360360608110156105ff57600080fd5b50600160a060020a038135169060208101359060400135611c15565b6105b56004803603602081101561063157600080fd5b50351515611f01565b6105b5612092565b6105b56004803603604081101561065857600080fd5b8135919081019060408101602082013564010000000081111561067a57600080fd5b82018360208201111561068c57600080fd5b803590602001918460208302840111640100000000831117156106ae57600080fd5b5090925090506122a9565b6103af600480360360c08110156106cf57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612590565b6103af6004803603606081101561070a57600080fd5b50600160a060020a038135169060208101359060400135612648565b61046a6004803603604081101561073c57600080fd5b50600160a060020a038135169060200135612919565b6103af6004803603606081101561076857600080fd5b50600160a060020a0381351690602081013590604001356129f1565b6103af6004803603602081101561079a57600080fd5b5035600160a060020a0316612cf0565b6103af612d0b565b6107f2600480360360a08110156107c857600080fd5b50600160a060020a0381358116916020810135916040820135169060608101359060800135612d1d565b6040805192835260208301919091528051918290030190f35b6107f2600480360360a081101561082157600080fd5b50600160a060020a038135811691602081013591604082013516906060810135906080013561320d565b6103af600480360360c081101561086157600080fd5b5080359060208101359060408101359060608101359060808101359060a001356136e4565b6103af600480360360c081101561089c57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356137a3565b6103af613844565b6103af600480360360c08110156108df57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613858565b6105b56004803603602081101561091a57600080fd5b5035600160a060020a0316613908565b61046a613ad9565b6105b56004803603602081101561094857600080fd5b5035600160a060020a0316613ae2565b6103af613c2c565b6103af613c84565b6103af6004803603602081101561097e57600080fd5b5035600160a060020a0316613c91565b6103c9613d5f565b6103af613dc0565b6103af613dcc565b6103af600480360360a08110156109bc57600080fd5b5080359060208101359060408101359060608101359060800135613df0565b61046a600480360360408110156109f157600080fd5b50600160a060020a038135169060200135613e55565b6105b560048036036040811015610a1d57600080fd5b81359190810190604081016020820135640100000000811115610a3f57600080fd5b820183602082011115610a5157600080fd5b80359060200191846020830284011164010000000083111715610a7357600080fd5b509092509050613e6b565b6103af61419f565b6103af6141a4565b6103af6141a9565b6103af600480360360c0811015610aac57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356141ae565b6103af61422f565b6103af61423f565b610ae961424b565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b25578181015183820152602001610b0d565b505050509050019250505060405180910390f35b6103af614343565b610ae9614348565b6103af614399565b6105b560048036036020811015610b6757600080fd5b5035600160a060020a031661439f565b6103af61472c565b61046a60048036036040811015610b9557600080fd5b50600160a060020a038135169060200135614784565b6103af60048036036040811015610bc157600080fd5b50600160a060020a0381358116916020013516614805565b6105b560048036036060811015610bef57600080fd5b50600160a060020a038135169060208101359060400135614830565b6103af614ab4565b6103af60048036036020811015610c2957600080fd5b5035600160a060020a0316614ac4565b6103af60048036036020811015610c4f57600080fd5b5035600160a060020a0316614ba4565b6103af600480360360c0811015610c7557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135614c72565b61046a614cf5565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610d53576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16610daa576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16610e08576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600390810154610e3d91670de0b6b3a76400005b04600101614d05565b831115610e82576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754610ebc949392919089906136e4565b915081610f01576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115610f47576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b610f55816003015485614dee565b60038201556000610f668382614d05565b604080518781529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3610fa23384614e5f565b610fb4610faf8483614dee565b614e6d565b600554610fd090620100009004600160a060020a031682614e79565b610fdb863387614e83565b50506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390926000805160206157c0833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff1615611138576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611196576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff166111f4576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682528120600380840154600280860154928401549084015493946112389492939290613df0565b95945050505050565b600554600090610100900460ff1615611292576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff166112f0576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff1661134e576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a038084166000908152600a602052604080822092851682529020600380830154600280850154928401549084015460075461123894929190613df0565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a03851614806113f45750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b611448576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b611453848484614f78565b33600160a060020a038516148015906114915750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b1561151357600160a060020a03841660009081526001602090815260408083203384529091529020546114c49083614dee565b600160a060020a03858116600090815260016020908152604080832033808552908352928190208590558051948552519287169391926000805160206157c08339815191529281900390910190a35b5060019392505050565b600160a060020a03166000908152600a602052604090205460ff1690565b600554600090610100900460ff161561158c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600654600160a060020a031690565b60055460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611654576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156116ac576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a031633146116fc576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b64e8d4a51000811015611759576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d494e5f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b67016345785d8a00008111156117b9576040805160e560020a62461bcd02815260206004820152600b60248201527f4552525f4d41585f464545000000000000000000000000000000000000000000604482015290519081900360640190fd5b6007556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611878576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146118d9576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff16611937576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615611980576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b670de0b6b3a76400008110156119e0576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b6802b5e3af16b1880000811115611a41576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f574549474854000000000000000000000000000000000000604482015290519081900360640190fd5b620f4240821015611a9c576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4d494e5f42414c414e43450000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206002015480821115611b3f57611ad5600b54611ad08484614dee565b615082565b600b8190556802b5e3af16b18800001015611b3a576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f4d41585f544f54414c5f574549474854000000000000000000000000604482015290519081900360640190fd5b611b60565b80821015611b6057611b5c600b54611b578385614dee565b614dee565b600b555b600160a060020a0384166000908152600a602052604090206002810183905560030180549084905580841115611ba957611ba48533611b9f8785614dee565b6150df565b611c03565b80841015611c03576000611bbd8286614dee565b90506000611bcc826000614d05565b9050611be28733611bdd8585614dee565b614e83565b600554611c00908890620100009004600160a060020a031683614e83565b50505b50506005805461ff0019169055505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611cc6576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16611d1d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16611d7b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754611db594939291908990613858565b915082821015611dfd576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a60205260409020600390810154611e2d91670de0b6b3a7640000610e34565b821115611e72576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b611e80816003015483614dee565b60038201556000611e918582614d05565b604080518581529051919250600160a060020a0388169133916000805160206157a0833981519152919081900360200190a3611ecd3386614e5f565b611eda610faf8683614dee565b600554611ef690620100009004600160a060020a031682614e79565b610fdb863385614e83565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611fb0576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff1615612008576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600654600160a060020a03163314612058576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805491151560a060020a0274ff0000000000000000000000000000000000000000199092169190911790556005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612141576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146121a2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b60085460ff16156121eb576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b60095460021115612246576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d494e5f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191660011790556006805474ff0000000000000000000000000000000000000000191660a060020a17905561228968056bc75e2d63100000615151565b61229c3368056bc75e2d63100000614e79565b6005805461ff0019169055565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612358576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff166123af576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b60006123b9611392565b905060006123c7858361515a565b90508061240c576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b60005b60095481101561257c5760006009828154811061242857fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061245d8583614d05565b9050806124a2576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8787858181106124ae57fe5b905060200201358111156124fa576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a60205260409020600301546125209082615082565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157008339815191529281900390910190a36125718333836150df565b50505060010161240f565b5061258685615151565b611c033386614e79565b60008061259d878661515a565b905060006125ab8786615082565b905060006125b9828961515a565b905060006125cf670de0b6b3a76400008561515a565b905060006125dd8383615296565b905060006125eb828e614d05565b905060006125f9828f614dee565b90506000612618612612670de0b6b3a76400008a614dee565b8b614d05565b905061263582612630670de0b6b3a764000084614dee565b61515a565b9f9e505050505050505050505050505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156126f9576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612750576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff166127ae576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a60205260409020600301546127e0906002670de0b6b3a76400005b04614d05565b831115612825576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b5460075461285f949392919089906137a3565b9150828210156128a7576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b6128b5816003015485615082565b6003820155604080518581529051600160a060020a0387169133916000805160206157008339815191529181900360200190a36128f182615151565b6128fb3383614e79565b6129068533866150df565b506005805461ff00191690559392505050565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561296e57336000908152600160209081526040808320600160a060020a038816845290915281205561299d565b6129788184614dee565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293926000805160206157c0833981519152929181900390910190a35060019392505050565b600033600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612aa2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612af9576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a602052604090205460ff16612b57576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0384166000908152600a6020526040902060038101546002808301549054600b54600754612b9194939291908990612590565b915081612bd6576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b82821115612c1c576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a6020526040902060030154612c4c906002670de0b6b3a76400006127da565b821115612c91576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b612c9f816003015483615082565b6003820155604080518381529051600160a060020a0387169133916000805160206157008339815191529181900360200190a3612cdb84615151565b612ce53385614e79565b6129068533846150df565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a76400006113a8565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612dbd576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff16612e2a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16612e88576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff16612ee9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a602052604080822092881682529020600380820154612f2291670de0b6b3a7640000610e34565b861115612f67576040805160e560020a62461bcd02815260206004820152601160248201526000805160206156e0833981519152604482015290519081900360640190fd5b6000612f888360030154846002015484600301548560020154600754613df0565b905085811115612fe2576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b61300283600301548460020154846003015485600201548b600754614c72565b94508885111561304a576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206156c0833981519152604482015290519081900360640190fd5b613058836003015486615082565b836003018190555061306e826003015488614dee565b600380840182905584015460028086015490850154600754613091949190613df0565b9350808410156130d9576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613131576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61313b858861515a565b811115613180576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d43378888b604051808381526020018281526020019250505060405180910390a46131e88a33876150df565b6131f3883389614e83565b5050506005805461ff001916905590969095509350505050565b6040805160208082523690820181905260009283923392600160e060020a03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156132ad576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0387166000908152600a602052604090205460ff1661331a576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0385166000908152600a602052604090205460ff16613378576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60065460a060020a900460ff166133d9576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f535741505f4e4f545f5055424c494300000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600a6020526040808220928816825290206003820154613413906002670de0b6b3a76400006127da565b881115613458576040805160e560020a62461bcd0281526020600482015260106024820152600080516020615740833981519152604482015290519081900360640190fd5b60006134798360030154846002015484600301548560020154600754613df0565b9050858111156134d3576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4241445f4c494d49545f505249434500000000000000000000000000604482015290519081900360640190fd5b6134f383600301548460020154846003015485600201548d6007546141ae565b94508685101561353b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b61354983600301548a615082565b836003018190555061355f826003015486614dee565b600380840182905584015460028086015490850154600754613582949190613df0565b9350808410156135ca576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b85841115613622576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f4c494d49545f50524943450000000000000000000000000000000000604482015290519081900360640190fd5b61362c898661515a565b811115613671576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b87600160a060020a03168a600160a060020a031633600160a060020a03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788c89604051808381526020018281526020019250505060405180910390a46136d98a338b6150df565b6131f3883387614e83565b6000806136f1878661515a565b90506000613707670de0b6b3a764000083614dee565b905060006137158286614d05565b9050600061372f87612630670de0b6b3a764000085614dee565b9050600061373d8c83614dee565b9050600061374b828e61515a565b905060006137598288615296565b90506000613767828e614d05565b905060006137758e83614dee565b905061378e81612630670de0b6b3a76400006000614dee565b99505050505050505050509695505050505050565b6000806137b0878661515a565b905060006137cf6137c9670de0b6b3a764000084614dee565b85614d05565b905060006137ee866137e9670de0b6b3a764000085614dee565b614d05565b905060006137fc8b83615082565b9050600061380a828d61515a565b905060006138188287615296565b90506000613826828d614d05565b9050613832818d614dee565b9e9d5050505050505050505050505050565b64e8d4a51000670de0b6b3a76400006113a8565b600080613865878661515a565b90506000613880856137e9670de0b6b3a76400006000614dee565b9050600061388e8883614dee565b9050600061389c828a61515a565b905060006138bb826138b6670de0b6b3a76400008861515a565b615296565b905060006138c9828e614d05565b905060006138d78e83614dee565b905060006138f0612612670de0b6b3a76400008a614dee565b9050612635826137e9670de0b6b3a764000084614dee565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156139b7576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff001916610100179055600160a060020a0381166000908152600a602052604090205460ff16613a24576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038316916370a08231916024808301926020929190829003018186803b158015613a8357600080fd5b505afa158015613a97573d6000803e3d6000fd5b505050506040513d6020811015613aad57600080fd5b5051600160a060020a039091166000908152600a60205260409020600301556005805461ff0019169055565b60085460ff1690565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613b91576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a0390911614613bf2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615613c7d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b50600b5490565b68056bc75e2d6310000081565b600554600090610100900460ff1615613ce2576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16613d40576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561107b5780601f106110505761010080835404028352916020019161107b565b6704a03ce68d21555681565b7f42524f4e5a45000000000000000000000000000000000000000000000000000090565b600080613dfd878761515a565b90506000613e0b868661515a565b90506000613e19838361515a565b90506000613e3b670de0b6b3a7640000612630670de0b6b3a764000089614dee565b9050613e478282614d05565b9a9950505050505050505050565b6000613e62338484614f78565b50600192915050565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613f1a576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16613f71576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b6000613f7b611392565b90506000613f8a856000614d05565b90506000613f988683614dee565b90506000613fa6828561515a565b905080613feb576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b613ff53388614e5f565b60055461401190620100009004600160a060020a031684614e79565b61401a82614e6d565b60005b60095481101561418a5760006009828154811061403657fe5b6000918252602080832090910154600160a060020a0316808352600a90915260408220600301549092509061406b8583614d05565b9050806140b0576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020615820833981519152604482015290519081900360640190fd5b8989858181106140bc57fe5b90506020020135811015614108576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615800833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090206003015461412e9082614dee565b600160a060020a0384166000818152600a60209081526040918290206003019390935580518481529051919233926000805160206157a08339815191529281900390910190a361417f833383614e83565b50505060010161401d565b50506005805461ff0019169055505050505050565b600881565b600281565b600181565b6000806141bb878661515a565b905060006141d1670de0b6b3a764000085614dee565b90506141dd8582614d05565b905060006141ef8a6126308c85615082565b905060006141fd8285615296565b90506000614213670de0b6b3a764000083614dee565b905061421f8a82614d05565b9c9b505050505050505050505050565b600a670de0b6b3a76400006113a8565b671bc16d674ec7ffff81565b600554606090610100900460ff161561429c576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60085460ff166142e4576040805160e560020a62461bcd0281526020600482015260116024820152600080516020615680833981519152604482015290519081900360640190fd5b600980548060200260200160405190810160405280929190818152602001828054801561107b57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161431c575050505050905090565b600081565b600554606090610100900460ff16156142e4576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b60095490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561444e576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b6005805461ff00191661010017905560065433600160a060020a03909116146144af576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a602052604090205460ff1661450d576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b60085460ff1615614556576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b600160a060020a0381166000908152600a60205260408120600301549061457d8282614d05565b600b54600160a060020a0385166000908152600a60205260409020600201549192506145a891614dee565b600b55600160a060020a0383166000908152600a60205260409020600101546009805460001981019190829081106145dc57fe5b60009182526020909120015460098054600160a060020a03909216918490811061460257fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a0316021790555081600a60006009858154811061464257fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060010155600980548061467557fe5b600082815260208082206000199084018101805473ffffffffffffffffffffffffffffffffffffffff191690559092019092556040805160808101825283815280830184815281830185815260608301868152600160a060020a038c168752600a909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561470e8533611bdd8787614dee565b600554611c03908690620100009004600160a060020a031685614e83565b600554600090610100900460ff161561477d576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b5060075490565b336000908152600160209081526040808320600160a060020a03861684529091528120546147b29083615082565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191936000805160206157c0833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b33600160a060020a0316600035600160e060020a031916600160e060020a03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600654600160a060020a031633146148e1576040805160e560020a62461bcd0281526020600482015260126024820152600080516020615720833981519152604482015290519081900360640190fd5b600160a060020a0383166000908152600a602052604090205460ff1615614952576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f49535f424f554e440000000000000000000000000000000000000000604482015290519081900360640190fd5b60085460ff161561499b576040805160e560020a62461bcd02815260206004820152601060248201526000805160206157e0833981519152604482015290519081900360640190fd5b6009546008116149f5576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f4d41585f544f4b454e53000000000000000000000000000000000000604482015290519081900360640190fd5b604080516080810182526001808252600980546020808501918252600085870181815260608701828152600160a060020a038c16808452600a9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19169091179055614aaf8383836117c9565b505050565b6002670de0b6b3a76400006113a8565b600554600090610100900460ff1615614b15576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614b73576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a6020526040902060020154600b54614b9d90829061515a565b9392505050565b600554600090610100900460ff1615614bf5576040805160e560020a62461bcd02815260206004820152600b60248201526000805160206156a0833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a602052604090205460ff16614c53576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020615780833981519152604482015290519081900360640190fd5b50600160a060020a03166000908152600a602052604090206003015490565b600080614c7f858861515a565b90506000614c8d8786614dee565b90506000614c9b888361515a565b90506000614ca98285615296565b9050614cbd81670de0b6b3a7640000614dee565b9050614cd1670de0b6b3a764000087614dee565b9450614ce6614ce08c83614d05565b8661515a565b9b9a5050505050505050505050565b60065460a060020a900460ff1690565b6000828202831580614d1f575082848281614d1c57fe5b04145b614d73576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6706f05b59d3b20000810181811015614dd6576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4d554c5f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b6000670de0b6b3a7640000825b049695505050505050565b6000806000614dfd85856153b9565b915091508015614e57576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b614e6982826153de565b5050565b614e76816153e9565b50565b614e6982826154b3565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015614eef57600080fd5b505af1158015614f03573d6000803e3d6000fd5b505050506040513d6020811015614f1957600080fd5b5051905080614f72576040805160e560020a62461bcd02815260206004820152600f60248201527f4552525f45524332305f46414c53450000000000000000000000000000000000604482015290519081900360640190fd5b50505050565b600160a060020a038316600090815260208190526040902054811115614fe8576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526020819052604090205461500b9082614dee565b600160a060020a03808516600090815260208190526040808220939093559084168152205461503a9082615082565b600160a060020a0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061576083398151915292918290030190a3505050565b600082820183811015614b9d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015614eef57600080fd5b614e76816154be565b6000816151b1576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4449565f5a45524f0000000000000000000000000000000000000000604482015290519081900360640190fd5b670de0b6b3a764000083028315806151d95750670de0b6b3a76400008482816151d657fe5b04145b61522d576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6002830481018181101561528b576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4449565f494e5445524e414c00000000000000000000000000000000604482015290519081900360640190fd5b6000848281614de357fe5b600060018310156152f1576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42504f575f424153455f544f4f5f4c4f570000000000000000000000604482015290519081900360640190fd5b671bc16d674ec7ffff831115615351576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f42504f575f424153455f544f4f5f4849474800000000000000000000604482015290519081900360640190fd5b600061535c83615521565b9050600061536a8483614dee565b905060006153808661537b8561553c565b61554a565b9050816153915792506110d4915050565b60006153a287846305f5e1006155a1565b90506153ae8282614d05565b979650505050505050565b6000808284106153cf57505080820360006153d7565b505081810360015b9250929050565b614e69823083614f78565b30600090815260208190526040902054811115615450576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b3060009081526020819052604090205461546a9082614dee565b306000908152602081905260409020556002546154879082614dee565b60025560408051828152905160009130916000805160206157608339815191529181900360200190a350565b614e69308383614f78565b306000908152602081905260409020546154d89082615082565b306000908152602081905260409020556002546154f59082615082565b60025560408051828152905130916000916000805160206157608339815191529181900360200190a350565b6000670de0b6b3a76400006155358361553c565b0292915050565b670de0b6b3a7640000900490565b6000806002830661556357670de0b6b3a7640000615565565b835b90506002830492505b8215614b9d5761557e8485614d05565b93506002830615615596576155938185614d05565b90505b60028304925061556e565b60008281806155b887670de0b6b3a76400006153b9565b9092509050670de0b6b3a764000080600060015b888410615670576000670de0b6b3a7640000820290506000806156008a6155fb85670de0b6b3a7640000614dee565b6153b9565b91509150615612876137e9848c614d05565b965061561e878461515a565b96508661562d57505050615670565b8715615637579315935b8015615641579315935b8415615658576156518688614dee565b9550615665565b6156628688615082565b95505b5050506001016155cc565b5090999850505050505050505056fe4552525f4e4f545f46494e414c495a45440000000000000000000000000000004552525f5245454e5452590000000000000000000000000000000000000000004552525f4c494d49545f494e00000000000000000000000000000000000000004552525f4d41585f4f55545f524154494f00000000000000000000000000000063982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a4552525f4e4f545f434f4e54524f4c4c455200000000000000000000000000004552525f4d41585f494e5f524154494f00000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552525f4e4f545f424f554e4400000000000000000000000000000000000000e74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9254552525f49535f46494e414c495a4544000000000000000000000000000000004552525f4c494d49545f4f5554000000000000000000000000000000000000004552525f4d4154485f415050524f580000000000000000000000000000000000a265627a7a72315820f3cd1bf05ff9d2e4dbad16fd31665ab67326ac6112987074d3c59993d329a0d764736f6c634300050c0032", + "sourceMap": "2722:49:6:-;714:22532:5;2722:49:6;;714:22532:5;2722:49:6;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2777:33:6;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2816:30:6;;;-1:-1:-1;;2816:30:6;2844:2;2816:30;;;2356:178:5;5:2:-1;;;;30:1;27;20:12;5:2;-1:-1;2387:11:5;:24;;2421:8;:21;;-1:-1:-1;;2421:21:5;-1:-1:-1;2401:10:5;2421:21;;;;;;;;;;917:12:1;2452:8:5;:18;-1:-1:-1;;2387:24:5;;;;-1:-1:-1;;2480:19:5;;;2509:10;:18;;-1:-1:-1;;2509:18:5;;;714:22532;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;714:22532:5;;;-1:-1:-1;714:22532:5;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "714:22532:5:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;714:22532:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20904:1350;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20904:1350:5;;-1:-1:-1;;;;;20904:1350:5;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;2853:81:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2853:81:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3439:180;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3439:180:6;;-1:-1:-1;;;;;3439:180:6;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1147:50:1;;;:::i;9827:481:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;9827:481:5;;;;;;;;;;:::i;9340:::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;9340:481:5;;;;;;;;;;:::i;3347:86:6:-;;;:::i;1439:54:1:-;;;:::i;1040:45::-;;;:::i;4409:483:6:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4409:483:6;;;;;;;;;;;;;;;;;:::i;2766:118:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2766:118:5;-1:-1:-1;;;;;2766:118:5;;:::i;4338:131::-;;;:::i;:::-;;;;-1:-1:-1;;;;;4338:131:5;;;;;;;;;;;;;;3031:80:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4475:341:5;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4475:341:5;;:::i;:::-;;6415:1603;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6415:1603:5;;-1:-1:-1;;;;;6415:1603:5;;;;;;;;;;;:::i;19606:1292::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19606:1292:5;;-1:-1:-1;;;;;19606:1292:5;;;;;;;;;;;:::i;5023:242::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5023:242:5;;;;:::i;5271:418::-;;;:::i;10314:925::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10314:925:5;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;10314:925:5;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;10314:925:5;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;-1:-1;10314:925:5;;-1:-1:-1;10314:925:5;-1:-1:-1;10314:925:5;:::i;8611:1167:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;8611:1167:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;17204:1173:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;17204:1173:5;;-1:-1:-1;;;;;17204:1173:5;;;;;;;;;;;:::i;3879:388:6:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3879:388:6;;-1:-1:-1;;;;;3879:388:6;;;;;;:::i;18383:1217:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;18383:1217:5;;-1:-1:-1;;;;;18383:1217:5;;;;;;;;;;;:::i;3241:100:6:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3241:100:6;-1:-1:-1;;;;;3241:100:6;;:::i;876:53:1:-;;;:::i;14777:2420:5:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;14777:2420:5;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;12346:2425;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;12346:2425:5;;;;;;;;;;;;;;;;;;;;;;;;;:::i;13224:1254:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;13224:1254:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;6465:1140::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;6465:1140:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1203:54:1:-;;;:::i;10884:1234:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;10884:1234:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;9116:218:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;9116:218:5;-1:-1:-1;;;;;9116:218:5;;:::i;2654:106::-;;;:::i;4822:195::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4822:195:5;-1:-1:-1;;;;;4822:195:5;;:::i;3576:142::-;;;:::i;1264:51:1:-;;;:::i;3352:218:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3352:218:5;-1:-1:-1;;;;;3352:218:5;;:::i;2940:85:6:-;;;:::i;1555:59:1:-;;;:::i;795:117:0:-;;;:::i;1636:494:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;1636:494:3;;;;;;;;;;;;;;;;;;;;;;:::i;4273:130:6:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4273:130:6;;-1:-1:-1;;;;;4273:130:6;;;;;;:::i;11245:1094:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11245:1094:5;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;11245:1094:5;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;11245:1094:5;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;-1:-1;11245:1094:5;;-1:-1:-1;11245:1094:5;-1:-1:-1;11245:1094:5;:::i;827:42:1:-;;;:::i;779:::-;;;:::i;1322:46::-;;;:::i;3136:664:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;3136:664:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;935:50:1:-;;;:::i;1374:59::-;;;:::i;3152:194:5:-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3152:194:5;;;;;;;;;;;;;;;;;991:42:1;;;:::i;3008:138:5:-;;;:::i;2890:112::-;;;:::i;8024:1010::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8024:1010:5;-1:-1:-1;;;;;8024:1010:5;;:::i;4210:122::-;;;:::i;3625:248:6:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3625:248:6;;-1:-1:-1;;;;;3625:248:6;;;;;;:::i;3117:118::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3117:118:6;;;;;;;;;;:::i;5696:713:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5696:713:5;;-1:-1:-1;;;;;5696:713:5;;;;;;;;;;;:::i;1500:49:1:-;;;:::i;3724:266:5:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3724:266:5;-1:-1:-1;;;;;3724:266:5;;:::i;3996:208::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3996:208:5;-1:-1:-1;;;;;3996:208:5;;:::i;4806:653:3:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;4806:653:3;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;2540:108:5:-;;;:::i;20904:1350::-;1567:39;;;;;;;1597:8;1567:39;;;;;;21062:17;;1585:10;;-1:-1:-1;;;;;;1576:7:5;;;;21062:17;;1597:8;;1567:39;;;;;21062:17;1597:8;;21062:17;1567:39;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;21103:10;;1699:13;21103:10;21095:40;;;;;-1:-1:-1;;;;;21095:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;21095:40:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;21153:18:5;;;;;;:8;:18;;;;;:24;;;21145:50;;;;;-1:-1:-1;;;;;21145:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;21145:50:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;21236:18:5;;;;;;:8;:18;;;;;:26;;;;;21231:47;;766:6:1;1597:8;;1609:5;1596:18;21231:4:5;:47::i;:::-;21213:14;:65;;21205:95;;;;;-1:-1:-1;;;;;21205:95:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;21205:95:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;21338:18:5;;21311:24;21338:18;;;:8;:18;;;;;21436:17;;;;-1:-1:-1;21483:16:5;;;;21529:12;;21571;;21657:8;;21382:309;;21436:17;21483:16;21529:12;21571;21613:14;;21382:24;:309::i;:::-;21367:324;-1:-1:-1;21710:17:5;21702:45;;;;;-1:-1:-1;;;;;21702:45:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;21702:45:5;;;;;;;;;;;;;;;21781:15;21765:12;:31;;21757:56;;;;;-1:-1:-1;;;;;21757:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;21757:56:5;;;;;;;;;;;;;;;21844:39;21849:9;:17;;;21868:14;21844:4;:39::i;:::-;21824:17;;;:59;21894:12;21909:28;21914:12;21894;21909:4;:28::i;:::-;21953:46;;;;;;;;-1:-1:-1;;;21894:43:5;;-1:-1:-1;;;;;;21953:46:5;;;21962:10;;21953:46;-1:-1:-1;;;;;;;;;21953:46:5;;;;;;;;;22010:40;22025:10;22037:12;22010:14;:40::i;:::-;22060:43;22075:27;22080:12;22094:7;22075:4;:27::i;:::-;22060:14;:43::i;:::-;22128:8;;22113:33;;22128:8;;;-1:-1:-1;;;;;22128:8:5;22138:7;22113:14;:33::i;:::-;22156:53;22172:8;22182:10;22194:14;22156:15;:53::i;:::-;-1:-1:-1;;1733:6:5;:14;;-1:-1:-1;;1733:14:5;;;20904:1350;;-1:-1:-1;;;20904:1350:5:o;2853:81:6:-;2922:5;2915:12;;;;;;;;;;;;;-1:-1:-1;;2915:12:6;;;;;;;;;;;;;;;;;;;;;;;;;;2890:13;;2915:12;;2922:5;;2915:12;;;2922:5;2915:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2853:81;:::o;3439:180::-;3524:10;3497:4;3513:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3513:27:6;;;;;;;;;;;:33;;;3561:30;;;;;;;-1:-1:-1;;3497:4:6;;3513:27;;3524:10;;3561:30;;3497:4;;3513:22;-1:-1:-1;3497:4:6;-1:-1:-1;;;;;3561:30:6;;;;;;;-1:-1:-1;3608:4:6;3439:180;;;;;:::o;1147:50:1:-;1188:9;1147:50;:::o;9827:481:5:-;1801:6;;9949:14;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;9987:17:5;;;;;;:8;:17;;;;;:23;;;9979:49;;;;;-1:-1:-1;;;;;9979:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;9979:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;10046:18:5;;;;;;:8;:18;;;;;:24;;;10038:50;;;;;-1:-1:-1;;;;;10038:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;10038:50:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;10124:17:5;;;10098:23;10124:17;;;:8;:17;;;;;;10178:18;;;;;;;10227:16;;;;;-1:-1:-1;10245:15:5;;;;10262:17;;;;10281:16;;;;10178:18;;10213:88;;10227:16;;10245:15;10281:16;10213:13;:88::i;:::-;10206:95;9827:481;-1:-1:-1;;;;;9827:481:5:o;9340:::-;1801:6;;9455:14;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;9493:17:5;;;;;;:8;:17;;;;;:23;;;9485:49;;;;;-1:-1:-1;;;;;9485:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;9485:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;9552:18:5;;;;;;:8;:18;;;;;:24;;;9544:50;;;;;-1:-1:-1;;;;;9544:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;9544:50:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;9630:17:5;;;9604:23;9630:17;;;:8;:17;;;;;;9684:18;;;;;;;9733:16;;;;;-1:-1:-1;9751:15:5;;;;9768:17;;;;9787:16;;;;9805:8;;9719:95;;9751:15;9768:17;9787:16;9719:13;:95::i;3347:86:6:-;3414:12;;3347:86;:::o;1439:54:1:-;1487:6;766;1480:13;;1439:54;:::o;1040:45::-;766:6;1040:45;:::o;4409:483:6:-;4485:4;-1:-1:-1;;;;;4509:17:6;;:10;:17;;:55;;-1:-1:-1;;;;;;4537:15:6;;;;;;-1:-1:-1;4537:15:6;;;;;;;;4553:10;4537:27;;;;;;;;4530:34;;;4509:55;4501:89;;;;;-1:-1:-1;;;;;4501:89:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;4600:20;4606:3;4611;4616;4600:5;:20::i;:::-;-1:-1:-1;;;;;4634:17:6;;:10;:17;;;;:63;;-1:-1:-1;;;;;;4655:15:6;;;;;;-1:-1:-1;4655:15:6;;;;;;;;4671:10;4655:27;;;;;;;;-1:-1:-1;;4655:42:6;;4634:63;4630:235;;;-1:-1:-1;;;;;4748:15:6;;;;;;-1:-1:-1;4748:15:6;;;;;;;;4764:10;4748:27;;;;;;;;4743:38;;4777:3;4743:4;:38::i;:::-;-1:-1:-1;;;;;4713:15:6;;;;;;;-1:-1:-1;4713:15:6;;;;;;;;4729:10;4713:27;;;;;;;;;:68;;;4800:54;;;;;;;-1:-1:-1;;4800:54:6;;;;4729:10;;4800:54;;;;4713:15;-1:-1:-1;4713:15:6;-1:-1:-1;;;;;4800:54:6;;;;;;;;;4630:235;-1:-1:-1;4881:4:6;4409:483;;;;;:::o;2766:118:5:-;-1:-1:-1;;;;;2860:11:5;2833:4;2860:11;;;:8;:11;;;;;:17;;;;2766:118::o;4338:131::-;1801:6;;4421:7;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;4451:11:5;;-1:-1:-1;;;;;4451:11:5;;4338:131::o;3031:80:6:-;3095:9;;;;3031:80;:::o;4475:341:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;4580:10;;1699:13;4580:10;4579:11;4571:40;;;;;-1:-1:-1;;;;;4571:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;4571:40:5;;;;;;;;;;;;;;;4643:11;;-1:-1:-1;;;;;4643:11:5;4629:10;:25;4621:56;;;;;-1:-1:-1;;;;;4621:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;4621:56:5;;;;;;;;;;;;;;;917:12:1;4695:18:5;;;4687:42;;;;;-1:-1:-1;;;;;4687:42:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;976:9:1;4747:18:5;;;4739:42;;;;;-1:-1:-1;;;;;4739:42:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;4791:8;:18;1733:6;:14;;-1:-1:-1;;1733:14:5;;;4475:341::o;6415:1603::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;;-1:-1:-1;;1699:13:5;;;;;;6555:11;;-1:-1:-1;;;;;6555:11:5;6541:10;:25;6533:56;;;;;-1:-1:-1;;;;;6533:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;6533:56:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;6607:15:5;;;;;;:8;:15;;;;;:21;;;6599:47;;;;;-1:-1:-1;;;;;6599:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;6599:47:5;;;;;;;;;;;;;;;6665:10;;;;6664:11;6656:40;;;;;-1:-1:-1;;;;;6656:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;6656:40:5;;;;;;;;;;;;;;;766:6:1;6715::5;:20;;6707:47;;;;;-1:-1:-1;;;;;6707:47:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;1132:9:1;6772:20:5;;;6764:47;;;;;-1:-1:-1;;;;;6764:47:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;1244:13:1;6829:22:5;;;6821:50;;;;;-1:-1:-1;;;;;6821:50:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6944:15:5;;6927:14;6944:15;;;:8;:15;;;;;-1:-1:-1;6944:22:5;;6980:18;;;6976:299;;;7029:43;7034:12;;7048:23;7053:6;7061:9;7048:4;:23::i;:::-;7029:4;:43::i;:::-;7014:12;:58;;;1188:9:1;-1:-1:-1;7094:32:5;7086:65;;;;;-1:-1:-1;;;;;7086:65:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;6976:299;;;7181:9;7172:6;:18;7168:107;;;7221:43;7226:12;;7240:23;7245:9;7256:6;7240:4;:23::i;:::-;7221:4;:43::i;:::-;7206:12;:58;7168:107;-1:-1:-1;;;;;7292:15:5;;;;;;:8;:15;;;;;-1:-1:-1;7292:22:5;;:31;;;7414:23;;;;7447:33;;;;7494:20;;;7490:522;;;7530:61;7546:5;7553:10;7565:25;7570:7;7579:10;7565:4;:25::i;:::-;7530:15;:61::i;:::-;7490:522;;;7622:10;7612:7;:20;7608:404;;;7725:26;7754:25;7759:10;7771:7;7754:4;:25::i;:::-;7725:54;;7793:17;7813:37;7818:21;1032:1:1;7813:4:5;:37::i;:::-;7793:57;;7864:77;7880:5;7887:10;7899:41;7904:21;7927:12;7899:4;:41::i;:::-;7864:15;:77::i;:::-;7978:8;;7955:46;;7971:5;;7978:8;;;-1:-1:-1;;;;;7978:8:5;7988:12;7955:15;:46::i;:::-;7608:404;;;-1:-1:-1;;1733:6:5;:14;;-1:-1:-1;;1733:14:5;;;-1:-1:-1;;;6415:1603:5:o;19606:1292::-;1567:39;;;;;;;1597:8;1567:39;;;;;;19756:19;;1585:10;;-1:-1:-1;;;;;;1576:7:5;;;;19756:19;;1597:8;;1567:39;;;;;19756:19;1597:8;;19756:19;1567:39;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;19799:10;;1699:13;19799:10;19791:40;;;;;-1:-1:-1;;;;;19791:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;19791:40:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;19849:18:5;;;;;;:8;:18;;;;;:24;;;19841:50;;;;;-1:-1:-1;;;;;19841:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;19841:50:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;19929:18:5;;19902:24;19929:18;;;:8;:18;;;;;20029:17;;;;-1:-1:-1;20076:16:5;;;;20122:12;;20164;;20248:8;;19975:307;;20029:17;20076:16;20122:12;20164;20206;;19975:24;:307::i;:::-;19958:324;;20319:12;20301:14;:30;;20293:56;;;;;-1:-1:-1;;;;;20293:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;20293:56:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;20399:18:5;;;;;;:8;:18;;;;;:26;;;;;20394:47;;766:6:1;1597:8;;20394:47:5;20376:14;:65;;20368:95;;;;;-1:-1:-1;;;;;20368:95:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;20368:95:5;;;;;;;;;;;;;;;20494:39;20499:9;:17;;;20518:14;20494:4;:39::i;:::-;20474:17;;;:59;20544:12;20559:28;20564:12;20544;20559:4;:28::i;:::-;20603:46;;;;;;;;-1:-1:-1;;;20544:43:5;;-1:-1:-1;;;;;;20603:46:5;;;20612:10;;20603:46;-1:-1:-1;;;;;;;;;20603:46:5;;;;;;;;;20660:40;20675:10;20687:12;20660:14;:40::i;:::-;20710:43;20725:27;20730:12;20744:7;20725:4;:27::i;20710:43::-;20778:8;;20763:33;;20778:8;;;-1:-1:-1;;;;;20778:8:5;20788:7;20763:14;:33::i;:::-;20806:53;20822:8;20832:10;20844:14;20806:15;:53::i;5023:242::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;5130:10;;1699:13;5130:10;5129:11;5121:40;;;;;-1:-1:-1;;;;;5121:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;5121:40:5;;;;;;;;;;;;;;;5193:11;;-1:-1:-1;;;;;5193:11:5;5179:10;:25;5171:56;;;;;-1:-1:-1;;;;;5171:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;5171:56:5;;;;;;;;;;;;;;;5237:11;:21;;;;;-1:-1:-1;;;5237:21:5;-1:-1:-1;;5237:21:5;;;;;;;;;1733:6;:14;;-1:-1:-1;;1733:14:5;;;5023:242::o;5271:418::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;;-1:-1:-1;;1699:13:5;;;;;;5374:11;;-1:-1:-1;;;;;5374:11:5;5360:10;:25;5352:56;;;;;-1:-1:-1;;;;;5352:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;5352:56:5;;;;;;;;;;;;;;;5427:10;;;;5426:11;5418:40;;;;;-1:-1:-1;;;;;5418:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;5418:40:5;;;;;;;;;;;;;;;5476:7;:14;820:1:1;-1:-1:-1;5476:34:5;5468:61;;;;;-1:-1:-1;;;;;5468:61:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;5540:10;:17;;-1:-1:-1;;5540:17:5;5553:4;5540:17;;;5567:11;:18;;-1:-1:-1;;5567:18:5;-1:-1:-1;;;5567:18:5;;;5596:32;1305:10:1;5596:14:5;:32::i;:::-;5638:44;5653:10;1305::1;5638:14:5;:44::i;:::-;1733:6;:14;;-1:-1:-1;;1733:14:5;;;5271:418::o;10314:925::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;10451:10;;1699:13;10451:10;10443:40;;;;;-1:-1:-1;;;;;10443:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;10443:40:5;;;;;;;;;;;;;;;10494:14;10511:13;:11;:13::i;:::-;10494:30;;10534:10;10547:30;10552:13;10567:9;10547:4;:30::i;:::-;10534:43;-1:-1:-1;10595:10:5;10587:38;;;;;-1:-1:-1;;;;;10587:38:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;10587:38:5;;;;;;;;;;;;;;;10641:6;10636:507;10657:7;:14;10653:18;;10636:507;;;10692:9;10704:7;10712:1;10704:10;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10704:10:5;10739:11;;;:8;:11;;;;;;:19;;;10704:10;;-1:-1:-1;10739:19:5;10793:16;10798:5;10739:19;10793:4;:16::i;:::-;10772:37;-1:-1:-1;10831:18:5;10823:46;;;;;-1:-1:-1;;;;;10823:46:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;10823:46:5;;;;;;;;;;;;;;;10908:12;;10921:1;10908:15;;;;;;;;;;;;;10891:13;:32;;10883:57;;;;;-1:-1:-1;;;;;10883:57:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;10883:57:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;10981:11:5;;;;;;:8;:11;;;;;:19;;;10976:40;;11002:13;10976:4;:40::i;:::-;-1:-1:-1;;;;;10954:11:5;;;;;;:8;:11;;;;;;;;:19;;:62;;;;11035:38;;;;;;;-1:-1:-1;;10954:11:5;;11044:10;;11035:38;;10954:11;;-1:-1:-1;10954:11:5;-1:-1:-1;;;;;11035:38:5;;;;;;;;;11087:45;11103:1;11106:10;11118:13;11087:15;:45::i;:::-;-1:-1:-1;;;10673:3:5;;10636:507;;;;11152:29;11167:13;11152:14;:29::i;:::-;11191:41;11206:10;11218:13;11191:14;:41::i;8611:1167:3:-;8846:18;8880:21;8904:32;8909:13;8924:11;8904:4;:32::i;:::-;8880:56;;8946:18;8967:31;8972:10;8984:13;8967:4;:31::i;:::-;8946:52;;9008:14;9025:31;9030:13;9045:10;9025:4;:31::i;:::-;9008:48;;9131:8;9142:28;766:6:1;9153:16:3;9142:4;:28::i;:::-;9131:39;;9181:17;9201:20;9206:9;9217:3;9201:4;:20::i;:::-;9181:40;;9231:22;9256:34;9261:12;9275:14;9256:4;:34::i;:::-;9231:59;;9300:26;9329:39;9334:17;9353:14;9329:4;:39::i;:::-;9300:68;;9617:8;9628:43;9633:28;766:6:1;9644:16:3;9633:4;:28::i;:::-;9663:7;9628:4;:43::i;:::-;9617:54;;9697:44;9702:21;9725:15;766:6:1;9736:3:3;9725:4;:15::i;:::-;9697:4;:44::i;:::-;9681:60;8611:1167;-1:-1:-1;;;;;;;;;;;;;;;8611:1167:3:o;17204:1173:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;17360:18;;1585:10;;-1:-1:-1;;;;;;1576:7:5;;;;17360:18;;1597:8;;1567:39;;;;;17360:18;1597:8;;17360:18;1567:39;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;17411:10;;1699:13;17411:10;17403:40;;;;;-1:-1:-1;;;;;17403:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;17403:40:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;17461:17:5;;;;;;:8;:17;;;;;:23;;;17453:49;;;;;-1:-1:-1;;;;;17453:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;17453:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;17542:17:5;;;;;;:8;:17;;;;;:25;;;17537:45;;-1:-1:-1;766:6:1;1541:8;;17537:4:5;:45::i;:::-;17520:13;:62;;17512:91;;;;;-1:-1:-1;;;;;17512:91:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;17512:91:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;17640:17:5;;17614:23;17640:17;;;:8;:17;;;;;17738:16;;;;-1:-1:-1;17784:15:5;;;;17829:12;;17871;;17956:8;;17684:306;;17738:16;17784:15;17829:12;17871;17913:13;;17684:24;:306::i;:::-;17668:322;;18026:16;18009:13;:33;;18001:59;;;;;-1:-1:-1;;;;;18001:59:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;18001:59:5;;;;;;;;;;;;;;;18090:37;18095:8;:16;;;18113:13;18090:4;:37::i;:::-;18071:16;;;:56;18143:44;;;;;;;;-1:-1:-1;;;;;18143:44:5;;;18152:10;;-1:-1:-1;;;;;;;;;;;18143:44:5;;;;;;;;18198:29;18213:13;18198:14;:29::i;:::-;18237:41;18252:10;18264:13;18237:14;:41::i;:::-;18288:51;18304:7;18313:10;18325:13;18288:15;:51::i;:::-;-1:-1:-1;1733:6:5;:14;;-1:-1:-1;;1733:14:5;;;17204:1173;;-1:-1:-1;;;17204:1173:5:o;3879:388:6:-;3989:10;3946:4;3978:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3978:27:6;;;;;;;;;;4019:14;;;4015:156;;;4060:10;4079:1;4049:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4049:27:6;;;;;;;;;:31;4015:156;;;4141:19;4146:8;4156:3;4141:4;:19::i;:::-;4122:10;4111:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4111:27:6;;;;;;;;;:49;4015:156;4194:10;4211:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4185:54:6;;4211:27;;;;;;;;;;4185:54;;;;;;;-1:-1:-1;;4185:54:6;;4194:10;4185:54;;4211:22;-1:-1:-1;4211:22:6;-1:-1:-1;;;;;4185:54:6;;;;;;;;;;-1:-1:-1;4256:4:6;;3879:388;-1:-1:-1;;;3879:388:6:o;18383:1217:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;18533:18;;1585:10;;-1:-1:-1;;;;;;1576:7:5;;;;18533:18;;1597:8;;1567:39;;;;;18533:18;1597:8;;18533:18;1567:39;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;18575:10;;1699:13;18575:10;18567:40;;;;;-1:-1:-1;;;;;18567:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;18567:40:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;18625:17:5;;;;;;:8;:17;;;;;:23;;;18617:49;;;;;-1:-1:-1;;;;;18617:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;18617:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;18703:17:5;;18677:23;18703:17;;;:8;:17;;;;;18801:16;;;;-1:-1:-1;18847:15:5;;;;18892:12;;18934;;19019:8;;18747:306;;18801:16;18847:15;18892:12;18934;18976:13;;18747:24;:306::i;:::-;18731:322;-1:-1:-1;19072:18:5;19064:46;;;;;-1:-1:-1;;;;;19064:46:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;19064:46:5;;;;;;;;;;;;;;;19145:11;19128:13;:28;;19120:53;;;;;-1:-1:-1;;;;;19120:53:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;19120:53:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;19222:17:5;;;;;;:8;:17;;;;;:25;;;19217:45;;-1:-1:-1;766:6:1;1541:8;;19217:45:5;19200:13;:62;;19192:91;;;;;-1:-1:-1;;;;;19192:91:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;19192:91:5;;;;;;;;;;;;;;;19313:37;19318:8;:16;;;19336:13;19313:4;:37::i;:::-;19294:16;;;:56;19366:44;;;;;;;;-1:-1:-1;;;;;19366:44:5;;;19375:10;;-1:-1:-1;;;;;;;;;;;19366:44:5;;;;;;;;19421:29;19436:13;19421:14;:29::i;:::-;19460:41;19475:10;19487:13;19460:14;:41::i;:::-;19511:51;19527:7;19536:10;19548:13;19511:15;:51::i;3241:100:6:-;-1:-1:-1;;;;;3320:14:6;3297:4;3320:14;;;;;;;;;;;;3241:100::o;876:53:1:-;924:5;766:6;917:12;;14777:2420:5;1567:39;;;;;;;1597:8;1567:39;;;;;;-1:-1:-1;;;;1585:10:5;;1576:7;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1567:39:5;;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;-1:-1:-1;;;;;15068:17:5;;-1:-1:-1;15068:17:5;;;:8;:17;;;;;:23;1699:13;15068:23;15060:49;;;;;-1:-1:-1;;;;;15060:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;15060:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;15127:18:5;;;;;;:8;:18;;;;;:24;;;15119:50;;;;;-1:-1:-1;;;;;15119:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;15119:50:5;;;;;;;;;;;;;;;15187:11;;-1:-1:-1;;;15187:11:5;;;;15179:43;;;;;-1:-1:-1;;;;;15179:43:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15259:26:5;;;15233:23;15259:26;;;:8;:26;;;;;;15322:27;;;;;;;15391:17;;;;;15386:38;;766:6:1;1597:8;;15386:38:5;15368:14;:56;;15360:86;;;;;-1:-1:-1;;;;;15360:86:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;15360:86:5;;;;;;;;;;;;;;;15457:20;15480:309;15531:8;:16;;;15585:8;:15;;;15638:9;:17;;;15693:9;:16;;;15747:8;;15480:13;:309::i;:::-;15457:332;;15826:8;15807:15;:27;;15799:59;;;;;-1:-1:-1;;;;;15799:59:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;15885:306;15929:8;:16;;;15975:8;:15;;;16020:9;:17;;;16067:9;:16;;;16113:14;16157:8;;15885:14;:306::i;:::-;15869:322;;16226:11;16209:13;:28;;16201:53;;;;;-1:-1:-1;;;;;16201:53:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;16201:53:5;;;;;;;;;;;;;;;16284:37;16289:8;:16;;;16307:13;16284:4;:37::i;:::-;16265:8;:16;;:56;;;;16351:39;16356:9;:17;;;16375:14;16351:4;:39::i;:::-;16331:17;;;;:59;;;16465:16;;;16515:15;;;;;16615:16;;;;16665:8;;16418:285;;16331:59;16615:16;16418:13;:285::i;:::-;16401:302;;16739:15;16721:14;:33;;16713:61;;;;;-1:-1:-1;;;;;16713:61:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;16713:61:5;;;;;;;;;;;;;;;16810:8;16792:14;:26;;16784:54;;;;;-1:-1:-1;;;;;16784:54:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;16875:35;16880:13;16895:14;16875:4;:35::i;:::-;16856:15;:54;;16848:82;;;;;-1:-1:-1;;;;;16848:82:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;16848:82:5;;;;;;;;;;;;;;;16946:70;;;;;;;;;;;;;;-1:-1:-1;;;;;16946:70:5;;;;;;;;16955:10;;16946:70;;;;;;;;;;;17027:51;17043:7;17052:10;17064:13;17027:15;:51::i;:::-;17088:53;17104:8;17114:10;17126:14;17088:15;:53::i;:::-;-1:-1:-1;;1733:6:5;:14;;-1:-1:-1;;1733:14:5;;;-1:-1:-1;14777:2420:5;;;;-1:-1:-1;14777:2420:5;-1:-1:-1;;;;14777:2420:5:o;12346:2425::-;1567:39;;;;;;;1597:8;1567:39;;;;;;-1:-1:-1;;;;1585:10:5;;1576:7;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1567:39:5;;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;-1:-1:-1;;;;;12637:17:5;;-1:-1:-1;12637:17:5;;;:8;:17;;;;;:23;1699:13;12637:23;12629:49;;;;;-1:-1:-1;;;;;12629:49:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;12629:49:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;12696:18:5;;;;;;:8;:18;;;;;:24;;;12688:50;;;;;-1:-1:-1;;;;;12688:50:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;12688:50:5;;;;;;;;;;;;;;;12756:11;;-1:-1:-1;;;12756:11:5;;;;12748:43;;;;;-1:-1:-1;;;;;12748:43:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12828:26:5;;;12802:23;12828:26;;;:8;:26;;;;;;12891:27;;;;;;;12959:16;;;;12954:36;;-1:-1:-1;766:6:1;1541:8;;12954:36:5;12937:13;:53;;12929:82;;;;;-1:-1:-1;;;;;12929:82:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;12929:82:5;;;;;;;;;;;;;;;13022:20;13045:309;13096:8;:16;;;13150:8;:15;;;13203:9;:17;;;13258:9;:16;;;13312:8;;13045:13;:309::i;:::-;13022:332;;13391:8;13372:15;:27;;13364:59;;;;;-1:-1:-1;;;;;13364:59:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;13451:305;13495:8;:16;;;13541:8;:15;;;13586:9;:17;;;13633:9;:16;;;13679:13;13722:8;;13451:14;:305::i;:::-;13434:322;;13792:12;13774:14;:30;;13766:56;;;;;-1:-1:-1;;;;;13766:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;13766:56:5;;;;;;;;;;;;;;;13852:37;13857:8;:16;;;13875:13;13852:4;:37::i;:::-;13833:8;:16;;:56;;;;13919:39;13924:9;:17;;;13943:14;13919:4;:39::i;:::-;13899:17;;;;:59;;;14033:16;;;14083:15;;;;;14183:16;;;;14233:8;;13986:285;;13899:59;14183:16;13986:13;:285::i;:::-;13969:302;;14307:15;14289:14;:33;;14281:61;;;;;-1:-1:-1;;;;;14281:61:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;14281:61:5;;;;;;;;;;;;;;;14383:8;14365:14;:26;;14357:54;;;;;-1:-1:-1;;;;;14357:54:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;14448:35;14453:13;14468:14;14448:4;:35::i;:::-;14429:15;:54;;14421:82;;;;;-1:-1:-1;;;;;14421:82:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;14421:82:5;;;;;;;;;;;;;;;14519:70;;;;;;;;;;;;;;-1:-1:-1;;;;;14519:70:5;;;;;;;;14528:10;;14519:70;;;;;;;;;;;14600:51;14616:7;14625:10;14637:13;14600:15;:51::i;:::-;14661:53;14677:8;14687:10;14699:14;14661:15;:53::i;13224:1254:3:-;13462:17;13549:21;13573:33;13578:14;13594:11;13573:4;:33::i;:::-;13549:57;;13687:8;13698:28;766:6:1;13709:16:3;13698:4;:28::i;:::-;13687:39;;13736:8;13747:18;13752:3;13757:7;13747:4;:18::i;:::-;13736:29;;13776:32;13811:37;13816:14;13832:15;766:6:1;13843:3:3;13832:4;:15::i;13811:37::-;13776:72;;13859:23;13885:50;13890:15;13907:27;13885:4;:50::i;:::-;13859:76;;13945:18;13966:41;13971:18;13991:15;13966:4;:41::i;:::-;13945:62;;14084:14;14101:37;14106:13;14121:16;14101:4;:37::i;:::-;14084:54;;14148:18;14169:27;14174:9;14185:10;14169:4;:27::i;:::-;14148:48;;14206:29;14238:31;14243:10;14255:13;14238:4;:31::i;:::-;14206:63;;14390:52;14395:24;14421:20;766:6:1;1032:1;14421:4:3;:20::i;14390:52::-;14375:67;-1:-1:-1;;;;;;;;;;13224:1254:3;;;;;;;;:::o;6465:1140::-;6700:18;6978:21;7002:32;7007:13;7022:11;7002:4;:32::i;:::-;6978:56;;7044:8;7055:43;7060:28;766:6:1;7071:16:3;7060:4;:28::i;:::-;7090:7;7055:4;:43::i;:::-;7044:54;;7109:26;7138:36;7143:13;7158:15;766:6:1;7169:3:3;7158:4;:15::i;:::-;7138:4;:36::i;:::-;7109:65;;7185:22;7210:43;7215:14;7231:21;7210:4;:43::i;:::-;7185:68;;7263:17;7283:39;7288:17;7307:14;7283:4;:39::i;:::-;7263:59;;7400:14;7417:36;7422:12;7436:16;7417:4;:36::i;:::-;7400:53;;7463:18;7484:27;7489:9;7500:10;7484:4;:27::i;:::-;7463:48;;7537:31;7542:13;7557:10;7537:4;:31::i;:::-;7521:47;6465:1140;-1:-1:-1;;;;;;;;;;;;;;6465:1140:3:o;1203:54:1:-;1251:6;766;1244:13;;10884:1234:3;11120:19;11155:21;11179:33;11184:14;11200:11;11179:4;:33::i;:::-;11155:57;;11317:29;11349:40;11354:12;11368:20;766:6:1;1032:1;11368:4:3;:20::i;11349:40::-;11317:72;;11399:18;11420:42;11425:10;11437:24;11420:4;:42::i;:::-;11399:63;;11472:14;11489:31;11494:13;11509:10;11489:4;:31::i;:::-;11472:48;;11590:18;11611:45;11616:9;11627:28;766:6:1;11638:16:3;11627:4;:28::i;:::-;11611:4;:45::i;:::-;11590:66;;11666:23;11692:36;11697:13;11712:15;11692:4;:36::i;:::-;11666:62;;11739:32;11774:41;11779:15;11796:18;11774:4;:41::i;:::-;11739:76;;11948:8;11959:43;11964:28;766:6:1;11975:16:3;11964:4;:28::i;11959:43::-;11948:54;;12030:50;12035:27;12064:15;766:6:1;12075:3:3;12064:4;:15::i;9116:218:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;-1:-1:-1;;;;;9214:15:5;;-1:-1:-1;9214:15:5;;;:8;:15;;;;;:21;1699:13;9214:21;9206:47;;;;;-1:-1:-1;;;;;9206:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;9206:47:5;;;;;;;;;;;;;;;9289:38;;;;;;9321:4;9289:38;;;;;;-1:-1:-1;;;;;9289:23:5;;;;;:38;;;;;;;;;;;;;;:23;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;9289:38:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9289:38:5;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;9289:38:5;-1:-1:-1;;;;;9263:15:5;;;;;;;;:8;9289:38;9263:15;;;;:23;;:64;1733:6;:14;;-1:-1:-1;;1733:14:5;;;9116:218::o;2654:106::-;2743:10;;;;2654:106;:::o;4822:195::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;;-1:-1:-1;;1699:13:5;;;;;;4945:11;;-1:-1:-1;;;;;4945:11:5;4931:10;:25;4923:56;;;;;-1:-1:-1;;;;;4923:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;4923:56:5;;;;;;;;;;;;;;;4989:11;:21;;-1:-1:-1;;;;;;4989:21:5;-1:-1:-1;;;;;4989:21:5;;;;;;;;;;1733:6;:14;;-1:-1:-1;;1733:14:5;;;4822:195::o;3576:142::-;1801:6;;3672:4;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;3699:12:5;;3576:142;:::o;1264:51:1:-;1305:10;1264:51;:::o;3352:218:5:-;1801:6;;3456:4;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;3485:15:5;;;;;;:8;:15;;;;;:21;;;3477:47;;;;;-1:-1:-1;;;;;3477:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;3477:47:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3541:15:5;;;;;:8;:15;;;;;-1:-1:-1;3541:22:5;;;3352:218::o;2940:85:6:-;3011:7;3004:14;;;;;;;;;;;;;-1:-1:-1;;3004:14:6;;;;;;;;;;;;;;;;;;;;;;;;;;2979:13;;3004:14;;3011:7;;3004:14;;;3011:7;3004:14;;;;;;;;;;;;;;;;;;;;;;;;1555:59:1;1596:18;1555:59;:::o;795:117:0:-;884:17;795:117;:::o;1636:494:3:-;1840:14;1870:10;1883:35;1888:14;1904:13;1883:4;:35::i;:::-;1870:48;;1928:10;1941:37;1946:15;1963:14;1941:4;:37::i;:::-;1928:50;;1988:10;2001:18;2006:5;2013;2001:4;:18::i;:::-;1988:31;;2029:10;2042:31;766:6:1;2053:19:3;766:6:1;2064:7:3;2053:4;:19::i;2042:31::-;2029:44;;2104:18;2109:5;2116;2104:4;:18::i;:::-;2092:30;1636:494;-1:-1:-1;;;;;;;;;;1636:494:3:o;4273:130:6:-;4332:4;4348:27;4354:10;4366:3;4371;4348:5;:27::i;:::-;-1:-1:-1;4392:4:6;4273:130;;;;:::o;11245:1094:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;-1:-1:-1;;1699:13:5;;;;;11382:10;;1699:13;11382:10;11374:40;;;;;-1:-1:-1;;;;;11374:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;11374:40:5;;;;;;;;;;;;;;;11425:14;11442:13;:11;:13::i;:::-;11425:30;;11465:12;11480:28;11485:12;1032:1:1;11480:4:5;:28::i;:::-;11465:43;;11518:20;11541:27;11546:12;11560:7;11541:4;:27::i;:::-;11518:50;;11578:10;11591:32;11596:15;11613:9;11591:4;:32::i;:::-;11578:45;-1:-1:-1;11641:10:5;11633:38;;;;;-1:-1:-1;;;;;11633:38:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;11633:38:5;;;;;;;;;;;;;;;11682:40;11697:10;11709:12;11682:14;:40::i;:::-;11747:8;;11732:33;;11747:8;;;-1:-1:-1;;;;;11747:8:5;11757:7;11732:14;:33::i;:::-;11775:31;11790:15;11775:14;:31::i;:::-;11822:6;11817:515;11838:7;:14;11834:18;;11817:515;;;11873:9;11885:7;11893:1;11885:10;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;11885:10:5;11920:11;;;:8;:11;;;;;;:19;;;11885:10;;-1:-1:-1;11920:19:5;11975:16;11980:5;11920:19;11975:4;:16::i;:::-;11953:38;-1:-1:-1;12013:19:5;12005:47;;;;;-1:-1:-1;;;;;12005:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;12005:47:5;;;;;;;;;;;;;;;12092:13;;12106:1;12092:16;;;;;;;;;;;;;12074:14;:34;;12066:60;;;;;-1:-1:-1;;;;;12066:60:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;12066:60:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;12167:11:5;;;;;;:8;:11;;;;;:19;;;12162:41;;12188:14;12162:4;:41::i;:::-;-1:-1:-1;;;;;12140:11:5;;;;;;:8;:11;;;;;;;;:19;;:63;;;;12222:39;;;;;;;-1:-1:-1;;12140:11:5;;12231:10;;12222:39;;12140:11;;-1:-1:-1;12140:11:5;-1:-1:-1;;;;;12222:39:5;;;;;;;;;12275:46;12291:1;12294:10;12306:14;12275:15;:46::i;:::-;-1:-1:-1;;;11854:3:5;;11817:515;;;-1:-1:-1;;1733:6:5;:14;;-1:-1:-1;;1733:14:5;;;-1:-1:-1;;;;;;11245:1094:5:o;827:42:1:-;868:1;827:42;:::o;779:::-;820:1;779:42;:::o;1322:46::-;1363:5;1322:46;:::o;3136:664:3:-;3369:19;3404:16;3423:35;3428:13;3443:14;3423:4;:35::i;:::-;3404:54;;3468:15;3486:19;766:6:1;3497:7:3;3486:4;:19::i;:::-;3468:37;;3528:31;3533:13;3548:10;3528:4;:31::i;:::-;3515:44;;3569:6;3578:54;3583:14;3599:32;3604:14;3620:10;3599:4;:32::i;3578:54::-;3569:63;;3642:8;3653:20;3658:1;3661:11;3653:4;:20::i;:::-;3642:31;;3683:8;3694:15;766:6:1;3705:3:3;3694:4;:15::i;:::-;3683:26;;3736;3741:15;3758:3;3736:4;:26::i;:::-;3719:43;3136:664;-1:-1:-1;;;;;;;;;;;;3136:664:3:o;935:50:1:-;983:2;766:6;976:9;;1374:59;1415:18;1374:59;:::o;3152:194:5:-;1801:6;;3236:23;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;3283:10;;;;3275:40;;;;;-1:-1:-1;;;;;3275:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;3275:40:5;;;;;;;;;;;;;;;3332:7;3325:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3325:14:5;;;-1:-1:-1;3325:14:5;;;;;;;;;;;;;;;;;;3152:194;:::o;991:42:1:-;1032:1;991:42;:::o;3008:138:5:-;1801:6;;3086:23;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;2890:112;2981:7;:14;2890:112;:::o;8024:1010::-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;1667:6;;;;;;;1666:7;1658:31;;;;;-1:-1:-1;;;;;1658:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1658:31:5;;;;;;;;;;;;;;;1699:6;:13;;;-1:-1:-1;;1699:13:5;;;;;;8139:11;;-1:-1:-1;;;;;8139:11:5;8125:10;:25;8117:56;;;;;-1:-1:-1;;;;;8117:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;8117:56:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;8191:15:5;;;;;;:8;:15;;;;;:21;;;8183:47;;;;;-1:-1:-1;;;;;8183:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;8183:47:5;;;;;;;;;;;;;;;8249:10;;;;8248:11;8240:40;;;;;-1:-1:-1;;;;;8240:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;8240:40:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;8311:15:5;;8291:17;8311:15;;;:8;:15;;;;;:23;;;;8364:28;8311:23;8291:17;8364:4;:28::i;:::-;8423:12;;-1:-1:-1;;;;;8437:15:5;;;;;;:8;:15;;;;;-1:-1:-1;8437:22:5;;8344:48;;-1:-1:-1;8418:42:5;;:4;:42::i;:::-;8403:12;:57;-1:-1:-1;;;;;8579:15:5;;8566:10;8579:15;;;:8;:15;;;;;-1:-1:-1;8579:21:5;;8622:7;:14;;-1:-1:-1;;8622:18:5;;;:7;:18;;8667:13;;;;;;;;;;;;;;;;8650:7;:14;;-1:-1:-1;;;;;8667:13:5;;;;8658:5;;8650:14;;;;;;;;;;;;;;:30;;-1:-1:-1;;;;;;8650:30:5;-1:-1:-1;;;;;8650:30:5;;;;;;;;;;;8699:7;:14;;8723:5;;8690:8;;8650:14;;8723:5;;8699:14;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8699:14:5;8690:24;;;;;;;;;;;;-1:-1:-1;8690:30:5;:38;8738:7;:13;;;;;;;;;;;;;;;-1:-1:-1;;8738:13:5;;;;;;;-1:-1:-1;;;;;;8738:13:5;;;;;;;;;8779:113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8761:15:5;;;;:8;:15;;;;;;;:131;;;;-1:-1:-1;;8761:131:5;;;;;;;;;-1:-1:-1;8761:131:5;;;;-1:-1:-1;8761:131:5;;;;;;;;;8903:68;8761:15;8926:10;8938:32;8943:12;8957;8938:4;:32::i;8903:68::-;9004:8;;8981:46;;8997:5;;9004:8;;;-1:-1:-1;;;;;9004:8:5;9014:12;8981:15;:46::i;4210:122::-;1801:6;;4290:4;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;4317:8:5;;4210:122;:::o;3625:248:6:-;3754:10;3692:4;3743:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3743:27:6;;;;;;;;;;3738:38;;3772:3;3738:4;:38::i;:::-;3719:10;3708:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3708:27:6;;;;;;;;;;;:68;;;3791:54;;;;;;;-1:-1:-1;;3708:27:6;;3791:54;;;;3708:22;-1:-1:-1;3708:22:6;-1:-1:-1;;;;;3791:54:6;;;;;;;;;;-1:-1:-1;3862:4:6;3625:248;;;;:::o;3117:118::-;-1:-1:-1;;;;;3208:15:6;;;3185:4;3208:15;;;-1:-1:-1;3208:15:6;;;;;;;;:20;;;;;;;;;;;;;3117:118::o;5696:713:5:-;1567:39;;;;;;;1597:8;1567:39;;;;;;1585:10;;-1:-1:-1;1576:7:5;;-1:-1:-1;;;;;;1576:7:5;;-1:-1:-1;;1597:8:5;1567:39;;;;-1:-1:-1;1597:8:5;;-1:-1:-1;1567:39:5;1:33:-1;99:1;81:16;;;74:27;1567:39:5;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1567:39:5;;;;-1:-1:-1;1567:39:5;;-1:-1:-1;;;;1567:39:5;5899:11;;-1:-1:-1;;;;;5899:11:5;5885:10;:25;5877:56;;;;;-1:-1:-1;;;;;5877:56:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;5877:56:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;5952:15:5;;;;;;:8;:15;;;;;:21;;;5951:22;5943:47;;;;;-1:-1:-1;;;;;5943:47:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;6009:10;;;;6008:11;6000:40;;;;;-1:-1:-1;;;;;6000:40:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;6000:40:5;;;;;;;;;;;;;;;6059:7;:14;868:1:1;-1:-1:-1;6051:60:5;;;;;-1:-1:-1;;;;;6051:60:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;6140:193;;;;;;;;6168:4;6140:193;;;6193:7;:14;;6140:193;;;;;;;-1:-1:-1;6140:193:5;;;;;;;;;;;;-1:-1:-1;;;;;6122:15:5;;;;;:8;:15;;;;;;:211;;;;-1:-1:-1;;6122:211:5;;;;;;;;;;;;;;;-1:-1:-1;6122:211:5;;;;;;;;;;;;;27:10:-1;;23:18;;;45:23;;6343:19:5;;;;;;;-1:-1:-1;;;;;;6343:19:5;;;;;;6372:30;6122:15;6386:7;6395:6;6372;:30::i;:::-;5696:713;;;:::o;1500:49:1:-;1548:1;766:6;1541:8;;3724:266:5;1801:6;;3826:4;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;3855:15:5;;;;;;:8;:15;;;;;:21;;;3847:47;;;;;-1:-1:-1;;;;;3847:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;3847:47:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;3918:15:5;;3904:11;3918:15;;;:8;:15;;;;;-1:-1:-1;3918:22:5;;3970:12;;3957:26;;3918:22;;3957:4;:26::i;:::-;3950:33;3724:266;-1:-1:-1;;;3724:266:5:o;3996:208::-;1801:6;;4089:4;;1801:6;;;;;1800:7;1792:31;;;;;-1:-1:-1;;;;;1792:31:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;1792:31:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;4118:15:5;;;;;;:8;:15;;;;;:21;;;4110:47;;;;;-1:-1:-1;;;;;4110:47:5;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;4110:47:5;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4174:15:5;;;;;:8;:15;;;;;:23;;;;3996:208::o;4806:653:3:-;5040:18;5074:16;5093:35;5098:14;5114:13;5093:4;:35::i;:::-;5074:54;;5138:9;5150:37;5155:15;5172:14;5150:4;:37::i;:::-;5138:49;;5197:6;5206:27;5211:15;5228:4;5206;:27::i;:::-;5197:36;;5243:8;5254:20;5259:1;5262:11;5254:4;:20::i;:::-;5243:31;;5290:15;5295:3;766:6:1;5290:4:3;:15::i;:::-;5284:21;;5331:19;766:6:1;5342:7:3;5331:4;:19::i;:::-;5315:35;;5376:46;5381:25;5386:14;5402:3;5381:4;:25::i;:::-;5408:13;5376:4;:46::i;:::-;5360:62;4806:653;-1:-1:-1;;;;;;;;;;;4806:653:3:o;2540:108:5:-;2630:11;;-1:-1:-1;;;2630:11:5;;;;;2540:108::o;1550:301:4:-;1619:4;1649:5;;;1672:6;;;:21;;;1692:1;1687;1682:2;:6;;;;;;:11;1672:21;1664:50;;;;;-1:-1:-1;;;;;1664:50:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;1740:8;1734:15;;1767:8;;;;1759:37;;;;;-1:-1:-1;;;;;1759:37:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;1806:7;766:6:1;1816:2:4;:9;;;1550:301;-1:-1:-1;;;;;;1550:301:4:o;1129:195::-;1198:4;1219:6;1227:9;1240:14;1249:1;1252;1240:8;:14::i;:::-;1218:36;;;;1273:4;1272:5;1264:35;;;;;-1:-1:-1;;;;;1264:35:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1316:1:4;1129:195;-1:-1:-1;;;1129:195:4:o;22837:108:5:-;22919:19;22925:4;22931:6;22919:5;:19::i;:::-;22837:108;;:::o;23155:88::-;23223:13;23229:6;23223:5;:13::i;:::-;23155:88;:::o;22951:104::-;23031:17;23037:2;23041:6;23031:5;:17::i;22640:191::-;22748:34;;;;;;-1:-1:-1;;;;;22748:34:5;;;;;;;;;;;;;;;-1:-1:-1;;22748:22:5;;;;;:34;;;;;;;;;;;;;;-1:-1:-1;22748:22:5;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;22748:34:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22748:34:5;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22748:34:5;;-1:-1:-1;22748:34:5;22792:32;;;;;-1:-1:-1;;;;;22792:32:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;22640:191;;;;:::o;2205:268:6:-;-1:-1:-1;;;;;2283:13:6;;:8;:13;;;;;;;;;;;-1:-1:-1;;2283:20:6;2275:53;;;;;-1:-1:-1;;;;;2275:53:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2359:13:6;;:8;:13;;;;;;;;;;;2354:24;;2374:3;2354:4;:24::i;:::-;-1:-1:-1;;;;;2338:13:6;;;:8;:13;;;;;;;;;;;:40;;;;2409:13;;;;;;;2404:24;;2424:3;2404:4;:24::i;:::-;-1:-1:-1;;;;;2388:13:6;;;:8;:13;;;;;;;;;;;:40;;;;2443:23;;;;;;;-1:-1:-1;;2388:13:6;;2443:23;;;;;;;;2388:8;:13;-1:-1:-1;2388:8:6;-1:-1:-1;;;;;2443:23:6;;;;;;;;2205:268;;;:::o;950:173:4:-;1019:4;1048:5;;;1071:6;;;;1063:35;;;;;-1:-1:-1;;;;;1063:35:4;;;;;;;;;;;;;;;;;;;;;;;;;;;22420:214:5;22530:55;;;;;;-1:-1:-1;;;;;22530:55:5;;;;;;;22571:4;22530:55;;;;;;;;;;;;-1:-1:-1;;22530:26:5;;;;;:55;;;;;;;;;;;;;;-1:-1:-1;22530:26:5;:55;;;5:2:-1;;;;30:1;27;20:12;23061:88:5;23129:13;23135:6;23129:5;:13::i;1857:376:4:-;1926:4;1954:6;1946:31;;;;;-1:-1:-1;;;;;1946:31:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;766:6:1;1997:8:4;;2023:6;;;:24;;;766:6:1;2038:1:4;2033:2;:6;;;;;;:14;2023:24;2015:53;;;;;-1:-1:-1;;;;;2015:53:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;2115:1;2111:5;;2105:12;;2135:8;;;;2127:37;;;;;-1:-1:-1;;;;;2127:37:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;2191:7;2206:1;2201:2;:6;;;;2714:537;2788:4;1363:5:1;2816:4:4;:21;;2808:55;;;;;-1:-1:-1;;;;;2808:55:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;1415:18:1;2881:21:4;;;2873:56;;;;;-1:-1:-1;;;;;2873:56:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;2940:10;2954:11;2961:3;2954:6;:11::i;:::-;2940:25;;2978:11;2992:16;2997:3;3002:5;2992:4;:16::i;:::-;2978:30;;3019:13;3035:24;3041:4;3047:11;3052:5;3047:4;:11::i;:::-;3035:5;:24::i;:::-;3019:40;-1:-1:-1;3074:11:4;3070:57;;3108:8;-1:-1:-1;3101:15:4;;-1:-1:-1;;3101:15:4;3070:57;3137:18;3158:40;3169:4;3175:6;1480:13:1;3158:10:4;:40::i;:::-;3137:61;;3215:29;3220:8;3230:13;3215:4;:29::i;:::-;3208:36;2714:537;-1:-1:-1;;;;;;;2714:537:4:o;1330:214::-;1403:4;1409;1438:1;1433;:6;1429:109;;-1:-1:-1;;1463:5:4;;;1470;1455:21;;1429:109;-1:-1:-1;;1515:5:4;;;1522:4;1429:109;1330:214;;;;;:::o;2577:96:6:-;2635:31;2641:4;2655;2662:3;2635:5;:31::i;1912:287::-;1981:4;1964:8;:23;;;;;;;;;;;:30;-1:-1:-1;1964:30:6;1956:63;;;;;-1:-1:-1;;;;;1956:63:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;2077:4;2060:8;:23;;;;;;;;;;;2055:34;;2085:3;2055:4;:34::i;:::-;2046:4;2029:8;:23;;;;;;;;;;:60;2119:12;;2114:23;;2133:3;2114:4;:23::i;:::-;2099:12;:38;2152:40;;;;;;;;2184:1;;2169:4;;-1:-1:-1;;;;;;;;;;;2152:40:6;;;;;;;;1912:287;:::o;2479:92::-;2535:29;2549:4;2556:2;2560:3;2535:5;:29::i;1692:214::-;1784:4;1767:8;:23;;;;;;;;;;;1762:34;;1792:3;1762:4;:34::i;:::-;1753:4;1736:8;:23;;;;;;;;;;:60;1826:12;;1821:23;;1840:3;1821:4;:23::i;:::-;1806:12;:38;1859:40;;;;;;;;1888:4;;1876:1;;-1:-1:-1;;;;;;;;;;;1859:40:6;;;;;;;;1692:214;:::o;833:111:4:-;896:4;766:6:1;923:7:4;928:1;923:4;:7::i;:::-;:14;;833:111;-1:-1:-1;;833:111:4:o;723:104::-;766:6:1;812:8:4;;;723:104::o;2258:300::-;2328:4;;2361:1;2357;:5;:21;;766:6:1;2357:21:4;;;2370:1;2357:21;2348:30;-1:-1:-1;2399:1:4;2394:6;;;;2389:145;2402:6;;2389:145;;2436:10;2441:1;2444;2436:4;:10::i;:::-;2432:14;-1:-1:-1;2469:1:4;2465;:5;:10;2461:63;;2499:10;2504:1;2507;2499:4;:10::i;:::-;2495:14;;2461:63;2415:1;2410:6;;;;2389:145;;3257:1047;3353:4;3405:3;3353:4;;3441:20;3450:4;766:6:1;3441:8:4;:20::i;:::-;3418:43;;-1:-1:-1;3418:43:4;-1:-1:-1;766:6:1;;3471:9:4;3796:1;3782:495;3807:9;3799:4;:17;3782:495;;3837:9;766:6:1;3849:1:4;:8;3837:20;;3872:6;3880:9;3893:29;3902:1;3905:16;3910:4;766:6:1;3905:4:4;:16::i;:::-;3893:8;:29::i;:::-;3871:51;;;;3943:22;3948:4;3954:10;3959:1;3962;3954:4;:10::i;3943:22::-;3936:29;;3986:16;3991:4;3997;3986;:16::i;:::-;3979:23;-1:-1:-1;4020:9:4;4016:20;;4031:5;;;;;4016:20;4055:4;4051:30;;;4072:9;;;4051:30;4099:4;4095:30;;;4116:9;;;4095:30;4143:8;4139:128;;;4177:15;4182:3;4187:4;4177;:15::i;:::-;4171:21;;4139:128;;;4237:15;4242:3;4247:4;4237;:15::i;:::-;4231:21;;4139:128;-1:-1:-1;;;3818:3:4;;3782:495;;;-1:-1:-1;4294:3:4;;3257:1047;-1:-1:-1;;;;;;;;;3257:1047:4:o", + "source": "// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity 0.5.12;\n\nimport \"./BToken.sol\";\nimport \"./BMath.sol\";\n\ncontract BPool is BBronze, BToken, BMath {\n\n struct Record {\n bool bound; // is token bound to pool\n uint index; // private\n uint denorm; // denormalized weight\n uint balance;\n }\n\n event LOG_SWAP(\n address indexed caller,\n address indexed tokenIn,\n address indexed tokenOut,\n uint256 tokenAmountIn,\n uint256 tokenAmountOut\n );\n\n event LOG_JOIN(\n address indexed caller,\n address indexed tokenIn,\n uint256 tokenAmountIn\n );\n\n event LOG_EXIT(\n address indexed caller,\n address indexed tokenOut,\n uint256 tokenAmountOut\n );\n\n event LOG_CALL(\n bytes4 indexed sig,\n address indexed caller,\n bytes data\n ) anonymous;\n\n modifier _logs_() {\n emit LOG_CALL(msg.sig, msg.sender, msg.data);\n _;\n }\n\n modifier _lock_() {\n require(!_mutex, \"ERR_REENTRY\");\n _mutex = true;\n _;\n _mutex = false;\n }\n\n modifier _viewlock_() {\n require(!_mutex, \"ERR_REENTRY\");\n _;\n }\n\n bool private _mutex;\n\n address private _factory; // BFactory address to push token exitFee to\n address private _controller; // has CONTROL role\n bool private _publicSwap; // true if PUBLIC can call SWAP functions\n\n // `setSwapFee` and `finalize` require CONTROL\n // `finalize` sets `PUBLIC can SWAP`, `PUBLIC can JOIN`\n uint private _swapFee;\n bool private _finalized;\n\n address[] private _tokens;\n mapping(address=>Record) private _records;\n uint private _totalWeight;\n\n constructor() public {\n _controller = msg.sender;\n _factory = msg.sender;\n _swapFee = MIN_FEE;\n _publicSwap = false;\n _finalized = false;\n }\n\n function isPublicSwap()\n external view\n returns (bool)\n {\n return _publicSwap;\n }\n\n function isFinalized()\n external view\n returns (bool)\n {\n return _finalized;\n }\n\n function isBound(address t)\n external view\n returns (bool)\n {\n return _records[t].bound;\n }\n\n function getNumTokens()\n external view\n returns (uint) \n {\n return _tokens.length;\n }\n\n function getCurrentTokens()\n external view _viewlock_\n returns (address[] memory tokens)\n {\n return _tokens;\n }\n\n function getFinalTokens()\n external view\n _viewlock_\n returns (address[] memory tokens)\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n return _tokens;\n }\n\n function getDenormalizedWeight(address token)\n external view\n _viewlock_\n returns (uint)\n {\n\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n return _records[token].denorm;\n }\n\n function getTotalDenormalizedWeight()\n external view\n _viewlock_\n returns (uint)\n {\n return _totalWeight;\n }\n\n function getNormalizedWeight(address token)\n external view\n _viewlock_\n returns (uint)\n {\n\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n uint denorm = _records[token].denorm;\n return bdiv(denorm, _totalWeight);\n }\n\n function getBalance(address token)\n external view\n _viewlock_\n returns (uint)\n {\n\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n return _records[token].balance;\n }\n\n function getSwapFee()\n external view\n _viewlock_\n returns (uint)\n {\n return _swapFee;\n }\n\n function getController()\n external view\n _viewlock_\n returns (address)\n {\n return _controller;\n }\n\n function setSwapFee(uint swapFee)\n external\n _logs_\n _lock_\n { \n require(!_finalized, \"ERR_IS_FINALIZED\");\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n require(swapFee >= MIN_FEE, \"ERR_MIN_FEE\");\n require(swapFee <= MAX_FEE, \"ERR_MAX_FEE\");\n _swapFee = swapFee;\n }\n\n function setController(address manager)\n external\n _logs_\n _lock_\n {\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n _controller = manager;\n }\n\n function setPublicSwap(bool public_)\n external\n _logs_\n _lock_\n {\n require(!_finalized, \"ERR_IS_FINALIZED\");\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n _publicSwap = public_;\n }\n\n function finalize()\n external\n _logs_\n _lock_\n {\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n require(!_finalized, \"ERR_IS_FINALIZED\");\n require(_tokens.length >= MIN_BOUND_TOKENS, \"ERR_MIN_TOKENS\");\n\n _finalized = true;\n _publicSwap = true;\n\n _mintPoolShare(INIT_POOL_SUPPLY);\n _pushPoolShare(msg.sender, INIT_POOL_SUPPLY);\n }\n\n\n function bind(address token, uint balance, uint denorm)\n external\n _logs_\n // _lock_ Bind does not lock because it jumps to `rebind`, which does\n {\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n require(!_records[token].bound, \"ERR_IS_BOUND\");\n require(!_finalized, \"ERR_IS_FINALIZED\");\n\n require(_tokens.length < MAX_BOUND_TOKENS, \"ERR_MAX_TOKENS\");\n\n _records[token] = Record({\n bound: true,\n index: _tokens.length,\n denorm: 0, // balance and denorm will be validated\n balance: 0 // and set by `rebind`\n });\n _tokens.push(token);\n rebind(token, balance, denorm);\n }\n\n function rebind(address token, uint balance, uint denorm)\n public\n _logs_\n _lock_\n {\n\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n require(!_finalized, \"ERR_IS_FINALIZED\");\n\n require(denorm >= MIN_WEIGHT, \"ERR_MIN_WEIGHT\");\n require(denorm <= MAX_WEIGHT, \"ERR_MAX_WEIGHT\");\n require(balance >= MIN_BALANCE, \"ERR_MIN_BALANCE\");\n\n // Adjust the denorm and totalWeight\n uint oldWeight = _records[token].denorm;\n if (denorm > oldWeight) {\n _totalWeight = badd(_totalWeight, bsub(denorm, oldWeight));\n require(_totalWeight <= MAX_TOTAL_WEIGHT, \"ERR_MAX_TOTAL_WEIGHT\");\n } else if (denorm < oldWeight) {\n _totalWeight = bsub(_totalWeight, bsub(oldWeight, denorm));\n } \n _records[token].denorm = denorm;\n\n // Adjust the balance record and actual token balance\n uint oldBalance = _records[token].balance;\n _records[token].balance = balance;\n if (balance > oldBalance) {\n _pullUnderlying(token, msg.sender, bsub(balance, oldBalance));\n } else if (balance < oldBalance) {\n // In this case liquidity is being withdrawn, so charge EXIT_FEE\n uint tokenBalanceWithdrawn = bsub(oldBalance, balance);\n uint tokenExitFee = bmul(tokenBalanceWithdrawn, EXIT_FEE);\n _pushUnderlying(token, msg.sender, bsub(tokenBalanceWithdrawn, tokenExitFee));\n _pushUnderlying(token, _factory, tokenExitFee);\n }\n }\n\n function unbind(address token)\n external\n _logs_\n _lock_\n {\n\n require(msg.sender == _controller, \"ERR_NOT_CONTROLLER\");\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n require(!_finalized, \"ERR_IS_FINALIZED\");\n\n uint tokenBalance = _records[token].balance;\n uint tokenExitFee = bmul(tokenBalance, EXIT_FEE);\n\n _totalWeight = bsub(_totalWeight, _records[token].denorm);\n\n // Swap the token-to-unbind with the last token,\n // then delete the last token\n uint index = _records[token].index;\n uint last = _tokens.length - 1;\n _tokens[index] = _tokens[last];\n _records[_tokens[index]].index = index;\n _tokens.pop();\n _records[token] = Record({\n bound: false,\n index: 0,\n denorm: 0,\n balance: 0\n });\n\n _pushUnderlying(token, msg.sender, bsub(tokenBalance, tokenExitFee));\n _pushUnderlying(token, _factory, tokenExitFee);\n }\n\n // Absorb any tokens that have been sent to this contract into the pool\n function gulp(address token)\n external\n _logs_\n _lock_\n {\n require(_records[token].bound, \"ERR_NOT_BOUND\");\n _records[token].balance = IERC20(token).balanceOf(address(this));\n }\n\n function getSpotPrice(address tokenIn, address tokenOut)\n external view\n _viewlock_\n returns (uint spotPrice)\n {\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n Record storage inRecord = _records[tokenIn];\n Record storage outRecord = _records[tokenOut];\n return calcSpotPrice(inRecord.balance, inRecord.denorm, outRecord.balance, outRecord.denorm, _swapFee);\n }\n\n function getSpotPriceSansFee(address tokenIn, address tokenOut)\n external view\n _viewlock_\n returns (uint spotPrice)\n {\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n Record storage inRecord = _records[tokenIn];\n Record storage outRecord = _records[tokenOut];\n return calcSpotPrice(inRecord.balance, inRecord.denorm, outRecord.balance, outRecord.denorm, 0);\n }\n\n function joinPool(uint poolAmountOut, uint[] calldata maxAmountsIn)\n external\n _logs_\n _lock_\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n\n uint poolTotal = totalSupply();\n uint ratio = bdiv(poolAmountOut, poolTotal);\n require(ratio != 0, \"ERR_MATH_APPROX\");\n\n for (uint i = 0; i < _tokens.length; i++) {\n address t = _tokens[i];\n uint bal = _records[t].balance;\n uint tokenAmountIn = bmul(ratio, bal);\n require(tokenAmountIn != 0, \"ERR_MATH_APPROX\");\n require(tokenAmountIn <= maxAmountsIn[i], \"ERR_LIMIT_IN\");\n _records[t].balance = badd(_records[t].balance, tokenAmountIn);\n emit LOG_JOIN(msg.sender, t, tokenAmountIn);\n _pullUnderlying(t, msg.sender, tokenAmountIn);\n }\n _mintPoolShare(poolAmountOut);\n _pushPoolShare(msg.sender, poolAmountOut);\n }\n\n function exitPool(uint poolAmountIn, uint[] calldata minAmountsOut)\n external\n _logs_\n _lock_\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n\n uint poolTotal = totalSupply();\n uint exitFee = bmul(poolAmountIn, EXIT_FEE);\n uint pAiAfterExitFee = bsub(poolAmountIn, exitFee);\n uint ratio = bdiv(pAiAfterExitFee, poolTotal);\n require(ratio != 0, \"ERR_MATH_APPROX\");\n\n _pullPoolShare(msg.sender, poolAmountIn);\n _pushPoolShare(_factory, exitFee);\n _burnPoolShare(pAiAfterExitFee);\n\n for (uint i = 0; i < _tokens.length; i++) {\n address t = _tokens[i];\n uint bal = _records[t].balance;\n uint tokenAmountOut = bmul(ratio, bal);\n require(tokenAmountOut != 0, \"ERR_MATH_APPROX\");\n require(tokenAmountOut >= minAmountsOut[i], \"ERR_LIMIT_OUT\");\n _records[t].balance = bsub(_records[t].balance, tokenAmountOut);\n emit LOG_EXIT(msg.sender, t, tokenAmountOut);\n _pushUnderlying(t, msg.sender, tokenAmountOut);\n }\n\n }\n\n\n function swapExactAmountIn(\n address tokenIn,\n uint tokenAmountIn,\n address tokenOut,\n uint minAmountOut,\n uint maxPrice\n )\n external\n _logs_\n _lock_\n returns (uint tokenAmountOut, uint spotPriceAfter)\n {\n\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n require(_publicSwap, \"ERR_SWAP_NOT_PUBLIC\");\n\n Record storage inRecord = _records[address(tokenIn)];\n Record storage outRecord = _records[address(tokenOut)];\n\n require(tokenAmountIn <= bmul(inRecord.balance, MAX_IN_RATIO), \"ERR_MAX_IN_RATIO\");\n\n uint spotPriceBefore = calcSpotPrice(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n _swapFee\n );\n require(spotPriceBefore <= maxPrice, \"ERR_BAD_LIMIT_PRICE\");\n\n tokenAmountOut = calcOutGivenIn(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n tokenAmountIn,\n _swapFee\n );\n require(tokenAmountOut >= minAmountOut, \"ERR_LIMIT_OUT\");\n\n inRecord.balance = badd(inRecord.balance, tokenAmountIn);\n outRecord.balance = bsub(outRecord.balance, tokenAmountOut);\n\n spotPriceAfter = calcSpotPrice(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n _swapFee\n );\n require(spotPriceAfter >= spotPriceBefore, \"ERR_MATH_APPROX\"); \n require(spotPriceAfter <= maxPrice, \"ERR_LIMIT_PRICE\");\n require(spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut), \"ERR_MATH_APPROX\");\n\n emit LOG_SWAP(msg.sender, tokenIn, tokenOut, tokenAmountIn, tokenAmountOut);\n\n _pullUnderlying(tokenIn, msg.sender, tokenAmountIn);\n _pushUnderlying(tokenOut, msg.sender, tokenAmountOut);\n\n return (tokenAmountOut, spotPriceAfter);\n }\n\n function swapExactAmountOut(\n address tokenIn,\n uint maxAmountIn,\n address tokenOut,\n uint tokenAmountOut,\n uint maxPrice\n )\n external\n _logs_\n _lock_ \n returns (uint tokenAmountIn, uint spotPriceAfter)\n {\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n require(_publicSwap, \"ERR_SWAP_NOT_PUBLIC\");\n\n Record storage inRecord = _records[address(tokenIn)];\n Record storage outRecord = _records[address(tokenOut)];\n\n require(tokenAmountOut <= bmul(outRecord.balance, MAX_OUT_RATIO), \"ERR_MAX_OUT_RATIO\");\n\n uint spotPriceBefore = calcSpotPrice(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n _swapFee\n );\n require(spotPriceBefore <= maxPrice, \"ERR_BAD_LIMIT_PRICE\");\n\n tokenAmountIn = calcInGivenOut(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n tokenAmountOut,\n _swapFee\n );\n require(tokenAmountIn <= maxAmountIn, \"ERR_LIMIT_IN\");\n\n inRecord.balance = badd(inRecord.balance, tokenAmountIn);\n outRecord.balance = bsub(outRecord.balance, tokenAmountOut);\n\n spotPriceAfter = calcSpotPrice(\n inRecord.balance,\n inRecord.denorm,\n outRecord.balance,\n outRecord.denorm,\n _swapFee\n );\n require(spotPriceAfter >= spotPriceBefore, \"ERR_MATH_APPROX\");\n require(spotPriceAfter <= maxPrice, \"ERR_LIMIT_PRICE\");\n require(spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut), \"ERR_MATH_APPROX\");\n\n emit LOG_SWAP(msg.sender, tokenIn, tokenOut, tokenAmountIn, tokenAmountOut);\n\n _pullUnderlying(tokenIn, msg.sender, tokenAmountIn);\n _pushUnderlying(tokenOut, msg.sender, tokenAmountOut);\n\n return (tokenAmountIn, spotPriceAfter);\n }\n\n\n function joinswapExternAmountIn(address tokenIn, uint tokenAmountIn, uint minPoolAmountOut)\n external\n _logs_\n _lock_\n returns (uint poolAmountOut)\n\n { \n require(_finalized, \"ERR_NOT_FINALIZED\");\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n require(tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO), \"ERR_MAX_IN_RATIO\");\n\n Record storage inRecord = _records[tokenIn];\n\n poolAmountOut = calcPoolOutGivenSingleIn(\n inRecord.balance,\n inRecord.denorm,\n _totalSupply,\n _totalWeight,\n tokenAmountIn,\n _swapFee\n );\n\n require(poolAmountOut >= minPoolAmountOut, \"ERR_LIMIT_OUT\");\n\n inRecord.balance = badd(inRecord.balance, tokenAmountIn);\n\n emit LOG_JOIN(msg.sender, tokenIn, tokenAmountIn);\n\n _mintPoolShare(poolAmountOut);\n _pushPoolShare(msg.sender, poolAmountOut);\n _pullUnderlying(tokenIn, msg.sender, tokenAmountIn);\n\n return poolAmountOut;\n }\n\n function joinswapPoolAmountOut(address tokenIn, uint poolAmountOut, uint maxAmountIn)\n external\n _logs_\n _lock_\n returns (uint tokenAmountIn)\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n require(_records[tokenIn].bound, \"ERR_NOT_BOUND\");\n\n Record storage inRecord = _records[tokenIn];\n\n tokenAmountIn = calcSingleInGivenPoolOut(\n inRecord.balance,\n inRecord.denorm,\n _totalSupply,\n _totalWeight,\n poolAmountOut,\n _swapFee\n );\n\n require(tokenAmountIn != 0, \"ERR_MATH_APPROX\");\n require(tokenAmountIn <= maxAmountIn, \"ERR_LIMIT_IN\");\n \n require(tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO), \"ERR_MAX_IN_RATIO\");\n\n inRecord.balance = badd(inRecord.balance, tokenAmountIn);\n\n emit LOG_JOIN(msg.sender, tokenIn, tokenAmountIn);\n\n _mintPoolShare(poolAmountOut);\n _pushPoolShare(msg.sender, poolAmountOut);\n _pullUnderlying(tokenIn, msg.sender, tokenAmountIn);\n\n return tokenAmountIn;\n }\n\n function exitswapPoolAmountIn(address tokenOut, uint poolAmountIn, uint minAmountOut)\n external\n _logs_\n _lock_\n returns (uint tokenAmountOut)\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n\n Record storage outRecord = _records[tokenOut];\n\n tokenAmountOut = calcSingleOutGivenPoolIn(\n outRecord.balance,\n outRecord.denorm,\n _totalSupply,\n _totalWeight,\n poolAmountIn,\n _swapFee\n );\n\n require(tokenAmountOut >= minAmountOut, \"ERR_LIMIT_OUT\");\n \n require(tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO), \"ERR_MAX_OUT_RATIO\");\n\n outRecord.balance = bsub(outRecord.balance, tokenAmountOut);\n\n uint exitFee = bmul(poolAmountIn, EXIT_FEE);\n\n emit LOG_EXIT(msg.sender, tokenOut, tokenAmountOut);\n\n _pullPoolShare(msg.sender, poolAmountIn);\n _burnPoolShare(bsub(poolAmountIn, exitFee));\n _pushPoolShare(_factory, exitFee);\n _pushUnderlying(tokenOut, msg.sender, tokenAmountOut);\n\n return tokenAmountOut;\n }\n\n function exitswapExternAmountOut(address tokenOut, uint tokenAmountOut, uint maxPoolAmountIn)\n external\n _logs_\n _lock_\n returns (uint poolAmountIn)\n {\n require(_finalized, \"ERR_NOT_FINALIZED\");\n require(_records[tokenOut].bound, \"ERR_NOT_BOUND\");\n require(tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO), \"ERR_MAX_OUT_RATIO\");\n\n Record storage outRecord = _records[tokenOut];\n\n poolAmountIn = calcPoolInGivenSingleOut(\n outRecord.balance,\n outRecord.denorm,\n _totalSupply,\n _totalWeight,\n tokenAmountOut,\n _swapFee\n );\n\n require(poolAmountIn != 0, \"ERR_MATH_APPROX\");\n require(poolAmountIn <= maxPoolAmountIn, \"ERR_LIMIT_IN\");\n\n outRecord.balance = bsub(outRecord.balance, tokenAmountOut);\n\n uint exitFee = bmul(poolAmountIn, EXIT_FEE);\n\n emit LOG_EXIT(msg.sender, tokenOut, tokenAmountOut);\n\n _pullPoolShare(msg.sender, poolAmountIn);\n _burnPoolShare(bsub(poolAmountIn, exitFee));\n _pushPoolShare(_factory, exitFee);\n _pushUnderlying(tokenOut, msg.sender, tokenAmountOut); \n\n return poolAmountIn;\n }\n\n\n // ==\n // 'Underlying' token-manipulation functions make external calls but are NOT locked\n // You must `_lock_` or otherwise ensure reentry-safety\n\n function _pullUnderlying(address erc20, address from, uint amount)\n internal\n {\n bool xfer = IERC20(erc20).transferFrom(from, address(this), amount);\n require(xfer, \"ERR_ERC20_FALSE\");\n }\n\n function _pushUnderlying(address erc20, address to, uint amount)\n internal\n {\n bool xfer = IERC20(erc20).transfer(to, amount);\n require(xfer, \"ERR_ERC20_FALSE\");\n }\n\n function _pullPoolShare(address from, uint amount)\n internal\n {\n _pull(from, amount);\n }\n\n function _pushPoolShare(address to, uint amount)\n internal\n {\n _push(to, amount);\n }\n\n function _mintPoolShare(uint amount)\n internal\n {\n _mint(amount);\n }\n\n function _burnPoolShare(uint amount)\n internal\n {\n _burn(amount);\n }\n\n}\n", + "sourcePath": "/ocean/non-ocean/balancer-core/contracts/BPool.sol", + "ast": { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BPool.sol", + "exportedSymbols": { + "BPool": [ + 3473 + ] + }, + "id": 3474, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1306, + "literals": [ + "solidity", + "0.5", + ".12" + ], + "nodeType": "PragmaDirective", + "src": "643:23:5" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BToken.sol", + "file": "./BToken.sol", + "id": 1307, + "nodeType": "ImportDirective", + "scope": 3474, + "sourceUnit": 4047, + "src": "668:22:5", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BMath.sol", + "file": "./BMath.sol", + "id": 1308, + "nodeType": "ImportDirective", + "scope": 3474, + "sourceUnit": 832, + "src": "691:21:5", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1309, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 20, + "src": "732:7:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$20", + "typeString": "contract BBronze" + } + }, + "id": 1310, + "nodeType": "InheritanceSpecifier", + "src": "732:7:5" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1311, + "name": "BToken", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4046, + "src": "741:6:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BToken_$4046", + "typeString": "contract BToken" + } + }, + "id": 1312, + "nodeType": "InheritanceSpecifier", + "src": "741:6:5" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1313, + "name": "BMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 831, + "src": "749:5:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BMath_$831", + "typeString": "contract BMath" + } + }, + "id": 1314, + "nodeType": "InheritanceSpecifier", + "src": "749:5:5" + } + ], + "contractDependencies": [ + 7, + 20, + 108, + 831, + 1304, + 3543, + 3740, + 4046 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 3473, + "linearizedBaseContracts": [ + 3473, + 831, + 4046, + 3543, + 3740, + 1304, + 108, + 20, + 7 + ], + "name": "BPool", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "BPool.Record", + "id": 1323, + "members": [ + { + "constant": false, + "id": 1316, + "name": "bound", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "786:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1315, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "786:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1318, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "834:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1317, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "834:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1320, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "867:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1319, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "867:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1322, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "912:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1321, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "912:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Record", + "nodeType": "StructDefinition", + "scope": 3473, + "src": "762:169:5", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 1335, + "name": "LOG_SWAP", + "nodeType": "EventDefinition", + "parameters": { + "id": 1334, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1325, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "961:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1324, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "961:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1327, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "993:23:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1326, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "993:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1329, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1026:24:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1328, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1026:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1331, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1060:29:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1330, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1060:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1333, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1099:30:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1332, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1099:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "951:184:5" + }, + "src": "937:199:5" + }, + { + "anonymous": false, + "documentation": null, + "id": 1343, + "name": "LOG_JOIN", + "nodeType": "EventDefinition", + "parameters": { + "id": 1342, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1337, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1166:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1336, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1166:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1339, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1198:23:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1338, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1198:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1341, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1231:29:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1340, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1231:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1156:110:5" + }, + "src": "1142:125:5" + }, + { + "anonymous": false, + "documentation": null, + "id": 1351, + "name": "LOG_EXIT", + "nodeType": "EventDefinition", + "parameters": { + "id": 1350, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1345, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1297:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1344, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1297:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1347, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1329:24:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1346, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1329:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1349, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1363:30:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1348, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1363:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1287:112:5" + }, + "src": "1273:127:5" + }, + { + "anonymous": true, + "documentation": null, + "id": 1359, + "name": "LOG_CALL", + "nodeType": "EventDefinition", + "parameters": { + "id": 1358, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1353, + "indexed": true, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1430:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 1352, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "1430:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1355, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1459:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1459:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1357, + "indexed": false, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1491:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1356, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1491:5:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1420:97:5" + }, + "src": "1406:122:5" + }, + { + "body": { + "id": 1371, + "nodeType": "Block", + "src": "1552:72:5", + "statements": [ + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1362, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1576:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sig", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1576:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1364, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1585:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1585:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1366, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1597:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1367, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "data", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1597:8:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 1361, + "name": "LOG_CALL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1359, + "src": "1567:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes4,address,bytes memory)" + } + }, + "id": 1368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1567:39:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1369, + "nodeType": "EmitStatement", + "src": "1562:44:5" + }, + { + "id": 1370, + "nodeType": "PlaceholderStatement", + "src": "1616:1:5" + } + ] + }, + "documentation": null, + "id": 1372, + "name": "_logs_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1360, + "nodeType": "ParameterList", + "parameters": [], + "src": "1549:2:5" + }, + "src": "1534:90:5", + "visibility": "internal" + }, + { + "body": { + "id": 1389, + "nodeType": "Block", + "src": "1648:106:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1376, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1666:7:5", + "subExpression": { + "argumentTypes": null, + "id": 1375, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1667:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 1377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1675:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + }, + "value": "ERR_REENTRY" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + } + ], + "id": 1374, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1658:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1658:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1379, + "nodeType": "ExpressionStatement", + "src": "1658:31:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1380, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1699:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1708:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1699:13:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1383, + "nodeType": "ExpressionStatement", + "src": "1699:13:5" + }, + { + "id": 1384, + "nodeType": "PlaceholderStatement", + "src": "1722:1:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1385, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1733:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1386, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1742:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1733:14:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1388, + "nodeType": "ExpressionStatement", + "src": "1733:14:5" + } + ] + }, + "documentation": null, + "id": 1390, + "name": "_lock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1373, + "nodeType": "ParameterList", + "parameters": [], + "src": "1645:2:5" + }, + "src": "1630:124:5", + "visibility": "internal" + }, + { + "body": { + "id": 1399, + "nodeType": "Block", + "src": "1782:59:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1800:7:5", + "subExpression": { + "argumentTypes": null, + "id": 1393, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1801:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 1395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1809:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + }, + "value": "ERR_REENTRY" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + } + ], + "id": 1392, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1792:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1792:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1397, + "nodeType": "ExpressionStatement", + "src": "1792:31:5" + }, + { + "id": 1398, + "nodeType": "PlaceholderStatement", + "src": "1833:1:5" + } + ] + }, + "documentation": null, + "id": 1400, + "name": "_viewlock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1391, + "nodeType": "ParameterList", + "parameters": [], + "src": "1779:2:5" + }, + "src": "1760:81:5", + "visibility": "internal" + }, + { + "constant": false, + "id": 1402, + "name": "_mutex", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1847:19:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1401, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1847:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1404, + "name": "_factory", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1873:24:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1403, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1406, + "name": "_controller", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1951:27:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1405, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1951:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1408, + "name": "_publicSwap", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2004:24:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1407, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2004:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1410, + "name": "_swapFee", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2188:21:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1409, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2188:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1412, + "name": "_finalized", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2215:23:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1411, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2215:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1415, + "name": "_tokens", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2245:25:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1413, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2245:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1414, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2245:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1419, + "name": "_records", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2276:42:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record)" + }, + "typeName": { + "id": 1418, + "keyType": { + "id": 1416, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2284:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2276:24:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record)" + }, + "valueType": { + "contractScope": null, + "id": 1417, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "2293:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1421, + "name": "_totalWeight", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2324:25:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1420, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2324:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 1446, + "nodeType": "Block", + "src": "2377:157:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1424, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "2387:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1425, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "2401:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2401:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "2387:24:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1428, + "nodeType": "ExpressionStatement", + "src": "2387:24:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1432, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1429, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "2421:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1430, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "2432:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2432:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "2421:21:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1433, + "nodeType": "ExpressionStatement", + "src": "2421:21:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1434, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "2452:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1435, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "2463:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2452:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1437, + "nodeType": "ExpressionStatement", + "src": "2452:18:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1438, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "2480:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2494:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "2480:19:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1441, + "nodeType": "ExpressionStatement", + "src": "2480:19:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1444, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1442, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "2509:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2522:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "2509:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1445, + "nodeType": "ExpressionStatement", + "src": "2509:18:5" + } + ] + }, + "documentation": null, + "id": 1447, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1422, + "nodeType": "ParameterList", + "parameters": [], + "src": "2367:2:5" + }, + "returnParameters": { + "id": 1423, + "nodeType": "ParameterList", + "parameters": [], + "src": "2377:0:5" + }, + "scope": 3473, + "src": "2356:178:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1454, + "nodeType": "Block", + "src": "2613:35:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1452, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "2630:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1451, + "id": 1453, + "nodeType": "Return", + "src": "2623:18:5" + } + ] + }, + "documentation": null, + "id": 1455, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1448, + "nodeType": "ParameterList", + "parameters": [], + "src": "2561:2:5" + }, + "returnParameters": { + "id": 1451, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1450, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1455, + "src": "2603:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1449, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2603:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2602:6:5" + }, + "scope": 3473, + "src": "2540:108:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1462, + "nodeType": "Block", + "src": "2726:34:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1460, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "2743:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1459, + "id": 1461, + "nodeType": "Return", + "src": "2736:17:5" + } + ] + }, + "documentation": null, + "id": 1463, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isFinalized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1456, + "nodeType": "ParameterList", + "parameters": [], + "src": "2674:2:5" + }, + "returnParameters": { + "id": 1459, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1458, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1463, + "src": "2716:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1457, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2716:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2715:6:5" + }, + "scope": 3473, + "src": "2654:106:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1475, + "nodeType": "Block", + "src": "2843:41:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1470, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "2860:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1472, + "indexExpression": { + "argumentTypes": null, + "id": 1471, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1465, + "src": "2869:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2860:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1473, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "2860:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1469, + "id": 1474, + "nodeType": "Return", + "src": "2853:24:5" + } + ] + }, + "documentation": null, + "id": 1476, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBound", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1466, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1465, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 1476, + "src": "2783:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1464, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2783:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2782:11:5" + }, + "returnParameters": { + "id": 1469, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1468, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1476, + "src": "2833:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1467, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2833:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2832:6:5" + }, + "scope": 3473, + "src": "2766:118:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1484, + "nodeType": "Block", + "src": "2964:38:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1481, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "2981:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1482, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2981:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1480, + "id": 1483, + "nodeType": "Return", + "src": "2974:21:5" + } + ] + }, + "documentation": null, + "id": 1485, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNumTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1477, + "nodeType": "ParameterList", + "parameters": [], + "src": "2911:2:5" + }, + "returnParameters": { + "id": 1480, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1479, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1485, + "src": "2953:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1478, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2953:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2952:6:5" + }, + "scope": 3473, + "src": "2890:112:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1495, + "nodeType": "Block", + "src": "3115:31:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1493, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "3132:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1492, + "id": 1494, + "nodeType": "Return", + "src": "3125:14:5" + } + ] + }, + "documentation": null, + "id": 1496, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1488, + "modifierName": { + "argumentTypes": null, + "id": 1487, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3058:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3058:10:5" + } + ], + "name": "getCurrentTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1486, + "nodeType": "ParameterList", + "parameters": [], + "src": "3033:2:5" + }, + "returnParameters": { + "id": 1492, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1491, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1496, + "src": "3086:23:5", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1489, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3086:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1490, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3086:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3085:25:5" + }, + "scope": 3473, + "src": "3008:138:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1511, + "nodeType": "Block", + "src": "3265:81:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1505, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "3283:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 1506, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3295:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 1504, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3275:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3275:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1508, + "nodeType": "ExpressionStatement", + "src": "3275:40:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1509, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "3332:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1503, + "id": 1510, + "nodeType": "Return", + "src": "3325:14:5" + } + ] + }, + "documentation": null, + "id": 1512, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1499, + "modifierName": { + "argumentTypes": null, + "id": 1498, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3208:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3208:10:5" + } + ], + "name": "getFinalTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1497, + "nodeType": "ParameterList", + "parameters": [], + "src": "3175:2:5" + }, + "returnParameters": { + "id": 1503, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1502, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1512, + "src": "3236:23:5", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1500, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3236:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1501, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3236:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3235:25:5" + }, + "scope": 3473, + "src": "3152:194:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1534, + "nodeType": "Block", + "src": "3466:104:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1522, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3485:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1524, + "indexExpression": { + "argumentTypes": null, + "id": 1523, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1514, + "src": "3494:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3485:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1525, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "3485:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1526, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3508:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1521, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3477:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3477:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1528, + "nodeType": "ExpressionStatement", + "src": "3477:47:5" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1529, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3541:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1531, + "indexExpression": { + "argumentTypes": null, + "id": 1530, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1514, + "src": "3550:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3541:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1532, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "3541:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1520, + "id": 1533, + "nodeType": "Return", + "src": "3534:29:5" + } + ] + }, + "documentation": null, + "id": 1535, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1517, + "modifierName": { + "argumentTypes": null, + "id": 1516, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3428:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3428:10:5" + } + ], + "name": "getDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1515, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1514, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1535, + "src": "3383:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1513, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3383:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3382:15:5" + }, + "returnParameters": { + "id": 1520, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1519, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1535, + "src": "3456:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1518, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3456:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3455:6:5" + }, + "scope": 3473, + "src": "3352:218:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1544, + "nodeType": "Block", + "src": "3682:36:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1542, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "3699:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1541, + "id": 1543, + "nodeType": "Return", + "src": "3692:19:5" + } + ] + }, + "documentation": null, + "id": 1545, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1538, + "modifierName": { + "argumentTypes": null, + "id": 1537, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3644:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3644:10:5" + } + ], + "name": "getTotalDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1536, + "nodeType": "ParameterList", + "parameters": [], + "src": "3611:2:5" + }, + "returnParameters": { + "id": 1541, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1540, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1545, + "src": "3672:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1539, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3672:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3671:6:5" + }, + "scope": 3473, + "src": "3576:142:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1574, + "nodeType": "Block", + "src": "3836:154:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1555, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3855:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1557, + "indexExpression": { + "argumentTypes": null, + "id": 1556, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1547, + "src": "3864:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3855:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1558, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "3855:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1559, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3878:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1554, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3847:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3847:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1561, + "nodeType": "ExpressionStatement", + "src": "3847:47:5" + }, + { + "assignments": [ + 1563 + ], + "declarations": [ + { + "constant": false, + "id": 1563, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "3904:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1562, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3904:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1568, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1564, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3918:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1566, + "indexExpression": { + "argumentTypes": null, + "id": 1565, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1547, + "src": "3927:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3918:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1567, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "3918:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3904:36:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1570, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1563, + "src": "3962:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1571, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "3970:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1569, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "3957:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3957:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1553, + "id": 1573, + "nodeType": "Return", + "src": "3950:33:5" + } + ] + }, + "documentation": null, + "id": 1575, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1550, + "modifierName": { + "argumentTypes": null, + "id": 1549, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3798:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3798:10:5" + } + ], + "name": "getNormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1548, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1547, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1575, + "src": "3753:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1546, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3753:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3752:15:5" + }, + "returnParameters": { + "id": 1553, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1552, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1575, + "src": "3826:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1551, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3826:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3825:6:5" + }, + "scope": 3473, + "src": "3724:266:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1597, + "nodeType": "Block", + "src": "4099:105:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1585, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "4118:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1587, + "indexExpression": { + "argumentTypes": null, + "id": 1586, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1577, + "src": "4127:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4118:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1588, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "4118:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1589, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4141:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1584, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4110:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4110:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1591, + "nodeType": "ExpressionStatement", + "src": "4110:47:5" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1592, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "4174:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1594, + "indexExpression": { + "argumentTypes": null, + "id": 1593, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1577, + "src": "4183:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4174:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1595, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "4174:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1583, + "id": 1596, + "nodeType": "Return", + "src": "4167:30:5" + } + ] + }, + "documentation": null, + "id": 1598, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1580, + "modifierName": { + "argumentTypes": null, + "id": 1579, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4061:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4061:10:5" + } + ], + "name": "getBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1577, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1598, + "src": "4016:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1576, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4016:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4015:15:5" + }, + "returnParameters": { + "id": 1583, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1582, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1598, + "src": "4089:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1581, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4089:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4088:6:5" + }, + "scope": 3473, + "src": "3996:208:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1607, + "nodeType": "Block", + "src": "4300:32:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1605, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "4317:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1604, + "id": 1606, + "nodeType": "Return", + "src": "4310:15:5" + } + ] + }, + "documentation": null, + "id": 1608, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1601, + "modifierName": { + "argumentTypes": null, + "id": 1600, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4262:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4262:10:5" + } + ], + "name": "getSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1599, + "nodeType": "ParameterList", + "parameters": [], + "src": "4229:2:5" + }, + "returnParameters": { + "id": 1604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1608, + "src": "4290:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4290:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4289:6:5" + }, + "scope": 3473, + "src": "4210:122:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1617, + "nodeType": "Block", + "src": "4434:35:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1615, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4451:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 1614, + "id": 1616, + "nodeType": "Return", + "src": "4444:18:5" + } + ] + }, + "documentation": null, + "id": 1618, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1611, + "modifierName": { + "argumentTypes": null, + "id": 1610, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4393:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4393:10:5" + } + ], + "name": "getController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1609, + "nodeType": "ParameterList", + "parameters": [], + "src": "4360:2:5" + }, + "returnParameters": { + "id": 1614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1613, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1618, + "src": "4421:7:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1612, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4421:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4420:9:5" + }, + "scope": 3473, + "src": "4338:131:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1659, + "nodeType": "Block", + "src": "4560:256:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4579:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1628, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "4580:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1630, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4592:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1627, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4571:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4571:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1632, + "nodeType": "ExpressionStatement", + "src": "4571:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1634, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "4629:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4629:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1636, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4643:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4629:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1638, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4656:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1633, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4621:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1639, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4621:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1640, + "nodeType": "ExpressionStatement", + "src": "4621:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1642, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4695:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1643, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "4706:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4695:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f464545", + "id": 1645, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4715:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3c95b37766e2e0764ffbea08cf33d7dd980794ea2229cf2b30f9a53dfb48c0a5", + "typeString": "literal_string \"ERR_MIN_FEE\"" + }, + "value": "ERR_MIN_FEE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3c95b37766e2e0764ffbea08cf33d7dd980794ea2229cf2b30f9a53dfb48c0a5", + "typeString": "literal_string \"ERR_MIN_FEE\"" + } + ], + "id": 1641, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4687:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4687:42:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1647, + "nodeType": "ExpressionStatement", + "src": "4687:42:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1649, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4747:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1650, + "name": "MAX_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "4758:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4747:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f464545", + "id": 1652, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4767:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_889e9e6c0c0fb5bbb40eea41a5a6b8208c6005e0eb9ab1570db8ca4038ab2ca2", + "typeString": "literal_string \"ERR_MAX_FEE\"" + }, + "value": "ERR_MAX_FEE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_889e9e6c0c0fb5bbb40eea41a5a6b8208c6005e0eb9ab1570db8ca4038ab2ca2", + "typeString": "literal_string \"ERR_MAX_FEE\"" + } + ], + "id": 1648, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4739:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1653, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4739:42:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1654, + "nodeType": "ExpressionStatement", + "src": "4739:42:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1655, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "4791:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1656, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4802:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4791:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1658, + "nodeType": "ExpressionStatement", + "src": "4791:18:5" + } + ] + }, + "documentation": null, + "id": 1660, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1623, + "modifierName": { + "argumentTypes": null, + "id": 1622, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "4534:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4534:6:5" + }, + { + "arguments": null, + "id": 1625, + "modifierName": { + "argumentTypes": null, + "id": 1624, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "4549:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4549:6:5" + } + ], + "name": "setSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1621, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1620, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 1660, + "src": "4495:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1619, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4495:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4494:14:5" + }, + "returnParameters": { + "id": 1626, + "nodeType": "ParameterList", + "parameters": [], + "src": "4560:0:5" + }, + "scope": 3473, + "src": "4475:341:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1681, + "nodeType": "Block", + "src": "4913:104:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1673, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1670, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "4931:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1671, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4931:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1672, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4945:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4931:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1674, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4958:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1669, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4923:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4923:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1676, + "nodeType": "ExpressionStatement", + "src": "4923:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1677, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4989:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1678, + "name": "manager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1662, + "src": "5003:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4989:21:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1680, + "nodeType": "ExpressionStatement", + "src": "4989:21:5" + } + ] + }, + "documentation": null, + "id": 1682, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1665, + "modifierName": { + "argumentTypes": null, + "id": 1664, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "4887:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4887:6:5" + }, + { + "arguments": null, + "id": 1667, + "modifierName": { + "argumentTypes": null, + "id": 1666, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "4902:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4902:6:5" + } + ], + "name": "setController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1663, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1662, + "name": "manager", + "nodeType": "VariableDeclaration", + "scope": 1682, + "src": "4845:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1661, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4845:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4844:17:5" + }, + "returnParameters": { + "id": 1668, + "nodeType": "ParameterList", + "parameters": [], + "src": "4913:0:5" + }, + "scope": 3473, + "src": "4822:195:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1709, + "nodeType": "Block", + "src": "5111:154:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5129:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1692, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5130:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5142:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1691, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5121:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5121:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1696, + "nodeType": "ExpressionStatement", + "src": "5121:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1701, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1698, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5179:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5179:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1700, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5193:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5179:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1702, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5206:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1697, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5171:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1703, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5171:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1704, + "nodeType": "ExpressionStatement", + "src": "5171:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1705, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "5237:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1706, + "name": "public_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1684, + "src": "5251:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5237:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1708, + "nodeType": "ExpressionStatement", + "src": "5237:21:5" + } + ] + }, + "documentation": null, + "id": 1710, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1687, + "modifierName": { + "argumentTypes": null, + "id": 1686, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5085:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5085:6:5" + }, + { + "arguments": null, + "id": 1689, + "modifierName": { + "argumentTypes": null, + "id": 1688, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "5100:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5100:6:5" + } + ], + "name": "setPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1685, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1684, + "name": "public_", + "nodeType": "VariableDeclaration", + "scope": 1710, + "src": "5046:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1683, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5046:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5045:14:5" + }, + "returnParameters": { + "id": 1690, + "nodeType": "ParameterList", + "parameters": [], + "src": "5111:0:5" + }, + "scope": 3473, + "src": "5023:242:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1757, + "nodeType": "Block", + "src": "5342:347:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1718, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5360:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1719, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5360:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1720, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5374:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5360:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1722, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5387:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1717, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5352:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5352:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1724, + "nodeType": "ExpressionStatement", + "src": "5352:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5426:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1726, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5427:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5439:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1725, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5418:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1729, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5418:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1730, + "nodeType": "ExpressionStatement", + "src": "5418:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1735, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1732, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "5476:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1733, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5476:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1734, + "name": "MIN_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 33, + "src": "5494:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5476:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f544f4b454e53", + "id": 1736, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5512:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e51b2df926e9f13c18594bdf17dd3e1810e2676b7bad834d6cfa8e46bba574a9", + "typeString": "literal_string \"ERR_MIN_TOKENS\"" + }, + "value": "ERR_MIN_TOKENS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e51b2df926e9f13c18594bdf17dd3e1810e2676b7bad834d6cfa8e46bba574a9", + "typeString": "literal_string \"ERR_MIN_TOKENS\"" + } + ], + "id": 1731, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5468:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1737, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5468:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1738, + "nodeType": "ExpressionStatement", + "src": "5468:61:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1739, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5540:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1740, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5553:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "5540:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1742, + "nodeType": "ExpressionStatement", + "src": "5540:17:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1743, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "5567:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5581:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "5567:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1746, + "nodeType": "ExpressionStatement", + "src": "5567:18:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1748, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "5611:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1747, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "5596:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5596:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1750, + "nodeType": "ExpressionStatement", + "src": "5596:32:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1752, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5653:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5653:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1754, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "5665:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1751, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "5638:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 1755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5638:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1756, + "nodeType": "ExpressionStatement", + "src": "5638:44:5" + } + ] + }, + "documentation": null, + "id": 1758, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1713, + "modifierName": { + "argumentTypes": null, + "id": 1712, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5316:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5316:6:5" + }, + { + "arguments": null, + "id": 1715, + "modifierName": { + "argumentTypes": null, + "id": 1714, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "5331:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5331:6:5" + } + ], + "name": "finalize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1711, + "nodeType": "ParameterList", + "parameters": [], + "src": "5288:2:5" + }, + "returnParameters": { + "id": 1716, + "nodeType": "ParameterList", + "parameters": [], + "src": "5342:0:5" + }, + "scope": 3473, + "src": "5271:418:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1824, + "nodeType": "Block", + "src": "5867:542:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1770, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5885:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1771, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5885:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1772, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5899:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5885:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1774, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5912:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1769, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5877:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5877:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1776, + "nodeType": "ExpressionStatement", + "src": "5877:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5951:22:5", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1778, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "5952:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1780, + "indexExpression": { + "argumentTypes": null, + "id": 1779, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "5961:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5952:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1781, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "5952:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f424f554e44", + "id": 1783, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5975:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_29524b4853ebf7d280374d088acc10bd6949cb77e38df49dfa9b02680b8a5f51", + "typeString": "literal_string \"ERR_IS_BOUND\"" + }, + "value": "ERR_IS_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_29524b4853ebf7d280374d088acc10bd6949cb77e38df49dfa9b02680b8a5f51", + "typeString": "literal_string \"ERR_IS_BOUND\"" + } + ], + "id": 1777, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5943:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5943:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1785, + "nodeType": "ExpressionStatement", + "src": "5943:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1788, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6008:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1787, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "6009:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1789, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6021:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1786, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6000:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6000:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1791, + "nodeType": "ExpressionStatement", + "src": "6000:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1793, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6059:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1794, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6059:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1795, + "name": "MAX_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "6076:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6059:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f4b454e53", + "id": 1797, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6094:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2b41476dedca3afde44e68e1abeac58b7cde6712eb701df30a64635f310a23f5", + "typeString": "literal_string \"ERR_MAX_TOKENS\"" + }, + "value": "ERR_MAX_TOKENS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2b41476dedca3afde44e68e1abeac58b7cde6712eb701df30a64635f310a23f5", + "typeString": "literal_string \"ERR_MAX_TOKENS\"" + } + ], + "id": 1792, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6051:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6051:60:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1799, + "nodeType": "ExpressionStatement", + "src": "6051:60:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1800, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6122:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1802, + "indexExpression": { + "argumentTypes": null, + "id": 1801, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6131:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6122:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6168:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1805, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6193:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1806, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6193:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 1807, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6229:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 1808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6296:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1803, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1323, + "src": "6140:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$1323_storage_ptr_$", + "typeString": "type(struct BPool.Record storage pointer)" + } + }, + "id": 1809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "6140:193:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_memory", + "typeString": "struct BPool.Record memory" + } + }, + "src": "6122:211:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1811, + "nodeType": "ExpressionStatement", + "src": "6122:211:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1815, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6356:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1812, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6343:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6343:12:5", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 1816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6343:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1817, + "nodeType": "ExpressionStatement", + "src": "6343:19:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1819, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6379:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1820, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1762, + "src": "6386:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1821, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1764, + "src": "6395:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1818, + "name": "rebind", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1997, + "src": "6372:6:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 1822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6372:30:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1823, + "nodeType": "ExpressionStatement", + "src": "6372:30:5" + } + ] + }, + "documentation": null, + "id": 1825, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1767, + "modifierName": { + "argumentTypes": null, + "id": 1766, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5777:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5777:6:5" + } + ], + "name": "bind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1765, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1760, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5710:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1759, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5710:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1762, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5725:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1761, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1764, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5739:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1763, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5739:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5709:42:5" + }, + "returnParameters": { + "id": 1768, + "nodeType": "ParameterList", + "parameters": [], + "src": "5867:0:5" + }, + "scope": 3473, + "src": "5696:713:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1996, + "nodeType": "Block", + "src": "6522:1496:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1839, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "6541:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1840, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6541:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1841, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "6555:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6541:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1843, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6568:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1838, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6533:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6533:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1845, + "nodeType": "ExpressionStatement", + "src": "6533:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1847, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6607:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1849, + "indexExpression": { + "argumentTypes": null, + "id": 1848, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "6616:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6607:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "6607:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6630:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1846, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6599:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6599:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1853, + "nodeType": "ExpressionStatement", + "src": "6599:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1856, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6664:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1855, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "6665:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1857, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6677:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1854, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6656:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6656:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1859, + "nodeType": "ExpressionStatement", + "src": "6656:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1861, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6715:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1862, + "name": "MIN_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 54, + "src": "6725:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6715:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f574549474854", + "id": 1864, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6737:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8df266f07de77e4ef407edb2fcb3334221f5d37909c32010ecedbd042f2b2362", + "typeString": "literal_string \"ERR_MIN_WEIGHT\"" + }, + "value": "ERR_MIN_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8df266f07de77e4ef407edb2fcb3334221f5d37909c32010ecedbd042f2b2362", + "typeString": "literal_string \"ERR_MIN_WEIGHT\"" + } + ], + "id": 1860, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6707:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6707:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1866, + "nodeType": "ExpressionStatement", + "src": "6707:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1870, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1868, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6772:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1869, + "name": "MAX_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 59, + "src": "6782:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6772:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f574549474854", + "id": 1871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6794:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4443a14e27060659cd754b886a4a9abce56b7a815ac41b5da14580c72eae7f33", + "typeString": "literal_string \"ERR_MAX_WEIGHT\"" + }, + "value": "ERR_MAX_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4443a14e27060659cd754b886a4a9abce56b7a815ac41b5da14580c72eae7f33", + "typeString": "literal_string \"ERR_MAX_WEIGHT\"" + } + ], + "id": 1867, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6764:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6764:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1873, + "nodeType": "ExpressionStatement", + "src": "6764:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1875, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "6829:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1876, + "name": "MIN_BALANCE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 71, + "src": "6840:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6829:22:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f42414c414e4345", + "id": 1878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6853:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_69c7afc4064c1fa740d9fba5145c2c6cfc449ab58df3114718ec5abc7738730c", + "typeString": "literal_string \"ERR_MIN_BALANCE\"" + }, + "value": "ERR_MIN_BALANCE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_69c7afc4064c1fa740d9fba5145c2c6cfc449ab58df3114718ec5abc7738730c", + "typeString": "literal_string \"ERR_MIN_BALANCE\"" + } + ], + "id": 1874, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6821:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1879, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6821:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1880, + "nodeType": "ExpressionStatement", + "src": "6821:50:5" + }, + { + "assignments": [ + 1882 + ], + "declarations": [ + { + "constant": false, + "id": 1882, + "name": "oldWeight", + "nodeType": "VariableDeclaration", + "scope": 1996, + "src": "6927:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1881, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6927:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1887, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1883, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6944:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1885, + "indexExpression": { + "argumentTypes": null, + "id": 1884, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "6953:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6944:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1886, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "6944:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6927:39:5" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1888, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6980:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 1889, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "6989:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6980:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1911, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1909, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7172:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1910, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7181:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7172:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1923, + "nodeType": "IfStatement", + "src": "7168:107:5", + "trueBody": { + "id": 1922, + "nodeType": "Block", + "src": "7192:83:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1912, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7206:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1914, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7226:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1916, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7245:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1917, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7256:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1915, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7240:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1913, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7221:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1919, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7221:43:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7206:58:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1921, + "nodeType": "ExpressionStatement", + "src": "7206:58:5" + } + ] + } + }, + "id": 1924, + "nodeType": "IfStatement", + "src": "6976:299:5", + "trueBody": { + "id": 1908, + "nodeType": "Block", + "src": "7000:162:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1891, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7014:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1893, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7034:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1895, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7053:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1896, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7061:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1894, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7048:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7048:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1892, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "7029:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7029:43:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7014:58:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1900, + "nodeType": "ExpressionStatement", + "src": "7014:58:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1904, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1902, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7094:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1903, + "name": "MAX_TOTAL_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7110:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7094:32:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f54414c5f574549474854", + "id": 1905, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7128:22:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_55ceb599893e4bee215a5c1285d9b5c12334585fcdd4c2c71690e94257494440", + "typeString": "literal_string \"ERR_MAX_TOTAL_WEIGHT\"" + }, + "value": "ERR_MAX_TOTAL_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_55ceb599893e4bee215a5c1285d9b5c12334585fcdd4c2c71690e94257494440", + "typeString": "literal_string \"ERR_MAX_TOTAL_WEIGHT\"" + } + ], + "id": 1901, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "7086:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7086:65:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1907, + "nodeType": "ExpressionStatement", + "src": "7086:65:5" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 1930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1925, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7292:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1927, + "indexExpression": { + "argumentTypes": null, + "id": 1926, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7301:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7292:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1928, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "7292:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1929, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7317:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7292:31:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1931, + "nodeType": "ExpressionStatement", + "src": "7292:31:5" + }, + { + "assignments": [ + 1933 + ], + "declarations": [ + { + "constant": false, + "id": 1933, + "name": "oldBalance", + "nodeType": "VariableDeclaration", + "scope": 1996, + "src": "7396:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1932, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7396:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1938, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1934, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7414:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1936, + "indexExpression": { + "argumentTypes": null, + "id": 1935, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7423:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7414:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1937, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "7414:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7396:41:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1939, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7447:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1941, + "indexExpression": { + "argumentTypes": null, + "id": 1940, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7456:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7447:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1942, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "7447:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1943, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7473:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7447:33:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1945, + "nodeType": "ExpressionStatement", + "src": "7447:33:5" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1946, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7494:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 1947, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7504:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7494:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1960, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7612:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1961, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7622:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7612:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1994, + "nodeType": "IfStatement", + "src": "7608:404:5", + "trueBody": { + "id": 1993, + "nodeType": "Block", + "src": "7634:378:5", + "statements": [ + { + "assignments": [ + 1964 + ], + "declarations": [ + { + "constant": false, + "id": 1964, + "name": "tokenBalanceWithdrawn", + "nodeType": "VariableDeclaration", + "scope": 1993, + "src": "7725:26:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1963, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1969, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1966, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7759:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1967, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7771:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1965, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7754:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7754:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7725:54:5" + }, + { + "assignments": [ + 1971 + ], + "declarations": [ + { + "constant": false, + "id": 1971, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 1993, + "src": "7793:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1970, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7793:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1976, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1973, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1964, + "src": "7818:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1974, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "7841:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1972, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "7813:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1975, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7813:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7793:57:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1978, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7880:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1979, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "7887:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7887:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1982, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1964, + "src": "7904:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1983, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1971, + "src": "7927:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1981, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7899:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7899:41:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1977, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "7864:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7864:77:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1986, + "nodeType": "ExpressionStatement", + "src": "7864:77:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1988, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7971:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1989, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "7978:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1990, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1971, + "src": "7988:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1987, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "7955:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1991, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7955:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1992, + "nodeType": "ExpressionStatement", + "src": "7955:46:5" + } + ] + } + }, + "id": 1995, + "nodeType": "IfStatement", + "src": "7490:522:5", + "trueBody": { + "id": 1959, + "nodeType": "Block", + "src": "7516:86:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1950, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7546:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1951, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "7553:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7553:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1954, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7570:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1955, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7579:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1953, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7565:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1956, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7565:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1949, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "7530:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7530:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1958, + "nodeType": "ExpressionStatement", + "src": "7530:61:5" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1997, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1834, + "modifierName": { + "argumentTypes": null, + "id": 1833, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "6496:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6496:6:5" + }, + { + "arguments": null, + "id": 1836, + "modifierName": { + "argumentTypes": null, + "id": 1835, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "6511:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6511:6:5" + } + ], + "name": "rebind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1832, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1827, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6431:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1826, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6431:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1829, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6446:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1828, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6446:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1831, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6460:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1830, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6460:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6430:42:5" + }, + "returnParameters": { + "id": 1837, + "nodeType": "ParameterList", + "parameters": [], + "src": "6522:0:5" + }, + "scope": 3473, + "src": "6415:1603:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2115, + "nodeType": "Block", + "src": "8106:928:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2007, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "8125:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2008, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8125:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2009, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "8139:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8125:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2011, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8152:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 2006, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8117:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8117:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2013, + "nodeType": "ExpressionStatement", + "src": "8117:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2015, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8191:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2017, + "indexExpression": { + "argumentTypes": null, + "id": 2016, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8200:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8191:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2018, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "8191:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2019, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8214:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2014, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8183:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2021, + "nodeType": "ExpressionStatement", + "src": "8183:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8248:11:5", + "subExpression": { + "argumentTypes": null, + "id": 2023, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "8249:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2025, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8261:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 2022, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8240:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8240:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2027, + "nodeType": "ExpressionStatement", + "src": "8240:40:5" + }, + { + "assignments": [ + 2029 + ], + "declarations": [ + { + "constant": false, + "id": 2029, + "name": "tokenBalance", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8291:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2028, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8291:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2034, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2030, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8311:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2032, + "indexExpression": { + "argumentTypes": null, + "id": 2031, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8320:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8311:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2033, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "8311:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8291:43:5" + }, + { + "assignments": [ + 2036 + ], + "declarations": [ + { + "constant": false, + "id": 2036, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8344:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2035, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8344:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2041, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2038, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2029, + "src": "8369:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2039, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "8383:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2037, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "8364:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2040, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8364:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8344:48:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2042, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "8403:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2044, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "8423:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2045, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8437:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2047, + "indexExpression": { + "argumentTypes": null, + "id": 2046, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8446:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8437:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2048, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "8437:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2043, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "8418:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8418:42:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8403:57:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2051, + "nodeType": "ExpressionStatement", + "src": "8403:57:5" + }, + { + "assignments": [ + 2053 + ], + "declarations": [ + { + "constant": false, + "id": 2053, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8566:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2052, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8566:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2058, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2054, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8579:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2056, + "indexExpression": { + "argumentTypes": null, + "id": 2055, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8588:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8579:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 1318, + "src": "8579:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8566:34:5" + }, + { + "assignments": [ + 2060 + ], + "declarations": [ + { + "constant": false, + "id": 2060, + "name": "last", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8610:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2059, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8610:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2065, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2061, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8622:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8622:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 2063, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8639:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8622:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8610:30:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2072, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2066, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8650:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2068, + "indexExpression": { + "argumentTypes": null, + "id": 2067, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8658:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8650:14:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2069, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8667:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2071, + "indexExpression": { + "argumentTypes": null, + "id": 2070, + "name": "last", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "8675:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8667:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8650:30:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2073, + "nodeType": "ExpressionStatement", + "src": "8650:30:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2074, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8690:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2078, + "indexExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2075, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8699:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2077, + "indexExpression": { + "argumentTypes": null, + "id": 2076, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8707:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8699:14:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8690:24:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2079, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 1318, + "src": "8690:30:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2080, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8723:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8690:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2082, + "nodeType": "ExpressionStatement", + "src": "8690:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2083, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8738:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2085, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "pop", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8738:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypop_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 2086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8738:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2087, + "nodeType": "ExpressionStatement", + "src": "8738:13:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2097, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2088, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8761:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2090, + "indexExpression": { + "argumentTypes": null, + "id": 2089, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8770:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8761:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2092, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8807:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8833:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2094, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8856:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2095, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8880:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 2091, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1323, + "src": "8779:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$1323_storage_ptr_$", + "typeString": "type(struct BPool.Record storage pointer)" + } + }, + "id": 2096, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "8779:113:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_memory", + "typeString": "struct BPool.Record memory" + } + }, + "src": "8761:131:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2098, + "nodeType": "ExpressionStatement", + "src": "8761:131:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2100, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8919:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2101, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "8926:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8926:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2104, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2029, + "src": "8943:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2105, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2036, + "src": "8957:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2103, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "8938:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8938:32:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2099, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "8903:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2107, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8903:68:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2108, + "nodeType": "ExpressionStatement", + "src": "8903:68:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2110, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8997:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2111, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "9004:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2112, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2036, + "src": "9014:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2109, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "8981:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8981:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2114, + "nodeType": "ExpressionStatement", + "src": "8981:46:5" + } + ] + }, + "documentation": null, + "id": 2116, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2002, + "modifierName": { + "argumentTypes": null, + "id": 2001, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "8080:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8080:6:5" + }, + { + "arguments": null, + "id": 2004, + "modifierName": { + "argumentTypes": null, + "id": 2003, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "8095:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8095:6:5" + } + ], + "name": "unbind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2000, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1999, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "8040:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1998, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8040:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8039:15:5" + }, + "returnParameters": { + "id": 2005, + "nodeType": "ParameterList", + "parameters": [], + "src": "8106:0:5" + }, + "scope": 3473, + "src": "8024:1010:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2147, + "nodeType": "Block", + "src": "9196:138:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2126, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9214:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2128, + "indexExpression": { + "argumentTypes": null, + "id": 2127, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9223:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9214:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2129, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9214:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2130, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9237:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2125, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9206:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9206:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2132, + "nodeType": "ExpressionStatement", + "src": "9206:47:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2133, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9263:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2135, + "indexExpression": { + "argumentTypes": null, + "id": 2134, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9272:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9263:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2136, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9263:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2142, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5280, + "src": "9321:4:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 2141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9313:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9313:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2138, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9296:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2137, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "9289:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 2139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9289:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 2140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3504, + "src": "9289:23:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 2144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9289:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9263:64:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2146, + "nodeType": "ExpressionStatement", + "src": "9263:64:5" + } + ] + }, + "documentation": null, + "id": 2148, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2121, + "modifierName": { + "argumentTypes": null, + "id": 2120, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "9170:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9170:6:5" + }, + { + "arguments": null, + "id": 2123, + "modifierName": { + "argumentTypes": null, + "id": 2122, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "9185:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9185:6:5" + } + ], + "name": "gulp", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2119, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2118, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2148, + "src": "9130:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2117, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9130:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9129:15:5" + }, + "returnParameters": { + "id": 2124, + "nodeType": "ParameterList", + "parameters": [], + "src": "9196:0:5" + }, + "scope": 3473, + "src": "9116:218:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2199, + "nodeType": "Block", + "src": "9475:346:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2160, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9493:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2162, + "indexExpression": { + "argumentTypes": null, + "id": 2161, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2150, + "src": "9502:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9493:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2163, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9493:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9518:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2159, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9485:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9485:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2166, + "nodeType": "ExpressionStatement", + "src": "9485:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2168, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9552:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2170, + "indexExpression": { + "argumentTypes": null, + "id": 2169, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2152, + "src": "9561:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9552:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9552:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9578:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2167, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9544:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9544:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2174, + "nodeType": "ExpressionStatement", + "src": "9544:50:5" + }, + { + "assignments": [ + 2176 + ], + "declarations": [ + { + "constant": false, + "id": 2176, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "9604:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2175, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "9604:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2180, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2177, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9630:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2179, + "indexExpression": { + "argumentTypes": null, + "id": 2178, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2150, + "src": "9639:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9630:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9604:43:5" + }, + { + "assignments": [ + 2182 + ], + "declarations": [ + { + "constant": false, + "id": 2182, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "9657:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2181, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "9657:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2186, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2183, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9684:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2185, + "indexExpression": { + "argumentTypes": null, + "id": 2184, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2152, + "src": "9693:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9684:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9657:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2188, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9733:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2189, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9733:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2190, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9751:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2191, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "9751:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2192, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2182, + "src": "9768:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2193, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9768:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2194, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2182, + "src": "9787:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2195, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "9787:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2196, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "9805:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2187, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "9719:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9719:95:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2158, + "id": 2198, + "nodeType": "Return", + "src": "9712:102:5" + } + ] + }, + "documentation": null, + "id": 2200, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2155, + "modifierName": { + "argumentTypes": null, + "id": 2154, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "9427:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9427:10:5" + } + ], + "name": "getSpotPrice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2150, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9362:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2149, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9362:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2152, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9379:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2151, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9379:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9361:35:5" + }, + "returnParameters": { + "id": 2158, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2157, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9455:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2156, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9455:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9454:16:5" + }, + "scope": 3473, + "src": "9340:481:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2251, + "nodeType": "Block", + "src": "9969:339:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2212, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9987:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2214, + "indexExpression": { + "argumentTypes": null, + "id": 2213, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2202, + "src": "9996:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9987:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2215, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9987:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2216, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10012:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2211, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9979:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9979:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2218, + "nodeType": "ExpressionStatement", + "src": "9979:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2220, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10046:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2222, + "indexExpression": { + "argumentTypes": null, + "id": 2221, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2204, + "src": "10055:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10046:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2223, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "10046:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2224, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10072:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2219, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10038:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10038:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2226, + "nodeType": "ExpressionStatement", + "src": "10038:50:5" + }, + { + "assignments": [ + 2228 + ], + "declarations": [ + { + "constant": false, + "id": 2228, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2251, + "src": "10098:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2227, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "10098:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2232, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2229, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10124:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2231, + "indexExpression": { + "argumentTypes": null, + "id": 2230, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2202, + "src": "10133:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10124:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10098:43:5" + }, + { + "assignments": [ + 2234 + ], + "declarations": [ + { + "constant": false, + "id": 2234, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2251, + "src": "10151:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2233, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "10151:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2238, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2235, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10178:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2237, + "indexExpression": { + "argumentTypes": null, + "id": 2236, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2204, + "src": "10187:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10178:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10151:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2240, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2228, + "src": "10227:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2241, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10227:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2242, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2228, + "src": "10245:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2243, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "10245:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2244, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2234, + "src": "10262:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2245, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10262:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2246, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2234, + "src": "10281:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2247, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "10281:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10299:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 2239, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "10213:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10213:88:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2210, + "id": 2250, + "nodeType": "Return", + "src": "10206:95:5" + } + ] + }, + "documentation": null, + "id": 2252, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2207, + "modifierName": { + "argumentTypes": null, + "id": 2206, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "9921:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9921:10:5" + } + ], + "name": "getSpotPriceSansFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2205, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2202, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9856:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2201, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9856:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2204, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9873:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2203, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9855:35:5" + }, + "returnParameters": { + "id": 2210, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2209, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9949:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2208, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9949:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9948:16:5" + }, + "scope": 3473, + "src": "9827:481:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2374, + "nodeType": "Block", + "src": "10433:806:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2265, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "10451:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2266, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10463:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2264, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10443:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10443:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2268, + "nodeType": "ExpressionStatement", + "src": "10443:40:5" + }, + { + "assignments": [ + 2270 + ], + "declarations": [ + { + "constant": false, + "id": 2270, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 2374, + "src": "10494:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2269, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10494:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2273, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2271, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3813, + "src": "10511:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 2272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10511:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10494:30:5" + }, + { + "assignments": [ + 2275 + ], + "declarations": [ + { + "constant": false, + "id": 2275, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 2374, + "src": "10534:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2274, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10534:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2277, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "10552:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2278, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2270, + "src": "10567:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2276, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "10547:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10547:30:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10534:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2282, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2275, + "src": "10595:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2283, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10604:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "10595:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10607:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10587:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10587:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2287, + "nodeType": "ExpressionStatement", + "src": "10587:38:5" + }, + { + "body": { + "id": 2362, + "nodeType": "Block", + "src": "10678:465:5", + "statements": [ + { + "assignments": [ + 2300 + ], + "declarations": [ + { + "constant": false, + "id": 2300, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10692:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2299, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10692:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2304, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2301, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "10704:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2303, + "indexExpression": { + "argumentTypes": null, + "id": 2302, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10712:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10704:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10692:22:5" + }, + { + "assignments": [ + 2306 + ], + "declarations": [ + { + "constant": false, + "id": 2306, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10728:8:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2305, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10728:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2311, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2307, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10739:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2309, + "indexExpression": { + "argumentTypes": null, + "id": 2308, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10748:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10739:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2310, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10739:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10728:30:5" + }, + { + "assignments": [ + 2313 + ], + "declarations": [ + { + "constant": false, + "id": 2313, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10772:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2312, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10772:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2318, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2315, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2275, + "src": "10798:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2316, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2306, + "src": "10805:3:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2314, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "10793:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10793:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10772:37:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2320, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "10831:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10848:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "10831:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2323, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10851:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2319, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10823:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10823:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2325, + "nodeType": "ExpressionStatement", + "src": "10823:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2327, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "10891:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2328, + "name": "maxAmountsIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2257, + "src": "10908:12:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 2330, + "indexExpression": { + "argumentTypes": null, + "id": 2329, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10921:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10908:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10891:32:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 2332, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10925:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 2326, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10883:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10883:57:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2334, + "nodeType": "ExpressionStatement", + "src": "10883:57:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2335, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10954:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2337, + "indexExpression": { + "argumentTypes": null, + "id": 2336, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10963:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10954:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2338, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10954:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2340, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10981:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2342, + "indexExpression": { + "argumentTypes": null, + "id": 2341, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10990:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10981:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2343, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10981:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2344, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11002:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2339, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "10976:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10976:40:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10954:62:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2347, + "nodeType": "ExpressionStatement", + "src": "10954:62:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2349, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11044:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11044:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2351, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "11056:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2352, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11059:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2348, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "11035:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11035:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2354, + "nodeType": "EmitStatement", + "src": "11030:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2356, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "11103:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2357, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11106:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11106:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2359, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11118:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2355, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "11087:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2360, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11087:45:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2361, + "nodeType": "ExpressionStatement", + "src": "11087:45:5" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2292, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10653:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2293, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "10657:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2294, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10657:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10653:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2363, + "initializationExpression": { + "assignments": [ + 2289 + ], + "declarations": [ + { + "constant": false, + "id": 2289, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 2363, + "src": "10641:6:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2288, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10641:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2291, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 2290, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10650:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "10641:10:5" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 2297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10673:3:5", + "subExpression": { + "argumentTypes": null, + "id": 2296, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10673:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2298, + "nodeType": "ExpressionStatement", + "src": "10673:3:5" + }, + "nodeType": "ForStatement", + "src": "10636:507:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2365, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "11167:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2364, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "11152:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11152:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2367, + "nodeType": "ExpressionStatement", + "src": "11152:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2369, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11206:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2370, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11206:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2371, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "11218:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2368, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "11191:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2372, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11191:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2373, + "nodeType": "ExpressionStatement", + "src": "11191:41:5" + } + ] + }, + "documentation": null, + "id": 2375, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2260, + "modifierName": { + "argumentTypes": null, + "id": 2259, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "10407:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10407:6:5" + }, + { + "arguments": null, + "id": 2262, + "modifierName": { + "argumentTypes": null, + "id": 2261, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "10422:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10422:6:5" + } + ], + "name": "joinPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2258, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2254, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2375, + "src": "10332:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2253, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10332:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2257, + "name": "maxAmountsIn", + "nodeType": "VariableDeclaration", + "scope": 2375, + "src": "10352:28:5", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 2255, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10352:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2256, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10352:6:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10331:50:5" + }, + "returnParameters": { + "id": 2263, + "nodeType": "ParameterList", + "parameters": [], + "src": "10433:0:5" + }, + "scope": 3473, + "src": "10314:925:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2516, + "nodeType": "Block", + "src": "11364:975:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2388, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "11382:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11394:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2387, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "11374:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11374:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2391, + "nodeType": "ExpressionStatement", + "src": "11374:40:5" + }, + { + "assignments": [ + 2393 + ], + "declarations": [ + { + "constant": false, + "id": 2393, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11425:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2392, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11425:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2396, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2394, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3813, + "src": "11442:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 2395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11442:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11425:30:5" + }, + { + "assignments": [ + 2398 + ], + "declarations": [ + { + "constant": false, + "id": 2398, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11465:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2397, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11465:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2403, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2400, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11485:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2401, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "11499:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2399, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "11480:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11480:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11465:43:5" + }, + { + "assignments": [ + 2405 + ], + "declarations": [ + { + "constant": false, + "id": 2405, + "name": "pAiAfterExitFee", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11518:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2404, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11518:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2410, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2407, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11546:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2408, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2398, + "src": "11560:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2406, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "11541:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2409, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11541:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11518:50:5" + }, + { + "assignments": [ + 2412 + ], + "declarations": [ + { + "constant": false, + "id": 2412, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11578:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2411, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11578:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2417, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2414, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2405, + "src": "11596:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2415, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2393, + "src": "11613:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2413, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "11591:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11591:32:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11578:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2421, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2419, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2412, + "src": "11641:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2420, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11650:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "11641:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11653:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2418, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "11633:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11633:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2424, + "nodeType": "ExpressionStatement", + "src": "11633:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2426, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11697:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11697:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2428, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11709:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2425, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "11682:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2429, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11682:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2430, + "nodeType": "ExpressionStatement", + "src": "11682:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2432, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "11747:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2433, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2398, + "src": "11757:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2431, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "11732:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11732:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2435, + "nodeType": "ExpressionStatement", + "src": "11732:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2437, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2405, + "src": "11790:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2436, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "11775:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2438, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11775:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2439, + "nodeType": "ExpressionStatement", + "src": "11775:31:5" + }, + { + "body": { + "id": 2514, + "nodeType": "Block", + "src": "11859:473:5", + "statements": [ + { + "assignments": [ + 2452 + ], + "declarations": [ + { + "constant": false, + "id": 2452, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11873:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2451, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2456, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2453, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "11885:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2455, + "indexExpression": { + "argumentTypes": null, + "id": 2454, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11893:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11885:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11873:22:5" + }, + { + "assignments": [ + 2458 + ], + "declarations": [ + { + "constant": false, + "id": 2458, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11909:8:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2457, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11909:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2463, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2459, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "11920:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2461, + "indexExpression": { + "argumentTypes": null, + "id": 2460, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "11929:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11920:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2462, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "11920:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11909:30:5" + }, + { + "assignments": [ + 2465 + ], + "declarations": [ + { + "constant": false, + "id": 2465, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11953:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2464, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11953:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2470, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2467, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2412, + "src": "11980:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2468, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2458, + "src": "11987:3:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2466, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "11975:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11975:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11953:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2474, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2472, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12013:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2473, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12031:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12013:19:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2475, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12034:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2471, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12005:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2476, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12005:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2477, + "nodeType": "ExpressionStatement", + "src": "12005:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2479, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12074:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2480, + "name": "minAmountsOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2380, + "src": "12092:13:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 2482, + "indexExpression": { + "argumentTypes": null, + "id": 2481, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "12106:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12092:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12074:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2484, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12110:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2478, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12066:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12066:60:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2486, + "nodeType": "ExpressionStatement", + "src": "12066:60:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2498, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2487, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12140:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2489, + "indexExpression": { + "argumentTypes": null, + "id": 2488, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12149:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12140:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2490, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12140:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2492, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12167:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2494, + "indexExpression": { + "argumentTypes": null, + "id": 2493, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12176:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12167:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2495, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12167:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2496, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12188:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2491, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "12162:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12162:41:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12140:63:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2499, + "nodeType": "ExpressionStatement", + "src": "12140:63:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2501, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "12231:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12231:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2503, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12243:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2504, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12246:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2500, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "12222:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12222:39:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2506, + "nodeType": "EmitStatement", + "src": "12217:44:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2508, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12291:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2509, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "12294:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12294:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2511, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12306:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2507, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "12275:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2512, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12275:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2513, + "nodeType": "ExpressionStatement", + "src": "12275:46:5" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2444, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11834:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2445, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "11838:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11838:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11834:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2515, + "initializationExpression": { + "assignments": [ + 2441 + ], + "declarations": [ + { + "constant": false, + "id": 2441, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 2515, + "src": "11822:6:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2440, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11822:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2443, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 2442, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11831:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "11822:10:5" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 2449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11854:3:5", + "subExpression": { + "argumentTypes": null, + "id": 2448, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11854:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2450, + "nodeType": "ExpressionStatement", + "src": "11854:3:5" + }, + "nodeType": "ForStatement", + "src": "11817:515:5" + } + ] + }, + "documentation": null, + "id": 2517, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2383, + "modifierName": { + "argumentTypes": null, + "id": 2382, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "11338:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11338:6:5" + }, + { + "arguments": null, + "id": 2385, + "modifierName": { + "argumentTypes": null, + "id": 2384, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "11353:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11353:6:5" + } + ], + "name": "exitPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2381, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2377, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2517, + "src": "11263:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2376, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11263:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2380, + "name": "minAmountsOut", + "nodeType": "VariableDeclaration", + "scope": 2517, + "src": "11282:29:5", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 2378, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11282:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2379, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11282:6:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11262:50:5" + }, + "returnParameters": { + "id": 2386, + "nodeType": "ParameterList", + "parameters": [], + "src": "11364:0:5" + }, + "scope": 3473, + "src": "11245:1094:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2714, + "nodeType": "Block", + "src": "12618:2153:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2539, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12637:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2541, + "indexExpression": { + "argumentTypes": null, + "id": 2540, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "12646:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12637:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2542, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "12637:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2543, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12662:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2538, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12629:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2544, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12629:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2545, + "nodeType": "ExpressionStatement", + "src": "12629:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2547, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12696:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2549, + "indexExpression": { + "argumentTypes": null, + "id": 2548, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "12705:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12696:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2550, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "12696:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2551, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12722:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2546, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12688:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12688:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2553, + "nodeType": "ExpressionStatement", + "src": "12688:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2555, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "12756:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 2556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12769:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + }, + "value": "ERR_SWAP_NOT_PUBLIC" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + } + ], + "id": 2554, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12748:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2557, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12748:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2558, + "nodeType": "ExpressionStatement", + "src": "12748:43:5" + }, + { + "assignments": [ + 2560 + ], + "declarations": [ + { + "constant": false, + "id": 2560, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "12802:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2559, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "12802:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2566, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2561, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12828:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2565, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2563, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "12845:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2562, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12837:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2564, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12837:16:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12828:26:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12802:52:5" + }, + { + "assignments": [ + 2568 + ], + "declarations": [ + { + "constant": false, + "id": 2568, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "12864:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2567, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "12864:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2574, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2569, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12891:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2573, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2571, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "12908:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12900:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12900:17:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12891:27:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12864:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2582, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2576, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "12937:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2578, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "12959:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2579, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12959:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2580, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "12977:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2577, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "12954:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2581, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12954:36:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12937:53:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 2583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12992:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 2575, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12929:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12929:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2585, + "nodeType": "ExpressionStatement", + "src": "12929:82:5" + }, + { + "assignments": [ + 2587 + ], + "declarations": [ + { + "constant": false, + "id": 2587, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "13022:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2586, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13022:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2599, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2589, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13096:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2590, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13096:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2591, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13150:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2592, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13150:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2593, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13203:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2594, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13203:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2595, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13258:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2596, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13258:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2597, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "13312:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2588, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "13045:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2598, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13045:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13022:332:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2601, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "13372:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2602, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2527, + "src": "13391:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13372:27:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 2604, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13401:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + }, + "value": "ERR_BAD_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + } + ], + "id": 2600, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "13364:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13364:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2606, + "nodeType": "ExpressionStatement", + "src": "13364:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2620, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2607, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13434:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2609, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13495:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2610, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13495:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2611, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13541:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2612, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13541:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2613, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13586:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2614, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13586:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2615, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13633:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2616, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13633:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2617, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "13679:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2618, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "13722:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2608, + "name": "calcOutGivenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 396, + "src": "13451:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2619, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13451:305:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13434:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2621, + "nodeType": "ExpressionStatement", + "src": "13434:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2625, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2623, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13774:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2624, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2525, + "src": "13792:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13774:30:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2626, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13806:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2622, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "13766:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2627, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13766:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2628, + "nodeType": "ExpressionStatement", + "src": "13766:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2629, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13833:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2631, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13833:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2633, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13857:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2634, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13857:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2635, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "13875:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2632, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "13852:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13852:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13833:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2638, + "nodeType": "ExpressionStatement", + "src": "13833:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2647, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2639, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13899:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13899:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2643, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13924:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2644, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13924:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2645, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13943:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2642, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "13919:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13919:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13899:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2648, + "nodeType": "ExpressionStatement", + "src": "13899:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2661, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2649, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "13969:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2651, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "14033:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2652, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "14033:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2653, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "14083:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2654, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "14083:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2655, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "14132:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2656, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "14132:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2657, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "14183:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2658, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "14183:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2659, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "14233:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2650, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "13986:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2660, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13986:285:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13969:302:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2662, + "nodeType": "ExpressionStatement", + "src": "13969:302:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2666, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2664, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14289:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2665, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "14307:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14289:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2667, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14324:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2663, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14281:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14281:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2669, + "nodeType": "ExpressionStatement", + "src": "14281:61:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2673, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2671, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14365:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2672, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2527, + "src": "14383:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14365:26:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 2674, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14393:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + }, + "value": "ERR_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + } + ], + "id": 2670, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14357:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14357:54:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2676, + "nodeType": "ExpressionStatement", + "src": "14357:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2678, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "14429:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2680, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14453:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2681, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14468:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2679, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "14448:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14448:35:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14429:54:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14485:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2677, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14421:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14421:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2686, + "nodeType": "ExpressionStatement", + "src": "14421:82:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2688, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14528:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2689, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14528:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2690, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "14540:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2691, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "14549:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2692, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14559:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2693, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14574:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2687, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1335, + "src": "14519:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,uint256,uint256)" + } + }, + "id": 2694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14519:70:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2695, + "nodeType": "EmitStatement", + "src": "14514:75:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2697, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "14616:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2698, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14625:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14625:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2700, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14637:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2696, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "14600:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2701, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14600:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2702, + "nodeType": "ExpressionStatement", + "src": "14600:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2704, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "14677:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2705, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14687:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14687:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2707, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14699:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2703, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "14661:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14661:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2709, + "nodeType": "ExpressionStatement", + "src": "14661:53:5" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 2710, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14733:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2711, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14749:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 2712, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "14732:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 2537, + "id": 2713, + "nodeType": "Return", + "src": "14725:39:5" + } + ] + }, + "documentation": null, + "id": 2715, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2530, + "modifierName": { + "argumentTypes": null, + "id": 2529, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "12533:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12533:6:5" + }, + { + "arguments": null, + "id": 2532, + "modifierName": { + "argumentTypes": null, + "id": 2531, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "12548:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12548:6:5" + } + ], + "name": "swapExactAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2528, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2519, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12382:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2518, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12382:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2521, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12407:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2520, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12407:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2523, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12435:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2522, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12435:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2525, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12461:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2524, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12461:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2527, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12488:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2526, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12488:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12372:135:5" + }, + "returnParameters": { + "id": 2537, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2534, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12572:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12572:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2536, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12593:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2535, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12593:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12571:42:5" + }, + "scope": 3473, + "src": "12346:2425:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2912, + "nodeType": "Block", + "src": "15050:2147:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2737, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15068:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2739, + "indexExpression": { + "argumentTypes": null, + "id": 2738, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "15077:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15068:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2740, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "15068:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2741, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15093:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2736, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15060:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2742, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15060:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2743, + "nodeType": "ExpressionStatement", + "src": "15060:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2745, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15127:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2747, + "indexExpression": { + "argumentTypes": null, + "id": 2746, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "15136:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15127:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2748, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "15127:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2749, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15153:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2744, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15119:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15119:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2751, + "nodeType": "ExpressionStatement", + "src": "15119:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2753, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "15187:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 2754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15200:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + }, + "value": "ERR_SWAP_NOT_PUBLIC" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + } + ], + "id": 2752, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15179:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15179:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2756, + "nodeType": "ExpressionStatement", + "src": "15179:43:5" + }, + { + "assignments": [ + 2758 + ], + "declarations": [ + { + "constant": false, + "id": 2758, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15233:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2757, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "15233:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2764, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2759, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15259:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2763, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2761, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "15276:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2760, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15268:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2762, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15268:16:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15259:26:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15233:52:5" + }, + { + "assignments": [ + 2766 + ], + "declarations": [ + { + "constant": false, + "id": 2766, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15295:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2765, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "15295:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2772, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2767, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15322:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2771, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2769, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "15339:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2768, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15331:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2770, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15331:17:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15322:27:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15295:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2780, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2774, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "15368:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2776, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15391:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15391:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2778, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "15410:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2775, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "15386:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2779, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15386:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15368:56:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 2781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15426:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 2773, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15360:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15360:86:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2783, + "nodeType": "ExpressionStatement", + "src": "15360:86:5" + }, + { + "assignments": [ + 2785 + ], + "declarations": [ + { + "constant": false, + "id": 2785, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15457:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2784, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15457:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2797, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2787, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15531:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2788, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15531:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2789, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15585:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2790, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15585:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2791, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15638:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2792, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15638:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2793, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15693:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2794, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15693:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2795, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "15747:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2786, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "15480:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15480:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15457:332:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2801, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2799, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "15807:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2800, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2725, + "src": "15826:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15807:27:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 2802, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15836:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + }, + "value": "ERR_BAD_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + } + ], + "id": 2798, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15799:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2803, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15799:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2804, + "nodeType": "ExpressionStatement", + "src": "15799:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2805, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "15869:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2807, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15929:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2808, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15929:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2809, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15975:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2810, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15975:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2811, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16020:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2812, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16020:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2813, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16067:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16067:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2815, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16113:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2816, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "16157:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2806, + "name": "calcInGivenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 468, + "src": "15885:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15885:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15869:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2819, + "nodeType": "ExpressionStatement", + "src": "15869:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2823, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2821, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16209:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2822, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2719, + "src": "16226:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16209:28:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 2824, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16239:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 2820, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16201:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16201:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2826, + "nodeType": "ExpressionStatement", + "src": "16201:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2827, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16265:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2829, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16265:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2831, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16289:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2832, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16289:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2833, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16307:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2830, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "16284:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16284:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16265:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2836, + "nodeType": "ExpressionStatement", + "src": "16265:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2837, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16331:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2839, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16331:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2841, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16356:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2842, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16356:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2843, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16375:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2840, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "16351:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16351:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16331:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2846, + "nodeType": "ExpressionStatement", + "src": "16331:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2847, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16401:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2849, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16465:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16465:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2851, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16515:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2852, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16515:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2853, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16564:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2854, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16564:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2855, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16615:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2856, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16615:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2857, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "16665:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2848, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "16418:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16418:285:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16401:302:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2860, + "nodeType": "ExpressionStatement", + "src": "16401:302:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2864, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2862, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16721:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2863, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "16739:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16721:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16756:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2861, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16713:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16713:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2867, + "nodeType": "ExpressionStatement", + "src": "16713:61:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2871, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2869, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16792:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2870, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2725, + "src": "16810:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16792:26:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 2872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16820:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + }, + "value": "ERR_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + } + ], + "id": 2868, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16784:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2873, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16784:54:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2874, + "nodeType": "ExpressionStatement", + "src": "16784:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2881, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2876, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "16856:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2878, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16880:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2879, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16895:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2877, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "16875:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16875:35:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16856:54:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16912:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2875, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16848:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16848:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2884, + "nodeType": "ExpressionStatement", + "src": "16848:82:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2886, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "16955:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2887, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16955:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2888, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "16967:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2889, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "16976:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2890, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16986:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2891, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "17001:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2885, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1335, + "src": "16946:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,uint256,uint256)" + } + }, + "id": 2892, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16946:70:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2893, + "nodeType": "EmitStatement", + "src": "16941:75:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2895, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "17043:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2896, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "17052:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "17052:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2898, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "17064:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2894, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "17027:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17027:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2900, + "nodeType": "ExpressionStatement", + "src": "17027:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2902, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "17104:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2903, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "17114:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2904, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "17114:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2905, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "17126:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2901, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "17088:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17088:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2907, + "nodeType": "ExpressionStatement", + "src": "17088:53:5" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 2908, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "17160:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2909, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "17175:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 2910, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17159:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 2735, + "id": 2911, + "nodeType": "Return", + "src": "17152:38:5" + } + ] + }, + "documentation": null, + "id": 2913, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2728, + "modifierName": { + "argumentTypes": null, + "id": 2727, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "14965:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14965:6:5" + }, + { + "arguments": null, + "id": 2730, + "modifierName": { + "argumentTypes": null, + "id": 2729, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "14980:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14980:6:5" + } + ], + "name": "swapExactAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2726, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2717, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14814:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2716, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14814:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2719, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14839:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2718, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14839:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2721, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14865:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2720, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14865:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2723, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14891:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2722, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14891:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2725, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14920:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2724, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14920:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14804:135:5" + }, + "returnParameters": { + "id": 2735, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2732, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "15005:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2731, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15005:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2734, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "15025:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2733, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15025:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "15004:41:5" + }, + "scope": 3473, + "src": "14777:2420:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3016, + "nodeType": "Block", + "src": "17385:992:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2929, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "17411:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17423:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2928, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17403:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2931, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17403:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2932, + "nodeType": "ExpressionStatement", + "src": "17403:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2934, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17461:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2936, + "indexExpression": { + "argumentTypes": null, + "id": 2935, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17470:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17461:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2937, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "17461:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17486:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2933, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17453:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17453:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2940, + "nodeType": "ExpressionStatement", + "src": "17453:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2942, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "17520:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2944, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17542:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2946, + "indexExpression": { + "argumentTypes": null, + "id": 2945, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17551:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17542:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2947, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "17542:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2948, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "17569:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2943, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "17537:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2949, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17537:45:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17520:62:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 2951, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17584:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 2941, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17512:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17512:91:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2953, + "nodeType": "ExpressionStatement", + "src": "17512:91:5" + }, + { + "assignments": [ + 2955 + ], + "declarations": [ + { + "constant": false, + "id": 2955, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3016, + "src": "17614:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2954, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "17614:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2959, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2956, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17640:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2958, + "indexExpression": { + "argumentTypes": null, + "id": 2957, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17649:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17640:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17614:43:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2960, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "17668:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2962, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "17738:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "17738:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2964, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "17784:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2965, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "17784:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2966, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17829:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2967, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "17871:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2968, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "17913:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2969, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "17956:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2961, + "name": "calcPoolOutGivenSingleIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 550, + "src": "17684:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2970, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17684:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17668:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2972, + "nodeType": "ExpressionStatement", + "src": "17668:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2974, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18009:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2975, + "name": "minPoolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2919, + "src": "18026:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18009:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18044:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2973, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18001:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18001:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2979, + "nodeType": "ExpressionStatement", + "src": "18001:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2980, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "18071:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2982, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18071:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2984, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "18095:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2985, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18095:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2986, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18113:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2983, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "18090:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2987, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18090:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18071:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2989, + "nodeType": "ExpressionStatement", + "src": "18071:56:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2991, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18152:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2992, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18152:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2993, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "18164:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2994, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18173:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2990, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "18143:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18143:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2996, + "nodeType": "EmitStatement", + "src": "18138:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2998, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18213:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2997, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "18198:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18198:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3000, + "nodeType": "ExpressionStatement", + "src": "18198:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3002, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18252:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18252:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3004, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18264:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3001, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "18237:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3005, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18237:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3006, + "nodeType": "ExpressionStatement", + "src": "18237:41:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3008, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "18304:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3009, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18313:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18313:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3011, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18325:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3007, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "18288:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18288:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3013, + "nodeType": "ExpressionStatement", + "src": "18288:51:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3014, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18357:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2927, + "id": 3015, + "nodeType": "Return", + "src": "18350:20:5" + } + ] + }, + "documentation": null, + "id": 3017, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2922, + "modifierName": { + "argumentTypes": null, + "id": 2921, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "17321:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "17321:6:5" + }, + { + "arguments": null, + "id": 2924, + "modifierName": { + "argumentTypes": null, + "id": 2923, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "17336:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "17336:6:5" + } + ], + "name": "joinswapExternAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2920, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2915, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17236:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2914, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17236:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2917, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17253:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2916, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17253:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2919, + "name": "minPoolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17273:21:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2918, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17273:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "17235:60:5" + }, + "returnParameters": { + "id": 2927, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2926, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17360:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2925, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17360:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "17359:20:5" + }, + "scope": 3473, + "src": "17204:1173:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3127, + "nodeType": "Block", + "src": "18557:1043:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3033, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "18575:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3034, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18587:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3032, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18567:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3035, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18567:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3036, + "nodeType": "ExpressionStatement", + "src": "18567:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3038, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "18625:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3040, + "indexExpression": { + "argumentTypes": null, + "id": 3039, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "18634:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18625:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3041, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "18625:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18650:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3037, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18617:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3043, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18617:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3044, + "nodeType": "ExpressionStatement", + "src": "18617:49:5" + }, + { + "assignments": [ + 3046 + ], + "declarations": [ + { + "constant": false, + "id": 3046, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3127, + "src": "18677:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3045, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "18677:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3050, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3047, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "18703:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3049, + "indexExpression": { + "argumentTypes": null, + "id": 3048, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "18712:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18703:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18677:43:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3062, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3051, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "18731:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3053, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "18801:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3054, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18801:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3055, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "18847:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3056, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "18847:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3057, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18892:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3058, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "18934:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3059, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "18976:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3060, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "19019:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3052, + "name": "calcSingleInGivenPoolOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "18747:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3061, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18747:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18731:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3063, + "nodeType": "ExpressionStatement", + "src": "18731:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3065, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19072:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3066, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19089:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "19072:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3068, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19092:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 3064, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19064:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3069, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19064:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3070, + "nodeType": "ExpressionStatement", + "src": "19064:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3074, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3072, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19128:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3073, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3023, + "src": "19145:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19128:28:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3075, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19158:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 3071, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19120:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19120:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3077, + "nodeType": "ExpressionStatement", + "src": "19120:53:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3087, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3079, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19200:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3081, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19222:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3083, + "indexExpression": { + "argumentTypes": null, + "id": 3082, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19231:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19222:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3084, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19222:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3085, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "19249:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3080, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "19217:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19217:45:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19200:62:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19264:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 3078, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19192:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3089, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19192:91:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3090, + "nodeType": "ExpressionStatement", + "src": "19192:91:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3091, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "19294:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3093, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19294:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3095, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "19318:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3096, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19318:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3097, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19336:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3094, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "19313:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3098, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19313:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19294:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3100, + "nodeType": "ExpressionStatement", + "src": "19294:56:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3102, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19375:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19375:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3104, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19387:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3105, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19396:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3101, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "19366:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19366:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3107, + "nodeType": "EmitStatement", + "src": "19361:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3109, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "19436:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3108, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "19421:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19421:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3111, + "nodeType": "ExpressionStatement", + "src": "19421:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3113, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19475:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19475:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3115, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "19487:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3112, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "19460:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19460:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3117, + "nodeType": "ExpressionStatement", + "src": "19460:41:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3119, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19527:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3120, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19536:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19536:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3122, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19548:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3118, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "19511:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3123, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19511:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3124, + "nodeType": "ExpressionStatement", + "src": "19511:51:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3125, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19580:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3031, + "id": 3126, + "nodeType": "Return", + "src": "19573:20:5" + } + ] + }, + "documentation": null, + "id": 3128, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3026, + "modifierName": { + "argumentTypes": null, + "id": 3025, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "18494:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18494:6:5" + }, + { + "arguments": null, + "id": 3028, + "modifierName": { + "argumentTypes": null, + "id": 3027, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "18509:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18509:6:5" + } + ], + "name": "joinswapPoolAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3024, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3019, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18414:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3018, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18414:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3021, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18431:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3020, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18431:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3023, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18451:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3022, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18451:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18413:55:5" + }, + "returnParameters": { + "id": 3031, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3030, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18533:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3029, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18533:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18532:20:5" + }, + "scope": 3473, + "src": "18383:1217:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3246, + "nodeType": "Block", + "src": "19781:1117:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3144, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "19799:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19811:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3143, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19791:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19791:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3147, + "nodeType": "ExpressionStatement", + "src": "19791:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3149, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19849:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3151, + "indexExpression": { + "argumentTypes": null, + "id": 3150, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "19858:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19849:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3152, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "19849:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19875:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3148, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19841:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3154, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19841:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3155, + "nodeType": "ExpressionStatement", + "src": "19841:50:5" + }, + { + "assignments": [ + 3157 + ], + "declarations": [ + { + "constant": false, + "id": 3157, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3246, + "src": "19902:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3156, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "19902:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3161, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3158, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19929:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3160, + "indexExpression": { + "argumentTypes": null, + "id": 3159, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "19938:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19929:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19902:45:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3162, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "19958:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3164, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20029:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3165, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20029:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3166, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20076:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3167, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "20076:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3168, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "20122:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3169, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "20164:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3170, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20206:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3171, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "20248:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3163, + "name": "calcSingleOutGivenPoolIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 734, + "src": "19975:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19975:307:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19958:324:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3174, + "nodeType": "ExpressionStatement", + "src": "19958:324:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3176, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20301:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3177, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "20319:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20301:30:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3179, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20333:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 3175, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "20293:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20293:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3181, + "nodeType": "ExpressionStatement", + "src": "20293:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3183, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20376:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3185, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "20399:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3187, + "indexExpression": { + "argumentTypes": null, + "id": 3186, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20408:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20399:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3188, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20399:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3189, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "20427:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3184, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "20394:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20394:47:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20376:65:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3192, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20443:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 3182, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "20368:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3193, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20368:95:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3194, + "nodeType": "ExpressionStatement", + "src": "20368:95:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3203, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3195, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20474:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20474:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3199, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20499:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3200, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20499:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3201, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20518:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3198, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "20494:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20494:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20474:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3204, + "nodeType": "ExpressionStatement", + "src": "20474:59:5" + }, + { + "assignments": [ + 3206 + ], + "declarations": [ + { + "constant": false, + "id": 3206, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3246, + "src": "20544:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3205, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20544:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3211, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3208, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20564:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3209, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "20578:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3207, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "20559:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20559:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "20544:43:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3213, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20612:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20612:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3215, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20624:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3216, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20634:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3212, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "20603:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20603:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3218, + "nodeType": "EmitStatement", + "src": "20598:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3220, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20675:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20675:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3222, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20687:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3219, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "20660:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20660:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3224, + "nodeType": "ExpressionStatement", + "src": "20660:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3227, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20730:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3228, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3206, + "src": "20744:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3226, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "20725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20725:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3225, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "20710:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20710:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3231, + "nodeType": "ExpressionStatement", + "src": "20710:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3233, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "20778:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3234, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3206, + "src": "20788:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3232, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "20763:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20763:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3236, + "nodeType": "ExpressionStatement", + "src": "20763:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3238, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20822:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3239, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20832:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20832:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3241, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20844:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3237, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "20806:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20806:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3243, + "nodeType": "ExpressionStatement", + "src": "20806:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3244, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20877:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3142, + "id": 3245, + "nodeType": "Return", + "src": "20870:21:5" + } + ] + }, + "documentation": null, + "id": 3247, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3137, + "modifierName": { + "argumentTypes": null, + "id": 3136, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "19717:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19717:6:5" + }, + { + "arguments": null, + "id": 3139, + "modifierName": { + "argumentTypes": null, + "id": 3138, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "19732:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19732:6:5" + } + ], + "name": "exitswapPoolAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3135, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3130, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19636:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3129, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "19636:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3132, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19654:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3131, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19654:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3134, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19673:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3133, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19673:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19635:56:5" + }, + "returnParameters": { + "id": 3142, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3141, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19756:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3140, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19756:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19755:21:5" + }, + "scope": 3473, + "src": "19606:1292:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3372, + "nodeType": "Block", + "src": "21085:1169:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3263, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "21103:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3264, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21115:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3262, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21095:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21095:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3266, + "nodeType": "ExpressionStatement", + "src": "21095:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3268, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21153:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3270, + "indexExpression": { + "argumentTypes": null, + "id": 3269, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21162:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21153:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3271, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "21153:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3272, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21179:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3267, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21145:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21145:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3274, + "nodeType": "ExpressionStatement", + "src": "21145:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3276, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21213:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3278, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21236:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3280, + "indexExpression": { + "argumentTypes": null, + "id": 3279, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21245:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21236:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3281, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21236:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3282, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "21264:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3277, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "21231:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21231:47:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21213:65:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21280:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 3275, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21205:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21205:95:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3287, + "nodeType": "ExpressionStatement", + "src": "21205:95:5" + }, + { + "assignments": [ + 3289 + ], + "declarations": [ + { + "constant": false, + "id": 3289, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3372, + "src": "21311:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3288, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "21311:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3293, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3290, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21338:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3292, + "indexExpression": { + "argumentTypes": null, + "id": 3291, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21347:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21338:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21311:45:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3294, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21367:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3296, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21436:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3297, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21436:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3298, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21483:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3299, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "21483:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3300, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "21529:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3301, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "21571:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3302, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21613:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3303, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "21657:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3295, + "name": "calcPoolInGivenSingleOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 830, + "src": "21382:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3304, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21382:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21367:324:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3306, + "nodeType": "ExpressionStatement", + "src": "21367:324:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3308, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21710:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21726:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "21710:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3311, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21729:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 3307, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21702:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21702:45:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3313, + "nodeType": "ExpressionStatement", + "src": "21702:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3315, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21765:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3316, + "name": "maxPoolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3253, + "src": "21781:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21765:31:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3318, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21798:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 3314, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21757:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21757:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3320, + "nodeType": "ExpressionStatement", + "src": "21757:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3321, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21824:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3323, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21824:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3325, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21849:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3326, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21849:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3327, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21868:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3324, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "21844:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21844:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21824:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3330, + "nodeType": "ExpressionStatement", + "src": "21824:59:5" + }, + { + "assignments": [ + 3332 + ], + "declarations": [ + { + "constant": false, + "id": 3332, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3372, + "src": "21894:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3331, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21894:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3337, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3334, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21914:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3335, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "21928:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3333, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "21909:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21909:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21894:43:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3339, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "21962:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21962:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3341, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21974:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3342, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21984:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3338, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "21953:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21953:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3344, + "nodeType": "EmitStatement", + "src": "21948:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3346, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "22025:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22025:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3348, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22037:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3345, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "22010:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22010:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3350, + "nodeType": "ExpressionStatement", + "src": "22010:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3353, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22080:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3354, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3332, + "src": "22094:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3352, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "22075:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22075:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3351, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "22060:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3356, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22060:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3357, + "nodeType": "ExpressionStatement", + "src": "22060:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3359, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "22128:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3360, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3332, + "src": "22138:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3358, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "22113:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22113:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3362, + "nodeType": "ExpressionStatement", + "src": "22113:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3364, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "22172:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3365, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "22182:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22182:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3367, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "22194:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3363, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "22156:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22156:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3369, + "nodeType": "ExpressionStatement", + "src": "22156:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3370, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22235:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3261, + "id": 3371, + "nodeType": "Return", + "src": "22228:19:5" + } + ] + }, + "documentation": null, + "id": 3373, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3256, + "modifierName": { + "argumentTypes": null, + "id": 3255, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "21023:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21023:6:5" + }, + { + "arguments": null, + "id": 3258, + "modifierName": { + "argumentTypes": null, + "id": 3257, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "21038:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21038:6:5" + } + ], + "name": "exitswapExternAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3254, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3249, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20937:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3248, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20937:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3251, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20955:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3250, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20955:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3253, + "name": "maxPoolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20976:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3252, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20976:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "20936:61:5" + }, + "returnParameters": { + "id": 3261, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3260, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "21062:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3259, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21062:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "21061:19:5" + }, + "scope": 3473, + "src": "20904:1350:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3400, + "nodeType": "Block", + "src": "22508:126:5", + "statements": [ + { + "assignments": [ + 3383 + ], + "declarations": [ + { + "constant": false, + "id": 3383, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 3400, + "src": "22518:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3382, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "22518:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3394, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3388, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3377, + "src": "22557:4:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3390, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5280, + "src": "22571:4:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 3389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "22563:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22563:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3392, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3379, + "src": "22578:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3385, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3375, + "src": "22537:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3384, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "22530:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 3386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22530:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 3387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 3542, + "src": "22530:26:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 3393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22530:55:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22518:67:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3396, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3383, + "src": "22603:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 3397, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22609:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + }, + "value": "ERR_ERC20_FALSE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + } + ], + "id": 3395, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "22595:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22595:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3399, + "nodeType": "ExpressionStatement", + "src": "22595:32:5" + } + ] + }, + "documentation": null, + "id": 3401, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3380, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3375, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22445:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3374, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22445:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3377, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22460:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3376, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22460:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3379, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22474:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3378, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22474:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22444:42:5" + }, + "returnParameters": { + "id": 3381, + "nodeType": "ParameterList", + "parameters": [], + "src": "22508:0:5" + }, + "scope": 3473, + "src": "22420:214:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3425, + "nodeType": "Block", + "src": "22726:105:5", + "statements": [ + { + "assignments": [ + 3411 + ], + "declarations": [ + { + "constant": false, + "id": 3411, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 3425, + "src": "22736:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3410, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "22736:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3419, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3416, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3405, + "src": "22771:2:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3417, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3407, + "src": "22775:6:5", + "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": 3413, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3403, + "src": "22755:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3412, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "22748:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 3414, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22748:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 3415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 3531, + "src": "22748:22:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 3418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22748:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22736:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3421, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3411, + "src": "22800:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 3422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22806:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + }, + "value": "ERR_ERC20_FALSE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + } + ], + "id": 3420, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "22792:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22792:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3424, + "nodeType": "ExpressionStatement", + "src": "22792:32:5" + } + ] + }, + "documentation": null, + "id": 3426, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3408, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3403, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22665:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3402, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22665:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3405, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22680:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3404, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22680:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3407, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22692:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3406, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22692:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22664:40:5" + }, + "returnParameters": { + "id": 3409, + "nodeType": "ParameterList", + "parameters": [], + "src": "22726:0:5" + }, + "scope": 3473, + "src": "22640:191:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3438, + "nodeType": "Block", + "src": "22909:36:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3434, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3428, + "src": "22925:4:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3435, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3430, + "src": "22931:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3433, + "name": "_pull", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3739, + "src": "22919:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22919:19:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3437, + "nodeType": "ExpressionStatement", + "src": "22919:19:5" + } + ] + }, + "documentation": null, + "id": 3439, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3431, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3428, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 3439, + "src": "22861:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3427, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22861:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3430, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3439, + "src": "22875:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3429, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22875:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22860:27:5" + }, + "returnParameters": { + "id": 3432, + "nodeType": "ParameterList", + "parameters": [], + "src": "22909:0:5" + }, + "scope": 3473, + "src": "22837:108:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3451, + "nodeType": "Block", + "src": "23021:34:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3447, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3441, + "src": "23037:2:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3448, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3443, + "src": "23041:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3446, + "name": "_push", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3723, + "src": "23031:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23031:17:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3450, + "nodeType": "ExpressionStatement", + "src": "23031:17:5" + } + ] + }, + "documentation": null, + "id": 3452, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3444, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3441, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 3452, + "src": "22975:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3440, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22975:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3443, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3452, + "src": "22987:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3442, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22987:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22974:25:5" + }, + "returnParameters": { + "id": 3445, + "nodeType": "ParameterList", + "parameters": [], + "src": "23021:0:5" + }, + "scope": 3473, + "src": "22951:104:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3461, + "nodeType": "Block", + "src": "23119:30:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3458, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3454, + "src": "23135:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3457, + "name": "_mint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3611, + "src": "23129:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23129:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3460, + "nodeType": "ExpressionStatement", + "src": "23129:13:5" + } + ] + }, + "documentation": null, + "id": 3462, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_mintPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3455, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3454, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3462, + "src": "23085:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3453, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23085:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23084:13:5" + }, + "returnParameters": { + "id": 3456, + "nodeType": "ParameterList", + "parameters": [], + "src": "23119:0:5" + }, + "scope": 3473, + "src": "23061:88:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3471, + "nodeType": "Block", + "src": "23213:30:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3468, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3464, + "src": "23229:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3467, + "name": "_burn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "23223:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23223:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3470, + "nodeType": "ExpressionStatement", + "src": "23223:13:5" + } + ] + }, + "documentation": null, + "id": 3472, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_burnPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3465, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3464, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3472, + "src": "23179:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3463, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23179:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23178:13:5" + }, + "returnParameters": { + "id": 3466, + "nodeType": "ParameterList", + "parameters": [], + "src": "23213:0:5" + }, + "scope": 3473, + "src": "23155:88:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + } + ], + "scope": 3474, + "src": "714:22532:5" + } + ], + "src": "643:22604:5" + }, + "legacyAST": { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BPool.sol", + "exportedSymbols": { + "BPool": [ + 3473 + ] + }, + "id": 3474, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1306, + "literals": [ + "solidity", + "0.5", + ".12" + ], + "nodeType": "PragmaDirective", + "src": "643:23:5" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BToken.sol", + "file": "./BToken.sol", + "id": 1307, + "nodeType": "ImportDirective", + "scope": 3474, + "sourceUnit": 4047, + "src": "668:22:5", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "/ocean/non-ocean/balancer-core/contracts/BMath.sol", + "file": "./BMath.sol", + "id": 1308, + "nodeType": "ImportDirective", + "scope": 3474, + "sourceUnit": 832, + "src": "691:21:5", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [ + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1309, + "name": "BBronze", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 20, + "src": "732:7:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BBronze_$20", + "typeString": "contract BBronze" + } + }, + "id": 1310, + "nodeType": "InheritanceSpecifier", + "src": "732:7:5" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1311, + "name": "BToken", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 4046, + "src": "741:6:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BToken_$4046", + "typeString": "contract BToken" + } + }, + "id": 1312, + "nodeType": "InheritanceSpecifier", + "src": "741:6:5" + }, + { + "arguments": null, + "baseName": { + "contractScope": null, + "id": 1313, + "name": "BMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 831, + "src": "749:5:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BMath_$831", + "typeString": "contract BMath" + } + }, + "id": 1314, + "nodeType": "InheritanceSpecifier", + "src": "749:5:5" + } + ], + "contractDependencies": [ + 7, + 20, + 108, + 831, + 1304, + 3543, + 3740, + 4046 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 3473, + "linearizedBaseContracts": [ + 3473, + 831, + 4046, + 3543, + 3740, + 1304, + 108, + 20, + 7 + ], + "name": "BPool", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "BPool.Record", + "id": 1323, + "members": [ + { + "constant": false, + "id": 1316, + "name": "bound", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "786:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1315, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "786:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1318, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "834:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1317, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "834:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1320, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "867:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1319, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "867:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1322, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1323, + "src": "912:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1321, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "912:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Record", + "nodeType": "StructDefinition", + "scope": 3473, + "src": "762:169:5", + "visibility": "public" + }, + { + "anonymous": false, + "documentation": null, + "id": 1335, + "name": "LOG_SWAP", + "nodeType": "EventDefinition", + "parameters": { + "id": 1334, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1325, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "961:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1324, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "961:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1327, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "993:23:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1326, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "993:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1329, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1026:24:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1328, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1026:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1331, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1060:29:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1330, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1060:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1333, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 1335, + "src": "1099:30:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1332, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1099:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "951:184:5" + }, + "src": "937:199:5" + }, + { + "anonymous": false, + "documentation": null, + "id": 1343, + "name": "LOG_JOIN", + "nodeType": "EventDefinition", + "parameters": { + "id": 1342, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1337, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1166:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1336, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1166:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1339, + "indexed": true, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1198:23:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1338, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1198:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1341, + "indexed": false, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 1343, + "src": "1231:29:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1340, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1231:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1156:110:5" + }, + "src": "1142:125:5" + }, + { + "anonymous": false, + "documentation": null, + "id": 1351, + "name": "LOG_EXIT", + "nodeType": "EventDefinition", + "parameters": { + "id": 1350, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1345, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1297:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1344, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1297:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1347, + "indexed": true, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1329:24:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1346, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1329:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1349, + "indexed": false, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 1351, + "src": "1363:30:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1348, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1363:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1287:112:5" + }, + "src": "1273:127:5" + }, + { + "anonymous": true, + "documentation": null, + "id": 1359, + "name": "LOG_CALL", + "nodeType": "EventDefinition", + "parameters": { + "id": 1358, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1353, + "indexed": true, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1430:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 1352, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "1430:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1355, + "indexed": true, + "name": "caller", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1459:22:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1354, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1459:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1357, + "indexed": false, + "name": "data", + "nodeType": "VariableDeclaration", + "scope": 1359, + "src": "1491:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 1356, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "1491:5:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1420:97:5" + }, + "src": "1406:122:5" + }, + { + "body": { + "id": 1371, + "nodeType": "Block", + "src": "1552:72:5", + "statements": [ + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1362, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1576:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sig", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1576:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1364, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1585:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1585:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1366, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "1597:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1367, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "data", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1597:8:5", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 1361, + "name": "LOG_CALL", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1359, + "src": "1567:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes_memory_ptr_$returns$__$", + "typeString": "function (bytes4,address,bytes memory)" + } + }, + "id": 1368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1567:39:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1369, + "nodeType": "EmitStatement", + "src": "1562:44:5" + }, + { + "id": 1370, + "nodeType": "PlaceholderStatement", + "src": "1616:1:5" + } + ] + }, + "documentation": null, + "id": 1372, + "name": "_logs_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1360, + "nodeType": "ParameterList", + "parameters": [], + "src": "1549:2:5" + }, + "src": "1534:90:5", + "visibility": "internal" + }, + { + "body": { + "id": 1389, + "nodeType": "Block", + "src": "1648:106:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1376, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1666:7:5", + "subExpression": { + "argumentTypes": null, + "id": 1375, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1667:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 1377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1675:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + }, + "value": "ERR_REENTRY" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + } + ], + "id": 1374, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1658:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1378, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1658:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1379, + "nodeType": "ExpressionStatement", + "src": "1658:31:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1380, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1699:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1708:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "1699:13:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1383, + "nodeType": "ExpressionStatement", + "src": "1699:13:5" + }, + { + "id": 1384, + "nodeType": "PlaceholderStatement", + "src": "1722:1:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1385, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1733:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1386, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1742:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1733:14:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1388, + "nodeType": "ExpressionStatement", + "src": "1733:14:5" + } + ] + }, + "documentation": null, + "id": 1390, + "name": "_lock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1373, + "nodeType": "ParameterList", + "parameters": [], + "src": "1645:2:5" + }, + "src": "1630:124:5", + "visibility": "internal" + }, + { + "body": { + "id": 1399, + "nodeType": "Block", + "src": "1782:59:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "1800:7:5", + "subExpression": { + "argumentTypes": null, + "id": 1393, + "name": "_mutex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1402, + "src": "1801:6:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f5245454e545259", + "id": 1395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1809:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + }, + "value": "ERR_REENTRY" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8186a91a8af60eddd7d544682e1b6922f650fc04d86fd0e4ee40391168ca67e4", + "typeString": "literal_string \"ERR_REENTRY\"" + } + ], + "id": 1392, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "1792:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1792:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1397, + "nodeType": "ExpressionStatement", + "src": "1792:31:5" + }, + { + "id": 1398, + "nodeType": "PlaceholderStatement", + "src": "1833:1:5" + } + ] + }, + "documentation": null, + "id": 1400, + "name": "_viewlock_", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 1391, + "nodeType": "ParameterList", + "parameters": [], + "src": "1779:2:5" + }, + "src": "1760:81:5", + "visibility": "internal" + }, + { + "constant": false, + "id": 1402, + "name": "_mutex", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1847:19:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1401, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1847:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1404, + "name": "_factory", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1873:24:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1403, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1406, + "name": "_controller", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "1951:27:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1405, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1951:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1408, + "name": "_publicSwap", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2004:24:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1407, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2004:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1410, + "name": "_swapFee", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2188:21:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1409, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2188:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1412, + "name": "_finalized", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2215:23:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1411, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2215:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1415, + "name": "_tokens", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2245:25:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1413, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2245:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1414, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2245:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1419, + "name": "_records", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2276:42:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record)" + }, + "typeName": { + "id": 1418, + "keyType": { + "id": 1416, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2284:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2276:24:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record)" + }, + "valueType": { + "contractScope": null, + "id": 1417, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "2293:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + } + }, + "value": null, + "visibility": "private" + }, + { + "constant": false, + "id": 1421, + "name": "_totalWeight", + "nodeType": "VariableDeclaration", + "scope": 3473, + "src": "2324:25:5", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1420, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2324:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "private" + }, + { + "body": { + "id": 1446, + "nodeType": "Block", + "src": "2377:157:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1424, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "2387:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1425, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "2401:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2401:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "2387:24:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1428, + "nodeType": "ExpressionStatement", + "src": "2387:24:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1432, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1429, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "2421:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1430, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "2432:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2432:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "2421:21:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1433, + "nodeType": "ExpressionStatement", + "src": "2421:21:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1434, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "2452:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1435, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "2463:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2452:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1437, + "nodeType": "ExpressionStatement", + "src": "2452:18:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1438, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "2480:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2494:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "2480:19:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1441, + "nodeType": "ExpressionStatement", + "src": "2480:19:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1444, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1442, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "2509:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 1443, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2522:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "2509:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1445, + "nodeType": "ExpressionStatement", + "src": "2509:18:5" + } + ] + }, + "documentation": null, + "id": 1447, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1422, + "nodeType": "ParameterList", + "parameters": [], + "src": "2367:2:5" + }, + "returnParameters": { + "id": 1423, + "nodeType": "ParameterList", + "parameters": [], + "src": "2377:0:5" + }, + "scope": 3473, + "src": "2356:178:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1454, + "nodeType": "Block", + "src": "2613:35:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1452, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "2630:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1451, + "id": 1453, + "nodeType": "Return", + "src": "2623:18:5" + } + ] + }, + "documentation": null, + "id": 1455, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1448, + "nodeType": "ParameterList", + "parameters": [], + "src": "2561:2:5" + }, + "returnParameters": { + "id": 1451, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1450, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1455, + "src": "2603:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1449, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2603:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2602:6:5" + }, + "scope": 3473, + "src": "2540:108:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1462, + "nodeType": "Block", + "src": "2726:34:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1460, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "2743:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1459, + "id": 1461, + "nodeType": "Return", + "src": "2736:17:5" + } + ] + }, + "documentation": null, + "id": 1463, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isFinalized", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1456, + "nodeType": "ParameterList", + "parameters": [], + "src": "2674:2:5" + }, + "returnParameters": { + "id": 1459, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1458, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1463, + "src": "2716:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1457, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2716:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2715:6:5" + }, + "scope": 3473, + "src": "2654:106:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1475, + "nodeType": "Block", + "src": "2843:41:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1470, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "2860:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1472, + "indexExpression": { + "argumentTypes": null, + "id": 1471, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1465, + "src": "2869:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2860:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1473, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "2860:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 1469, + "id": 1474, + "nodeType": "Return", + "src": "2853:24:5" + } + ] + }, + "documentation": null, + "id": 1476, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "isBound", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1466, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1465, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 1476, + "src": "2783:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1464, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2783:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2782:11:5" + }, + "returnParameters": { + "id": 1469, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1468, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1476, + "src": "2833:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1467, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2833:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2832:6:5" + }, + "scope": 3473, + "src": "2766:118:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1484, + "nodeType": "Block", + "src": "2964:38:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1481, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "2981:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1482, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2981:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1480, + "id": 1483, + "nodeType": "Return", + "src": "2974:21:5" + } + ] + }, + "documentation": null, + "id": 1485, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNumTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1477, + "nodeType": "ParameterList", + "parameters": [], + "src": "2911:2:5" + }, + "returnParameters": { + "id": 1480, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1479, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1485, + "src": "2953:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1478, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2953:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2952:6:5" + }, + "scope": 3473, + "src": "2890:112:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1495, + "nodeType": "Block", + "src": "3115:31:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1493, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "3132:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1492, + "id": 1494, + "nodeType": "Return", + "src": "3125:14:5" + } + ] + }, + "documentation": null, + "id": 1496, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1488, + "modifierName": { + "argumentTypes": null, + "id": 1487, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3058:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3058:10:5" + } + ], + "name": "getCurrentTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1486, + "nodeType": "ParameterList", + "parameters": [], + "src": "3033:2:5" + }, + "returnParameters": { + "id": 1492, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1491, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1496, + "src": "3086:23:5", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1489, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3086:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1490, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3086:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3085:25:5" + }, + "scope": 3473, + "src": "3008:138:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1511, + "nodeType": "Block", + "src": "3265:81:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1505, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "3283:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 1506, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3295:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 1504, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3275:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3275:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1508, + "nodeType": "ExpressionStatement", + "src": "3275:40:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1509, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "3332:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1503, + "id": 1510, + "nodeType": "Return", + "src": "3325:14:5" + } + ] + }, + "documentation": null, + "id": 1512, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1499, + "modifierName": { + "argumentTypes": null, + "id": 1498, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3208:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3208:10:5" + } + ], + "name": "getFinalTokens", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1497, + "nodeType": "ParameterList", + "parameters": [], + "src": "3175:2:5" + }, + "returnParameters": { + "id": 1503, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1502, + "name": "tokens", + "nodeType": "VariableDeclaration", + "scope": 1512, + "src": "3236:23:5", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1500, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3236:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1501, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3236:9:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3235:25:5" + }, + "scope": 3473, + "src": "3152:194:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1534, + "nodeType": "Block", + "src": "3466:104:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1522, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3485:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1524, + "indexExpression": { + "argumentTypes": null, + "id": 1523, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1514, + "src": "3494:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3485:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1525, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "3485:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1526, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3508:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1521, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3477:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3477:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1528, + "nodeType": "ExpressionStatement", + "src": "3477:47:5" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1529, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3541:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1531, + "indexExpression": { + "argumentTypes": null, + "id": 1530, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1514, + "src": "3550:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3541:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1532, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "3541:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1520, + "id": 1533, + "nodeType": "Return", + "src": "3534:29:5" + } + ] + }, + "documentation": null, + "id": 1535, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1517, + "modifierName": { + "argumentTypes": null, + "id": 1516, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3428:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3428:10:5" + } + ], + "name": "getDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1515, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1514, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1535, + "src": "3383:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1513, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3383:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3382:15:5" + }, + "returnParameters": { + "id": 1520, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1519, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1535, + "src": "3456:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1518, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3456:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3455:6:5" + }, + "scope": 3473, + "src": "3352:218:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1544, + "nodeType": "Block", + "src": "3682:36:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1542, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "3699:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1541, + "id": 1543, + "nodeType": "Return", + "src": "3692:19:5" + } + ] + }, + "documentation": null, + "id": 1545, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1538, + "modifierName": { + "argumentTypes": null, + "id": 1537, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3644:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3644:10:5" + } + ], + "name": "getTotalDenormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1536, + "nodeType": "ParameterList", + "parameters": [], + "src": "3611:2:5" + }, + "returnParameters": { + "id": 1541, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1540, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1545, + "src": "3672:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1539, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3672:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3671:6:5" + }, + "scope": 3473, + "src": "3576:142:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1574, + "nodeType": "Block", + "src": "3836:154:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1555, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3855:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1557, + "indexExpression": { + "argumentTypes": null, + "id": 1556, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1547, + "src": "3864:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3855:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1558, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "3855:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1559, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3878:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1554, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "3847:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1560, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3847:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1561, + "nodeType": "ExpressionStatement", + "src": "3847:47:5" + }, + { + "assignments": [ + 1563 + ], + "declarations": [ + { + "constant": false, + "id": 1563, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1574, + "src": "3904:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1562, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3904:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1568, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1564, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "3918:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1566, + "indexExpression": { + "argumentTypes": null, + "id": 1565, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1547, + "src": "3927:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3918:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1567, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "3918:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3904:36:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1570, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1563, + "src": "3962:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1571, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "3970:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1569, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "3957:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3957:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1553, + "id": 1573, + "nodeType": "Return", + "src": "3950:33:5" + } + ] + }, + "documentation": null, + "id": 1575, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1550, + "modifierName": { + "argumentTypes": null, + "id": 1549, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "3798:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "3798:10:5" + } + ], + "name": "getNormalizedWeight", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1548, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1547, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1575, + "src": "3753:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1546, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3753:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3752:15:5" + }, + "returnParameters": { + "id": 1553, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1552, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1575, + "src": "3826:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1551, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "3826:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3825:6:5" + }, + "scope": 3473, + "src": "3724:266:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1597, + "nodeType": "Block", + "src": "4099:105:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1585, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "4118:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1587, + "indexExpression": { + "argumentTypes": null, + "id": 1586, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1577, + "src": "4127:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4118:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1588, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "4118:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1589, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4141:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1584, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4110:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4110:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1591, + "nodeType": "ExpressionStatement", + "src": "4110:47:5" + }, + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1592, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "4174:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1594, + "indexExpression": { + "argumentTypes": null, + "id": 1593, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1577, + "src": "4183:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4174:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1595, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "4174:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1583, + "id": 1596, + "nodeType": "Return", + "src": "4167:30:5" + } + ] + }, + "documentation": null, + "id": 1598, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1580, + "modifierName": { + "argumentTypes": null, + "id": 1579, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4061:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4061:10:5" + } + ], + "name": "getBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1578, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1577, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1598, + "src": "4016:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1576, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4016:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4015:15:5" + }, + "returnParameters": { + "id": 1583, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1582, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1598, + "src": "4089:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1581, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4089:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4088:6:5" + }, + "scope": 3473, + "src": "3996:208:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1607, + "nodeType": "Block", + "src": "4300:32:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1605, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "4317:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 1604, + "id": 1606, + "nodeType": "Return", + "src": "4310:15:5" + } + ] + }, + "documentation": null, + "id": 1608, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1601, + "modifierName": { + "argumentTypes": null, + "id": 1600, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4262:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4262:10:5" + } + ], + "name": "getSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1599, + "nodeType": "ParameterList", + "parameters": [], + "src": "4229:2:5" + }, + "returnParameters": { + "id": 1604, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1603, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1608, + "src": "4290:4:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1602, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4290:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4289:6:5" + }, + "scope": 3473, + "src": "4210:122:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1617, + "nodeType": "Block", + "src": "4434:35:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1615, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4451:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 1614, + "id": 1616, + "nodeType": "Return", + "src": "4444:18:5" + } + ] + }, + "documentation": null, + "id": 1618, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1611, + "modifierName": { + "argumentTypes": null, + "id": 1610, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "4393:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4393:10:5" + } + ], + "name": "getController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1609, + "nodeType": "ParameterList", + "parameters": [], + "src": "4360:2:5" + }, + "returnParameters": { + "id": 1614, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1613, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 1618, + "src": "4421:7:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1612, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4421:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4420:9:5" + }, + "scope": 3473, + "src": "4338:131:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1659, + "nodeType": "Block", + "src": "4560:256:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1629, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "4579:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1628, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "4580:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1630, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4592:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1627, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4571:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4571:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1632, + "nodeType": "ExpressionStatement", + "src": "4571:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1634, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "4629:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4629:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1636, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4643:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4629:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1638, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4656:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1633, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4621:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1639, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4621:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1640, + "nodeType": "ExpressionStatement", + "src": "4621:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1644, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1642, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4695:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1643, + "name": "MIN_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "4706:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4695:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f464545", + "id": 1645, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4715:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3c95b37766e2e0764ffbea08cf33d7dd980794ea2229cf2b30f9a53dfb48c0a5", + "typeString": "literal_string \"ERR_MIN_FEE\"" + }, + "value": "ERR_MIN_FEE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3c95b37766e2e0764ffbea08cf33d7dd980794ea2229cf2b30f9a53dfb48c0a5", + "typeString": "literal_string \"ERR_MIN_FEE\"" + } + ], + "id": 1641, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4687:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4687:42:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1647, + "nodeType": "ExpressionStatement", + "src": "4687:42:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1651, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1649, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4747:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1650, + "name": "MAX_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 48, + "src": "4758:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4747:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f464545", + "id": 1652, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4767:13:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_889e9e6c0c0fb5bbb40eea41a5a6b8208c6005e0eb9ab1570db8ca4038ab2ca2", + "typeString": "literal_string \"ERR_MAX_FEE\"" + }, + "value": "ERR_MAX_FEE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_889e9e6c0c0fb5bbb40eea41a5a6b8208c6005e0eb9ab1570db8ca4038ab2ca2", + "typeString": "literal_string \"ERR_MAX_FEE\"" + } + ], + "id": 1648, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4739:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1653, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4739:42:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1654, + "nodeType": "ExpressionStatement", + "src": "4739:42:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1657, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1655, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "4791:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1656, + "name": "swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1620, + "src": "4802:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4791:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1658, + "nodeType": "ExpressionStatement", + "src": "4791:18:5" + } + ] + }, + "documentation": null, + "id": 1660, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1623, + "modifierName": { + "argumentTypes": null, + "id": 1622, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "4534:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4534:6:5" + }, + { + "arguments": null, + "id": 1625, + "modifierName": { + "argumentTypes": null, + "id": 1624, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "4549:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4549:6:5" + } + ], + "name": "setSwapFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1621, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1620, + "name": "swapFee", + "nodeType": "VariableDeclaration", + "scope": 1660, + "src": "4495:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1619, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4495:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4494:14:5" + }, + "returnParameters": { + "id": 1626, + "nodeType": "ParameterList", + "parameters": [], + "src": "4560:0:5" + }, + "scope": 3473, + "src": "4475:341:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1681, + "nodeType": "Block", + "src": "4913:104:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1673, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1670, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "4931:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1671, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4931:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1672, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4945:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4931:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1674, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4958:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1669, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "4923:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4923:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1676, + "nodeType": "ExpressionStatement", + "src": "4923:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1679, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1677, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "4989:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1678, + "name": "manager", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1662, + "src": "5003:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "4989:21:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1680, + "nodeType": "ExpressionStatement", + "src": "4989:21:5" + } + ] + }, + "documentation": null, + "id": 1682, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1665, + "modifierName": { + "argumentTypes": null, + "id": 1664, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "4887:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4887:6:5" + }, + { + "arguments": null, + "id": 1667, + "modifierName": { + "argumentTypes": null, + "id": 1666, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "4902:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "4902:6:5" + } + ], + "name": "setController", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1663, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1662, + "name": "manager", + "nodeType": "VariableDeclaration", + "scope": 1682, + "src": "4845:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1661, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4845:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4844:17:5" + }, + "returnParameters": { + "id": 1668, + "nodeType": "ParameterList", + "parameters": [], + "src": "4913:0:5" + }, + "scope": 3473, + "src": "4822:195:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1709, + "nodeType": "Block", + "src": "5111:154:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5129:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1692, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5130:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5142:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1691, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5121:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5121:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1696, + "nodeType": "ExpressionStatement", + "src": "5121:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1701, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1698, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5179:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5179:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1700, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5193:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5179:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1702, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5206:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1697, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5171:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1703, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5171:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1704, + "nodeType": "ExpressionStatement", + "src": "5171:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1707, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1705, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "5237:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1706, + "name": "public_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1684, + "src": "5251:7:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "5237:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1708, + "nodeType": "ExpressionStatement", + "src": "5237:21:5" + } + ] + }, + "documentation": null, + "id": 1710, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1687, + "modifierName": { + "argumentTypes": null, + "id": 1686, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5085:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5085:6:5" + }, + { + "arguments": null, + "id": 1689, + "modifierName": { + "argumentTypes": null, + "id": 1688, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "5100:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5100:6:5" + } + ], + "name": "setPublicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1685, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1684, + "name": "public_", + "nodeType": "VariableDeclaration", + "scope": 1710, + "src": "5046:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1683, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "5046:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5045:14:5" + }, + "returnParameters": { + "id": 1690, + "nodeType": "ParameterList", + "parameters": [], + "src": "5111:0:5" + }, + "scope": 3473, + "src": "5023:242:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1757, + "nodeType": "Block", + "src": "5342:347:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1721, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1718, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5360:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1719, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5360:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1720, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5374:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5360:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1722, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5387:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1717, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5352:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1723, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5352:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1724, + "nodeType": "ExpressionStatement", + "src": "5352:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5426:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1726, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5427:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1728, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5439:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1725, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5418:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1729, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5418:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1730, + "nodeType": "ExpressionStatement", + "src": "5418:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1735, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1732, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "5476:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1733, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5476:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1734, + "name": "MIN_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 33, + "src": "5494:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5476:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f544f4b454e53", + "id": 1736, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5512:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e51b2df926e9f13c18594bdf17dd3e1810e2676b7bad834d6cfa8e46bba574a9", + "typeString": "literal_string \"ERR_MIN_TOKENS\"" + }, + "value": "ERR_MIN_TOKENS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e51b2df926e9f13c18594bdf17dd3e1810e2676b7bad834d6cfa8e46bba574a9", + "typeString": "literal_string \"ERR_MIN_TOKENS\"" + } + ], + "id": 1731, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5468:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1737, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5468:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1738, + "nodeType": "ExpressionStatement", + "src": "5468:61:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1741, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1739, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "5540:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1740, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5553:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "5540:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1742, + "nodeType": "ExpressionStatement", + "src": "5540:17:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1743, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "5567:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5581:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "5567:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1746, + "nodeType": "ExpressionStatement", + "src": "5567:18:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1748, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "5611:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1747, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "5596:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1749, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5596:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1750, + "nodeType": "ExpressionStatement", + "src": "5596:32:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1752, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5653:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5653:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1754, + "name": "INIT_POOL_SUPPLY", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "5665:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1751, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "5638:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 1755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5638:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1756, + "nodeType": "ExpressionStatement", + "src": "5638:44:5" + } + ] + }, + "documentation": null, + "id": 1758, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1713, + "modifierName": { + "argumentTypes": null, + "id": 1712, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5316:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5316:6:5" + }, + { + "arguments": null, + "id": 1715, + "modifierName": { + "argumentTypes": null, + "id": 1714, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "5331:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5331:6:5" + } + ], + "name": "finalize", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1711, + "nodeType": "ParameterList", + "parameters": [], + "src": "5288:2:5" + }, + "returnParameters": { + "id": 1716, + "nodeType": "ParameterList", + "parameters": [], + "src": "5342:0:5" + }, + "scope": 3473, + "src": "5271:418:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1824, + "nodeType": "Block", + "src": "5867:542:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1773, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1770, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "5885:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1771, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5885:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1772, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "5899:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5885:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1774, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5912:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1769, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5877:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5877:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1776, + "nodeType": "ExpressionStatement", + "src": "5877:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "5951:22:5", + "subExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1778, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "5952:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1780, + "indexExpression": { + "argumentTypes": null, + "id": 1779, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "5961:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5952:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1781, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "5952:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f424f554e44", + "id": 1783, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5975:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_29524b4853ebf7d280374d088acc10bd6949cb77e38df49dfa9b02680b8a5f51", + "typeString": "literal_string \"ERR_IS_BOUND\"" + }, + "value": "ERR_IS_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_29524b4853ebf7d280374d088acc10bd6949cb77e38df49dfa9b02680b8a5f51", + "typeString": "literal_string \"ERR_IS_BOUND\"" + } + ], + "id": 1777, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "5943:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1784, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5943:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1785, + "nodeType": "ExpressionStatement", + "src": "5943:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1788, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6008:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1787, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "6009:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1789, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6021:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1786, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6000:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1790, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6000:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1791, + "nodeType": "ExpressionStatement", + "src": "6000:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1793, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6059:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1794, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6059:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1795, + "name": "MAX_BOUND_TOKENS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "6076:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6059:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f4b454e53", + "id": 1797, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6094:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_2b41476dedca3afde44e68e1abeac58b7cde6712eb701df30a64635f310a23f5", + "typeString": "literal_string \"ERR_MAX_TOKENS\"" + }, + "value": "ERR_MAX_TOKENS" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_2b41476dedca3afde44e68e1abeac58b7cde6712eb701df30a64635f310a23f5", + "typeString": "literal_string \"ERR_MAX_TOKENS\"" + } + ], + "id": 1792, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6051:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1798, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6051:60:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1799, + "nodeType": "ExpressionStatement", + "src": "6051:60:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1810, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1800, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6122:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1802, + "indexExpression": { + "argumentTypes": null, + "id": 1801, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6131:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6122:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "74727565", + "id": 1804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6168:4:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1805, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6193:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1806, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6193:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 1807, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6229:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 1808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6296:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1803, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1323, + "src": "6140:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$1323_storage_ptr_$", + "typeString": "type(struct BPool.Record storage pointer)" + } + }, + "id": 1809, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "6140:193:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_memory", + "typeString": "struct BPool.Record memory" + } + }, + "src": "6122:211:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1811, + "nodeType": "ExpressionStatement", + "src": "6122:211:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1815, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6356:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "id": 1812, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "6343:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 1814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6343:12:5", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 1816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6343:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1817, + "nodeType": "ExpressionStatement", + "src": "6343:19:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1819, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1760, + "src": "6379:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1820, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1762, + "src": "6386:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1821, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1764, + "src": "6395:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1818, + "name": "rebind", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1997, + "src": "6372:6:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256,uint256)" + } + }, + "id": 1822, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6372:30:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1823, + "nodeType": "ExpressionStatement", + "src": "6372:30:5" + } + ] + }, + "documentation": null, + "id": 1825, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1767, + "modifierName": { + "argumentTypes": null, + "id": 1766, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "5777:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "5777:6:5" + } + ], + "name": "bind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1765, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1760, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5710:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1759, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5710:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1762, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5725:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1761, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1764, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1825, + "src": "5739:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1763, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5739:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5709:42:5" + }, + "returnParameters": { + "id": 1768, + "nodeType": "ParameterList", + "parameters": [], + "src": "5867:0:5" + }, + "scope": 3473, + "src": "5696:713:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 1996, + "nodeType": "Block", + "src": "6522:1496:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 1842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1839, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "6541:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1840, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6541:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 1841, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "6555:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6541:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 1843, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6568:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 1838, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6533:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6533:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1845, + "nodeType": "ExpressionStatement", + "src": "6533:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1847, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6607:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1849, + "indexExpression": { + "argumentTypes": null, + "id": 1848, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "6616:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6607:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "6607:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 1851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6630:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 1846, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6599:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6599:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1853, + "nodeType": "ExpressionStatement", + "src": "6599:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1856, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "6664:11:5", + "subExpression": { + "argumentTypes": null, + "id": 1855, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "6665:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 1857, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6677:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 1854, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6656:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6656:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1859, + "nodeType": "ExpressionStatement", + "src": "6656:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1863, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1861, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6715:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1862, + "name": "MIN_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 54, + "src": "6725:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6715:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f574549474854", + "id": 1864, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6737:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8df266f07de77e4ef407edb2fcb3334221f5d37909c32010ecedbd042f2b2362", + "typeString": "literal_string \"ERR_MIN_WEIGHT\"" + }, + "value": "ERR_MIN_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8df266f07de77e4ef407edb2fcb3334221f5d37909c32010ecedbd042f2b2362", + "typeString": "literal_string \"ERR_MIN_WEIGHT\"" + } + ], + "id": 1860, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6707:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6707:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1866, + "nodeType": "ExpressionStatement", + "src": "6707:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1870, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1868, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6772:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1869, + "name": "MAX_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 59, + "src": "6782:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6772:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f574549474854", + "id": 1871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6794:16:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4443a14e27060659cd754b886a4a9abce56b7a815ac41b5da14580c72eae7f33", + "typeString": "literal_string \"ERR_MAX_WEIGHT\"" + }, + "value": "ERR_MAX_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4443a14e27060659cd754b886a4a9abce56b7a815ac41b5da14580c72eae7f33", + "typeString": "literal_string \"ERR_MAX_WEIGHT\"" + } + ], + "id": 1867, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6764:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6764:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1873, + "nodeType": "ExpressionStatement", + "src": "6764:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1877, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1875, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "6829:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 1876, + "name": "MIN_BALANCE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 71, + "src": "6840:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6829:22:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d494e5f42414c414e4345", + "id": 1878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6853:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_69c7afc4064c1fa740d9fba5145c2c6cfc449ab58df3114718ec5abc7738730c", + "typeString": "literal_string \"ERR_MIN_BALANCE\"" + }, + "value": "ERR_MIN_BALANCE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_69c7afc4064c1fa740d9fba5145c2c6cfc449ab58df3114718ec5abc7738730c", + "typeString": "literal_string \"ERR_MIN_BALANCE\"" + } + ], + "id": 1874, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "6821:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1879, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6821:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1880, + "nodeType": "ExpressionStatement", + "src": "6821:50:5" + }, + { + "assignments": [ + 1882 + ], + "declarations": [ + { + "constant": false, + "id": 1882, + "name": "oldWeight", + "nodeType": "VariableDeclaration", + "scope": 1996, + "src": "6927:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1881, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6927:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1887, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1883, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "6944:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1885, + "indexExpression": { + "argumentTypes": null, + "id": 1884, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "6953:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6944:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1886, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "6944:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6927:39:5" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1890, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1888, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "6980:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 1889, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "6989:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6980:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1911, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1909, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7172:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1910, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7181:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7172:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1923, + "nodeType": "IfStatement", + "src": "7168:107:5", + "trueBody": { + "id": 1922, + "nodeType": "Block", + "src": "7192:83:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1920, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1912, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7206:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1914, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7226:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1916, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7245:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1917, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7256:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1915, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7240:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1918, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7240:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1913, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7221:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1919, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7221:43:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7206:58:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1921, + "nodeType": "ExpressionStatement", + "src": "7206:58:5" + } + ] + } + }, + "id": 1924, + "nodeType": "IfStatement", + "src": "6976:299:5", + "trueBody": { + "id": 1908, + "nodeType": "Block", + "src": "7000:162:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 1891, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7014:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1893, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7034:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1895, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7053:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1896, + "name": "oldWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1882, + "src": "7061:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1894, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7048:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7048:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1892, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "7029:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1898, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7029:43:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7014:58:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1900, + "nodeType": "ExpressionStatement", + "src": "7014:58:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1904, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1902, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "7094:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 1903, + "name": "MAX_TOTAL_WEIGHT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 64, + "src": "7110:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7094:32:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f544f54414c5f574549474854", + "id": 1905, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7128:22:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_55ceb599893e4bee215a5c1285d9b5c12334585fcdd4c2c71690e94257494440", + "typeString": "literal_string \"ERR_MAX_TOTAL_WEIGHT\"" + }, + "value": "ERR_MAX_TOTAL_WEIGHT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_55ceb599893e4bee215a5c1285d9b5c12334585fcdd4c2c71690e94257494440", + "typeString": "literal_string \"ERR_MAX_TOTAL_WEIGHT\"" + } + ], + "id": 1901, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "7086:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 1906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7086:65:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1907, + "nodeType": "ExpressionStatement", + "src": "7086:65:5" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 1930, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1925, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7292:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1927, + "indexExpression": { + "argumentTypes": null, + "id": 1926, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7301:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7292:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1928, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "7292:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1929, + "name": "denorm", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1831, + "src": "7317:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7292:31:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1931, + "nodeType": "ExpressionStatement", + "src": "7292:31:5" + }, + { + "assignments": [ + 1933 + ], + "declarations": [ + { + "constant": false, + "id": 1933, + "name": "oldBalance", + "nodeType": "VariableDeclaration", + "scope": 1996, + "src": "7396:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1932, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7396:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1938, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1934, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7414:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1936, + "indexExpression": { + "argumentTypes": null, + "id": 1935, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7423:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7414:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1937, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "7414:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7396:41:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 1944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1939, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "7447:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 1941, + "indexExpression": { + "argumentTypes": null, + "id": 1940, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7456:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7447:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 1942, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "7447:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 1943, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7473:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7447:33:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1945, + "nodeType": "ExpressionStatement", + "src": "7447:33:5" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1948, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1946, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7494:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 1947, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7504:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7494:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1960, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7612:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 1961, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7622:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7612:20:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1994, + "nodeType": "IfStatement", + "src": "7608:404:5", + "trueBody": { + "id": 1993, + "nodeType": "Block", + "src": "7634:378:5", + "statements": [ + { + "assignments": [ + 1964 + ], + "declarations": [ + { + "constant": false, + "id": 1964, + "name": "tokenBalanceWithdrawn", + "nodeType": "VariableDeclaration", + "scope": 1993, + "src": "7725:26:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1963, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1969, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1966, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7759:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1967, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7771:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1965, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7754:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7754:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7725:54:5" + }, + { + "assignments": [ + 1971 + ], + "declarations": [ + { + "constant": false, + "id": 1971, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 1993, + "src": "7793:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1970, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7793:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1976, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1973, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1964, + "src": "7818:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1974, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "7841:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1972, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "7813:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1975, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7813:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7793:57:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1978, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7880:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1979, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "7887:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7887:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1982, + "name": "tokenBalanceWithdrawn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1964, + "src": "7904:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1983, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1971, + "src": "7927:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1981, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7899:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1984, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7899:41:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1977, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "7864:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1985, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7864:77:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1986, + "nodeType": "ExpressionStatement", + "src": "7864:77:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1988, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7971:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1989, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "7978:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1990, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1971, + "src": "7988:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1987, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "7955:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1991, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7955:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1992, + "nodeType": "ExpressionStatement", + "src": "7955:46:5" + } + ] + } + }, + "id": 1995, + "nodeType": "IfStatement", + "src": "7490:522:5", + "trueBody": { + "id": 1959, + "nodeType": "Block", + "src": "7516:86:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1950, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1827, + "src": "7546:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1951, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "7553:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7553:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1954, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1829, + "src": "7570:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1955, + "name": "oldBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1933, + "src": "7579:10:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1953, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "7565:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1956, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7565:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 1949, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "7530:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 1957, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7530:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1958, + "nodeType": "ExpressionStatement", + "src": "7530:61:5" + } + ] + } + } + ] + }, + "documentation": null, + "id": 1997, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 1834, + "modifierName": { + "argumentTypes": null, + "id": 1833, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "6496:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6496:6:5" + }, + { + "arguments": null, + "id": 1836, + "modifierName": { + "argumentTypes": null, + "id": 1835, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "6511:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "6511:6:5" + } + ], + "name": "rebind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1832, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1827, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6431:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1826, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6431:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1829, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6446:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1828, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6446:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1831, + "name": "denorm", + "nodeType": "VariableDeclaration", + "scope": 1997, + "src": "6460:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1830, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6460:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6430:42:5" + }, + "returnParameters": { + "id": 1837, + "nodeType": "ParameterList", + "parameters": [], + "src": "6522:0:5" + }, + "scope": 3473, + "src": "6415:1603:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 2115, + "nodeType": "Block", + "src": "8106:928:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 2010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2007, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "8125:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2008, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8125:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 2009, + "name": "_controller", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1406, + "src": "8139:11:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8125:25:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f434f4e54524f4c4c4552", + "id": 2011, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8152:20:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + }, + "value": "ERR_NOT_CONTROLLER" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_0479bbd6e0e904a96491e3adc0eda9022c19acd57f4922725f8618b3a0372668", + "typeString": "literal_string \"ERR_NOT_CONTROLLER\"" + } + ], + "id": 2006, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8117:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8117:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2013, + "nodeType": "ExpressionStatement", + "src": "8117:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2015, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8191:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2017, + "indexExpression": { + "argumentTypes": null, + "id": 2016, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8200:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8191:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2018, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "8191:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2019, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8214:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2014, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8183:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2020, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8183:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2021, + "nodeType": "ExpressionStatement", + "src": "8183:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2024, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "8248:11:5", + "subExpression": { + "argumentTypes": null, + "id": 2023, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "8249:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f49535f46494e414c495a4544", + "id": 2025, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8261:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + }, + "value": "ERR_IS_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_4e8186530b7c98466f35e0b14182dc6e751c9b9644c5bf1204c0609f892e5bbe", + "typeString": "literal_string \"ERR_IS_FINALIZED\"" + } + ], + "id": 2022, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "8240:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8240:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2027, + "nodeType": "ExpressionStatement", + "src": "8240:40:5" + }, + { + "assignments": [ + 2029 + ], + "declarations": [ + { + "constant": false, + "id": 2029, + "name": "tokenBalance", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8291:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2028, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8291:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2034, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2030, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8311:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2032, + "indexExpression": { + "argumentTypes": null, + "id": 2031, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8320:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8311:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2033, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "8311:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8291:43:5" + }, + { + "assignments": [ + 2036 + ], + "declarations": [ + { + "constant": false, + "id": 2036, + "name": "tokenExitFee", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8344:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2035, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8344:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2041, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2038, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2029, + "src": "8369:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2039, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "8383:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2037, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "8364:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2040, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8364:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8344:48:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2050, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2042, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "8403:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2044, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "8423:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2045, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8437:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2047, + "indexExpression": { + "argumentTypes": null, + "id": 2046, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8446:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8437:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2048, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "8437:22:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2043, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "8418:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2049, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8418:42:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8403:57:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2051, + "nodeType": "ExpressionStatement", + "src": "8403:57:5" + }, + { + "assignments": [ + 2053 + ], + "declarations": [ + { + "constant": false, + "id": 2053, + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8566:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2052, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8566:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2058, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2054, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8579:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2056, + "indexExpression": { + "argumentTypes": null, + "id": 2055, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8588:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8579:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2057, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 1318, + "src": "8579:21:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8566:34:5" + }, + { + "assignments": [ + 2060 + ], + "declarations": [ + { + "constant": false, + "id": 2060, + "name": "last", + "nodeType": "VariableDeclaration", + "scope": 2115, + "src": "8610:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2059, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "8610:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2065, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2061, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8622:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8622:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 2063, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8639:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8622:18:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8610:30:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2072, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2066, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8650:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2068, + "indexExpression": { + "argumentTypes": null, + "id": 2067, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8658:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8650:14:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2069, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8667:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2071, + "indexExpression": { + "argumentTypes": null, + "id": 2070, + "name": "last", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2060, + "src": "8675:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8667:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "8650:30:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 2073, + "nodeType": "ExpressionStatement", + "src": "8650:30:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2081, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2074, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8690:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2078, + "indexExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2075, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8699:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2077, + "indexExpression": { + "argumentTypes": null, + "id": 2076, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8707:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8699:14:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "8690:24:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2079, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "index", + "nodeType": "MemberAccess", + "referencedDeclaration": 1318, + "src": "8690:30:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 2080, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2053, + "src": "8723:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8690:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2082, + "nodeType": "ExpressionStatement", + "src": "8690:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "argumentTypes": null, + "id": 2083, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "8738:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2085, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "pop", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8738:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypop_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 2086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8738:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2087, + "nodeType": "ExpressionStatement", + "src": "8738:13:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2097, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2088, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "8761:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2090, + "indexExpression": { + "argumentTypes": null, + "id": 2089, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8770:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8761:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 2092, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8807:5:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2093, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8833:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2094, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8856:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2095, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8880:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 2091, + "name": "Record", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1323, + "src": "8779:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Record_$1323_storage_ptr_$", + "typeString": "type(struct BPool.Record storage pointer)" + } + }, + "id": 2096, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [ + "bound", + "index", + "denorm", + "balance" + ], + "nodeType": "FunctionCall", + "src": "8779:113:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_memory", + "typeString": "struct BPool.Record memory" + } + }, + "src": "8761:131:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2098, + "nodeType": "ExpressionStatement", + "src": "8761:131:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2100, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8919:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2101, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "8926:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "8926:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2104, + "name": "tokenBalance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2029, + "src": "8943:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2105, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2036, + "src": "8957:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2103, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "8938:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8938:32:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2099, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "8903:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2107, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8903:68:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2108, + "nodeType": "ExpressionStatement", + "src": "8903:68:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2110, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1999, + "src": "8997:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2111, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "9004:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2112, + "name": "tokenExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2036, + "src": "9014:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2109, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "8981:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8981:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2114, + "nodeType": "ExpressionStatement", + "src": "8981:46:5" + } + ] + }, + "documentation": null, + "id": 2116, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2002, + "modifierName": { + "argumentTypes": null, + "id": 2001, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "8080:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8080:6:5" + }, + { + "arguments": null, + "id": 2004, + "modifierName": { + "argumentTypes": null, + "id": 2003, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "8095:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "8095:6:5" + } + ], + "name": "unbind", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2000, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1999, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2116, + "src": "8040:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1998, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "8040:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "8039:15:5" + }, + "returnParameters": { + "id": 2005, + "nodeType": "ParameterList", + "parameters": [], + "src": "8106:0:5" + }, + "scope": 3473, + "src": "8024:1010:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2147, + "nodeType": "Block", + "src": "9196:138:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2126, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9214:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2128, + "indexExpression": { + "argumentTypes": null, + "id": 2127, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9223:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9214:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2129, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9214:21:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2130, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9237:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2125, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9206:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2131, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9206:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2132, + "nodeType": "ExpressionStatement", + "src": "9206:47:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2133, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9263:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2135, + "indexExpression": { + "argumentTypes": null, + "id": 2134, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9272:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9263:15:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2136, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9263:23:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2142, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5280, + "src": "9321:4:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 2141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9313:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9313:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2138, + "name": "token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2118, + "src": "9296:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2137, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "9289:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 2139, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9289:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 2140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3504, + "src": "9289:23:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 2144, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9289:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9263:64:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2146, + "nodeType": "ExpressionStatement", + "src": "9263:64:5" + } + ] + }, + "documentation": null, + "id": 2148, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2121, + "modifierName": { + "argumentTypes": null, + "id": 2120, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "9170:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9170:6:5" + }, + { + "arguments": null, + "id": 2123, + "modifierName": { + "argumentTypes": null, + "id": 2122, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "9185:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9185:6:5" + } + ], + "name": "gulp", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2119, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2118, + "name": "token", + "nodeType": "VariableDeclaration", + "scope": 2148, + "src": "9130:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2117, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9130:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9129:15:5" + }, + "returnParameters": { + "id": 2124, + "nodeType": "ParameterList", + "parameters": [], + "src": "9196:0:5" + }, + "scope": 3473, + "src": "9116:218:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2199, + "nodeType": "Block", + "src": "9475:346:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2160, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9493:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2162, + "indexExpression": { + "argumentTypes": null, + "id": 2161, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2150, + "src": "9502:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9493:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2163, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9493:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9518:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2159, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9485:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9485:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2166, + "nodeType": "ExpressionStatement", + "src": "9485:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2168, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9552:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2170, + "indexExpression": { + "argumentTypes": null, + "id": 2169, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2152, + "src": "9561:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9552:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2171, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9552:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2172, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9578:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2167, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9544:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9544:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2174, + "nodeType": "ExpressionStatement", + "src": "9544:50:5" + }, + { + "assignments": [ + 2176 + ], + "declarations": [ + { + "constant": false, + "id": 2176, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "9604:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2175, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "9604:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2180, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2177, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9630:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2179, + "indexExpression": { + "argumentTypes": null, + "id": 2178, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2150, + "src": "9639:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9630:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9604:43:5" + }, + { + "assignments": [ + 2182 + ], + "declarations": [ + { + "constant": false, + "id": 2182, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2199, + "src": "9657:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2181, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "9657:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2186, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2183, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9684:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2185, + "indexExpression": { + "argumentTypes": null, + "id": 2184, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2152, + "src": "9693:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9684:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9657:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2188, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9733:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2189, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9733:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2190, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2176, + "src": "9751:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2191, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "9751:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2192, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2182, + "src": "9768:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2193, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "9768:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2194, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2182, + "src": "9787:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2195, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "9787:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2196, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "9805:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2187, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "9719:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9719:95:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2158, + "id": 2198, + "nodeType": "Return", + "src": "9712:102:5" + } + ] + }, + "documentation": null, + "id": 2200, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2155, + "modifierName": { + "argumentTypes": null, + "id": 2154, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "9427:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9427:10:5" + } + ], + "name": "getSpotPrice", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2150, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9362:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2149, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9362:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2152, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9379:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2151, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9379:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9361:35:5" + }, + "returnParameters": { + "id": 2158, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2157, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 2200, + "src": "9455:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2156, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9455:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9454:16:5" + }, + "scope": 3473, + "src": "9340:481:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2251, + "nodeType": "Block", + "src": "9969:339:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2212, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "9987:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2214, + "indexExpression": { + "argumentTypes": null, + "id": 2213, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2202, + "src": "9996:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9987:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2215, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "9987:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2216, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10012:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2211, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "9979:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9979:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2218, + "nodeType": "ExpressionStatement", + "src": "9979:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2220, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10046:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2222, + "indexExpression": { + "argumentTypes": null, + "id": 2221, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2204, + "src": "10055:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10046:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2223, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "10046:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2224, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10072:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2219, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10038:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10038:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2226, + "nodeType": "ExpressionStatement", + "src": "10038:50:5" + }, + { + "assignments": [ + 2228 + ], + "declarations": [ + { + "constant": false, + "id": 2228, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2251, + "src": "10098:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2227, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "10098:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2232, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2229, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10124:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2231, + "indexExpression": { + "argumentTypes": null, + "id": 2230, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2202, + "src": "10133:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10124:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10098:43:5" + }, + { + "assignments": [ + 2234 + ], + "declarations": [ + { + "constant": false, + "id": 2234, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2251, + "src": "10151:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2233, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "10151:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2238, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2235, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10178:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2237, + "indexExpression": { + "argumentTypes": null, + "id": 2236, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2204, + "src": "10187:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10178:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10151:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2240, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2228, + "src": "10227:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2241, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10227:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2242, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2228, + "src": "10245:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2243, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "10245:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2244, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2234, + "src": "10262:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2245, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10262:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2246, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2234, + "src": "10281:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2247, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "10281:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 2248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10299:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 2239, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "10213:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10213:88:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2210, + "id": 2250, + "nodeType": "Return", + "src": "10206:95:5" + } + ] + }, + "documentation": null, + "id": 2252, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2207, + "modifierName": { + "argumentTypes": null, + "id": 2206, + "name": "_viewlock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1400, + "src": "9921:10:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "9921:10:5" + } + ], + "name": "getSpotPriceSansFee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2205, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2202, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9856:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2201, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9856:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2204, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9873:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2203, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "9873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9855:35:5" + }, + "returnParameters": { + "id": 2210, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2209, + "name": "spotPrice", + "nodeType": "VariableDeclaration", + "scope": 2252, + "src": "9949:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2208, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "9949:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "9948:16:5" + }, + "scope": 3473, + "src": "9827:481:5", + "stateMutability": "view", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2374, + "nodeType": "Block", + "src": "10433:806:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2265, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "10451:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2266, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10463:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2264, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10443:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10443:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2268, + "nodeType": "ExpressionStatement", + "src": "10443:40:5" + }, + { + "assignments": [ + 2270 + ], + "declarations": [ + { + "constant": false, + "id": 2270, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 2374, + "src": "10494:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2269, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10494:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2273, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2271, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3813, + "src": "10511:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 2272, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10511:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10494:30:5" + }, + { + "assignments": [ + 2275 + ], + "declarations": [ + { + "constant": false, + "id": 2275, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 2374, + "src": "10534:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2274, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10534:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2280, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2277, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "10552:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2278, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2270, + "src": "10567:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2276, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "10547:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10547:30:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10534:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2282, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2275, + "src": "10595:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2283, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10604:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "10595:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10607:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10587:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10587:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2287, + "nodeType": "ExpressionStatement", + "src": "10587:38:5" + }, + { + "body": { + "id": 2362, + "nodeType": "Block", + "src": "10678:465:5", + "statements": [ + { + "assignments": [ + 2300 + ], + "declarations": [ + { + "constant": false, + "id": 2300, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10692:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2299, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10692:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2304, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2301, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "10704:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2303, + "indexExpression": { + "argumentTypes": null, + "id": 2302, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10712:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10704:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10692:22:5" + }, + { + "assignments": [ + 2306 + ], + "declarations": [ + { + "constant": false, + "id": 2306, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10728:8:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2305, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10728:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2311, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2307, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10739:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2309, + "indexExpression": { + "argumentTypes": null, + "id": 2308, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10748:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10739:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2310, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10739:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10728:30:5" + }, + { + "assignments": [ + 2313 + ], + "declarations": [ + { + "constant": false, + "id": 2313, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2362, + "src": "10772:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2312, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10772:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2318, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2315, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2275, + "src": "10798:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2316, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2306, + "src": "10805:3:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2314, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "10793:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10793:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10772:37:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2320, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "10831:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10848:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "10831:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2323, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10851:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2319, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10823:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2324, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10823:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2325, + "nodeType": "ExpressionStatement", + "src": "10823:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2327, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "10891:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2328, + "name": "maxAmountsIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2257, + "src": "10908:12:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 2330, + "indexExpression": { + "argumentTypes": null, + "id": 2329, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10921:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10908:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10891:32:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 2332, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10925:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 2326, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "10883:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10883:57:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2334, + "nodeType": "ExpressionStatement", + "src": "10883:57:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2335, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10954:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2337, + "indexExpression": { + "argumentTypes": null, + "id": 2336, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10963:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10954:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2338, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10954:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2340, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "10981:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2342, + "indexExpression": { + "argumentTypes": null, + "id": 2341, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "10990:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "10981:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2343, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "10981:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2344, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11002:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2339, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "10976:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2345, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10976:40:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10954:62:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2347, + "nodeType": "ExpressionStatement", + "src": "10954:62:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2349, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11044:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11044:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2351, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "11056:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2352, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11059:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2348, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "11035:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2353, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11035:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2354, + "nodeType": "EmitStatement", + "src": "11030:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2356, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2300, + "src": "11103:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2357, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11106:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11106:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2359, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2313, + "src": "11118:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2355, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "11087:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2360, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11087:45:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2361, + "nodeType": "ExpressionStatement", + "src": "11087:45:5" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2292, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10653:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2293, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "10657:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2294, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "10657:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "10653:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2363, + "initializationExpression": { + "assignments": [ + 2289 + ], + "declarations": [ + { + "constant": false, + "id": 2289, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 2363, + "src": "10641:6:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2288, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10641:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2291, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 2290, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10650:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "10641:10:5" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 2297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "10673:3:5", + "subExpression": { + "argumentTypes": null, + "id": 2296, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2289, + "src": "10673:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2298, + "nodeType": "ExpressionStatement", + "src": "10673:3:5" + }, + "nodeType": "ForStatement", + "src": "10636:507:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2365, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "11167:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2364, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "11152:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11152:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2367, + "nodeType": "ExpressionStatement", + "src": "11152:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2369, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11206:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2370, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11206:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2371, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2254, + "src": "11218:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2368, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "11191:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2372, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11191:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2373, + "nodeType": "ExpressionStatement", + "src": "11191:41:5" + } + ] + }, + "documentation": null, + "id": 2375, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2260, + "modifierName": { + "argumentTypes": null, + "id": 2259, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "10407:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10407:6:5" + }, + { + "arguments": null, + "id": 2262, + "modifierName": { + "argumentTypes": null, + "id": 2261, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "10422:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "10422:6:5" + } + ], + "name": "joinPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2258, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2254, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2375, + "src": "10332:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2253, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10332:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2257, + "name": "maxAmountsIn", + "nodeType": "VariableDeclaration", + "scope": 2375, + "src": "10352:28:5", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 2255, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10352:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2256, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10352:6:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10331:50:5" + }, + "returnParameters": { + "id": 2263, + "nodeType": "ParameterList", + "parameters": [], + "src": "10433:0:5" + }, + "scope": 3473, + "src": "10314:925:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2516, + "nodeType": "Block", + "src": "11364:975:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2388, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "11382:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11394:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2387, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "11374:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11374:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2391, + "nodeType": "ExpressionStatement", + "src": "11374:40:5" + }, + { + "assignments": [ + 2393 + ], + "declarations": [ + { + "constant": false, + "id": 2393, + "name": "poolTotal", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11425:14:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2392, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11425:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2396, + "initialValue": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 2394, + "name": "totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3813, + "src": "11442:11:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", + "typeString": "function () view returns (uint256)" + } + }, + "id": 2395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11442:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11425:30:5" + }, + { + "assignments": [ + 2398 + ], + "declarations": [ + { + "constant": false, + "id": 2398, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11465:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2397, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11465:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2403, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2400, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11485:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2401, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "11499:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2399, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "11480:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11480:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11465:43:5" + }, + { + "assignments": [ + 2405 + ], + "declarations": [ + { + "constant": false, + "id": 2405, + "name": "pAiAfterExitFee", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11518:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2404, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11518:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2410, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2407, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11546:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2408, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2398, + "src": "11560:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2406, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "11541:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2409, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11541:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11518:50:5" + }, + { + "assignments": [ + 2412 + ], + "declarations": [ + { + "constant": false, + "id": 2412, + "name": "ratio", + "nodeType": "VariableDeclaration", + "scope": 2516, + "src": "11578:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2411, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11578:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2417, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2414, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2405, + "src": "11596:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2415, + "name": "poolTotal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2393, + "src": "11613:9:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2413, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "11591:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11591:32:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11578:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2421, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2419, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2412, + "src": "11641:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2420, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11650:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "11641:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11653:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2418, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "11633:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11633:38:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2424, + "nodeType": "ExpressionStatement", + "src": "11633:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2426, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "11697:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2427, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11697:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2428, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2377, + "src": "11709:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2425, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "11682:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2429, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11682:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2430, + "nodeType": "ExpressionStatement", + "src": "11682:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2432, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "11747:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2433, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2398, + "src": "11757:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2431, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "11732:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 2434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11732:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2435, + "nodeType": "ExpressionStatement", + "src": "11732:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2437, + "name": "pAiAfterExitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2405, + "src": "11790:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2436, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "11775:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2438, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11775:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2439, + "nodeType": "ExpressionStatement", + "src": "11775:31:5" + }, + { + "body": { + "id": 2514, + "nodeType": "Block", + "src": "11859:473:5", + "statements": [ + { + "assignments": [ + 2452 + ], + "declarations": [ + { + "constant": false, + "id": 2452, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11873:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2451, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11873:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2456, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2453, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "11885:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2455, + "indexExpression": { + "argumentTypes": null, + "id": 2454, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11893:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11885:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11873:22:5" + }, + { + "assignments": [ + 2458 + ], + "declarations": [ + { + "constant": false, + "id": 2458, + "name": "bal", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11909:8:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2457, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11909:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2463, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2459, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "11920:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2461, + "indexExpression": { + "argumentTypes": null, + "id": 2460, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "11929:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11920:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2462, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "11920:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11909:30:5" + }, + { + "assignments": [ + 2465 + ], + "declarations": [ + { + "constant": false, + "id": 2465, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2514, + "src": "11953:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2464, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11953:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2470, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2467, + "name": "ratio", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2412, + "src": "11980:5:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2468, + "name": "bal", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2458, + "src": "11987:3:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2466, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "11975:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "11975:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "11953:38:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2474, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2472, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12013:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 2473, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12031:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "12013:19:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2475, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12034:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2471, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12005:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2476, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12005:47:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2477, + "nodeType": "ExpressionStatement", + "src": "12005:47:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2479, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12074:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2480, + "name": "minAmountsOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2380, + "src": "12092:13:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[] calldata" + } + }, + "id": 2482, + "indexExpression": { + "argumentTypes": null, + "id": 2481, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "12106:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12092:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12074:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2484, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12110:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2478, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12066:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2485, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12066:60:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2486, + "nodeType": "ExpressionStatement", + "src": "12066:60:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2498, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2487, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12140:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2489, + "indexExpression": { + "argumentTypes": null, + "id": 2488, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12149:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12140:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2490, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12140:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2492, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12167:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2494, + "indexExpression": { + "argumentTypes": null, + "id": 2493, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12176:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12167:11:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2495, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12167:19:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2496, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12188:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2491, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "12162:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12162:41:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12140:63:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2499, + "nodeType": "ExpressionStatement", + "src": "12140:63:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2501, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "12231:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2502, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12231:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2503, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12243:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2504, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12246:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2500, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "12222:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12222:39:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2506, + "nodeType": "EmitStatement", + "src": "12217:44:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2508, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2452, + "src": "12291:1:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2509, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "12294:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2510, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12294:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2511, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2465, + "src": "12306:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2507, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "12275:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2512, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12275:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2513, + "nodeType": "ExpressionStatement", + "src": "12275:46:5" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2444, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11834:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2445, + "name": "_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1415, + "src": "11838:7:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 2446, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11838:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "11834:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 2515, + "initializationExpression": { + "assignments": [ + 2441 + ], + "declarations": [ + { + "constant": false, + "id": 2441, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 2515, + "src": "11822:6:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2440, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11822:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2443, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 2442, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11831:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "11822:10:5" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 2449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "11854:3:5", + "subExpression": { + "argumentTypes": null, + "id": 2448, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2441, + "src": "11854:1:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2450, + "nodeType": "ExpressionStatement", + "src": "11854:3:5" + }, + "nodeType": "ForStatement", + "src": "11817:515:5" + } + ] + }, + "documentation": null, + "id": 2517, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2383, + "modifierName": { + "argumentTypes": null, + "id": 2382, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "11338:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11338:6:5" + }, + { + "arguments": null, + "id": 2385, + "modifierName": { + "argumentTypes": null, + "id": 2384, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "11353:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "11353:6:5" + } + ], + "name": "exitPool", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2381, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2377, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2517, + "src": "11263:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2376, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11263:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2380, + "name": "minAmountsOut", + "nodeType": "VariableDeclaration", + "scope": 2517, + "src": "11282:29:5", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 2378, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "11282:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2379, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11282:6:5", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11262:50:5" + }, + "returnParameters": { + "id": 2386, + "nodeType": "ParameterList", + "parameters": [], + "src": "11364:0:5" + }, + "scope": 3473, + "src": "11245:1094:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2714, + "nodeType": "Block", + "src": "12618:2153:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2539, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12637:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2541, + "indexExpression": { + "argumentTypes": null, + "id": 2540, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "12646:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12637:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2542, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "12637:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2543, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12662:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2538, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12629:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2544, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12629:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2545, + "nodeType": "ExpressionStatement", + "src": "12629:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2547, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12696:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2549, + "indexExpression": { + "argumentTypes": null, + "id": 2548, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "12705:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12696:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2550, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "12696:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2551, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12722:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2546, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12688:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2552, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12688:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2553, + "nodeType": "ExpressionStatement", + "src": "12688:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2555, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "12756:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 2556, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12769:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + }, + "value": "ERR_SWAP_NOT_PUBLIC" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + } + ], + "id": 2554, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12748:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2557, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12748:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2558, + "nodeType": "ExpressionStatement", + "src": "12748:43:5" + }, + { + "assignments": [ + 2560 + ], + "declarations": [ + { + "constant": false, + "id": 2560, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "12802:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2559, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "12802:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2566, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2561, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12828:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2565, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2563, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "12845:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2562, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12837:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2564, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12837:16:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12828:26:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12802:52:5" + }, + { + "assignments": [ + 2568 + ], + "declarations": [ + { + "constant": false, + "id": 2568, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "12864:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2567, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "12864:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2574, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2569, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "12891:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2573, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2571, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "12908:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12900:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2572, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12900:17:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12891:27:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12864:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2582, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2576, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "12937:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2578, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "12959:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2579, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "12959:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2580, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "12977:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2577, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "12954:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2581, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12954:36:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12937:53:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 2583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12992:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 2575, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "12929:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2584, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12929:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2585, + "nodeType": "ExpressionStatement", + "src": "12929:82:5" + }, + { + "assignments": [ + 2587 + ], + "declarations": [ + { + "constant": false, + "id": 2587, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 2714, + "src": "13022:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2586, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "13022:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2599, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2589, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13096:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2590, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13096:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2591, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13150:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2592, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13150:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2593, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13203:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2594, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13203:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2595, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13258:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2596, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13258:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2597, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "13312:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2588, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "13045:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2598, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13045:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "13022:332:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2603, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2601, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "13372:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2602, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2527, + "src": "13391:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13372:27:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 2604, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13401:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + }, + "value": "ERR_BAD_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + } + ], + "id": 2600, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "13364:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2605, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13364:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2606, + "nodeType": "ExpressionStatement", + "src": "13364:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2620, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2607, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13434:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2609, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13495:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2610, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13495:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2611, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13541:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2612, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13541:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2613, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13586:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2614, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13586:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2615, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13633:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2616, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "13633:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2617, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "13679:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2618, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "13722:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2608, + "name": "calcOutGivenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 396, + "src": "13451:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2619, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13451:305:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13434:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2621, + "nodeType": "ExpressionStatement", + "src": "13434:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2625, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2623, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13774:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2624, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2525, + "src": "13792:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13774:30:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2626, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13806:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2622, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "13766:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2627, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13766:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2628, + "nodeType": "ExpressionStatement", + "src": "13766:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2637, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2629, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13833:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2631, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13833:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2633, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "13857:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2634, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13857:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2635, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "13875:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2632, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "13852:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13852:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13833:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2638, + "nodeType": "ExpressionStatement", + "src": "13833:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2647, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2639, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13899:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2641, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13899:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2643, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "13924:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2644, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "13924:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2645, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "13943:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2642, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "13919:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2646, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13919:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13899:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2648, + "nodeType": "ExpressionStatement", + "src": "13899:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2661, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2649, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "13969:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2651, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "14033:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2652, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "14033:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2653, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2560, + "src": "14083:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2654, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "14083:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2655, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "14132:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2656, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "14132:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2657, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2568, + "src": "14183:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2658, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "14183:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2659, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "14233:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2650, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "13986:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2660, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "13986:285:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "13969:302:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2662, + "nodeType": "ExpressionStatement", + "src": "13969:302:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2666, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2664, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14289:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2665, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "14307:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14289:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2667, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14324:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2663, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14281:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2668, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14281:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2669, + "nodeType": "ExpressionStatement", + "src": "14281:61:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2673, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2671, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14365:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2672, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2527, + "src": "14383:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14365:26:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 2674, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14393:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + }, + "value": "ERR_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + } + ], + "id": 2670, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14357:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14357:54:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2676, + "nodeType": "ExpressionStatement", + "src": "14357:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2683, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2678, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2587, + "src": "14429:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2680, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14453:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2681, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14468:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2679, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "14448:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2682, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14448:35:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "14429:54:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "14485:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2677, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "14421:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14421:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2686, + "nodeType": "ExpressionStatement", + "src": "14421:82:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2688, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14528:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2689, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14528:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2690, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "14540:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2691, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "14549:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2692, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14559:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2693, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14574:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2687, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1335, + "src": "14519:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,uint256,uint256)" + } + }, + "id": 2694, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14519:70:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2695, + "nodeType": "EmitStatement", + "src": "14514:75:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2697, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2519, + "src": "14616:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2698, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14625:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2699, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14625:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2700, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2521, + "src": "14637:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2696, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "14600:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2701, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14600:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2702, + "nodeType": "ExpressionStatement", + "src": "14600:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2704, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2523, + "src": "14677:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2705, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "14687:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "14687:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2707, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14699:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2703, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "14661:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2708, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "14661:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2709, + "nodeType": "ExpressionStatement", + "src": "14661:53:5" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 2710, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2534, + "src": "14733:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2711, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2536, + "src": "14749:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 2712, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "14732:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 2537, + "id": 2713, + "nodeType": "Return", + "src": "14725:39:5" + } + ] + }, + "documentation": null, + "id": 2715, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2530, + "modifierName": { + "argumentTypes": null, + "id": 2529, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "12533:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12533:6:5" + }, + { + "arguments": null, + "id": 2532, + "modifierName": { + "argumentTypes": null, + "id": 2531, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "12548:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "12548:6:5" + } + ], + "name": "swapExactAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2528, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2519, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12382:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2518, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12382:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2521, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12407:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2520, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12407:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2523, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12435:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2522, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "12435:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2525, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12461:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2524, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12461:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2527, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12488:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2526, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12488:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12372:135:5" + }, + "returnParameters": { + "id": 2537, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2534, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12572:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2533, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12572:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2536, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 2715, + "src": "12593:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2535, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12593:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "12571:42:5" + }, + "scope": 3473, + "src": "12346:2425:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 2912, + "nodeType": "Block", + "src": "15050:2147:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2737, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15068:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2739, + "indexExpression": { + "argumentTypes": null, + "id": 2738, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "15077:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15068:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2740, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "15068:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2741, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15093:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2736, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15060:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2742, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15060:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2743, + "nodeType": "ExpressionStatement", + "src": "15060:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2745, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15127:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2747, + "indexExpression": { + "argumentTypes": null, + "id": 2746, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "15136:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15127:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2748, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "15127:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2749, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15153:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2744, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15119:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2750, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15119:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2751, + "nodeType": "ExpressionStatement", + "src": "15119:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2753, + "name": "_publicSwap", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1408, + "src": "15187:11:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f535741505f4e4f545f5055424c4943", + "id": 2754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15200:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + }, + "value": "ERR_SWAP_NOT_PUBLIC" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b9f201e8e5bb36571de65b106c220b23ff276fe4fbb13e3a81e8737accb75282", + "typeString": "literal_string \"ERR_SWAP_NOT_PUBLIC\"" + } + ], + "id": 2752, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15179:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15179:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2756, + "nodeType": "ExpressionStatement", + "src": "15179:43:5" + }, + { + "assignments": [ + 2758 + ], + "declarations": [ + { + "constant": false, + "id": 2758, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15233:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2757, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "15233:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2764, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2759, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15259:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2763, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2761, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "15276:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2760, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15268:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2762, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15268:16:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15259:26:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15233:52:5" + }, + { + "assignments": [ + 2766 + ], + "declarations": [ + { + "constant": false, + "id": 2766, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15295:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2765, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "15295:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2772, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2767, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "15322:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2771, + "indexExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2769, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "15339:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 2768, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "15331:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 2770, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15331:17:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "15322:27:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15295:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2780, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2774, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "15368:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2776, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15391:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2777, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15391:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2778, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "15410:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2775, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "15386:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2779, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15386:38:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15368:56:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 2781, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15426:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 2773, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15360:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2782, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15360:86:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2783, + "nodeType": "ExpressionStatement", + "src": "15360:86:5" + }, + { + "assignments": [ + 2785 + ], + "declarations": [ + { + "constant": false, + "id": 2785, + "name": "spotPriceBefore", + "nodeType": "VariableDeclaration", + "scope": 2912, + "src": "15457:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2784, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15457:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2797, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2787, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15531:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2788, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15531:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2789, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15585:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2790, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15585:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2791, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15638:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2792, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15638:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2793, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "15693:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2794, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15693:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2795, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "15747:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2786, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "15480:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2796, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15480:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "15457:332:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2801, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2799, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "15807:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2800, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2725, + "src": "15826:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15807:27:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4241445f4c494d49545f5052494345", + "id": 2802, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "15836:21:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + }, + "value": "ERR_BAD_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8be255c2a8eee29f022cb079554d7088e735aa3d5d6f9dc88998c3ffe134ce88", + "typeString": "literal_string \"ERR_BAD_LIMIT_PRICE\"" + } + ], + "id": 2798, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "15799:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2803, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15799:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2804, + "nodeType": "ExpressionStatement", + "src": "15799:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2805, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "15869:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2807, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15929:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2808, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "15929:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2809, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "15975:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2810, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "15975:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2811, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16020:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2812, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16020:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2813, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16067:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2814, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16067:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2815, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16113:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2816, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "16157:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2806, + "name": "calcInGivenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 468, + "src": "15885:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "15885:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "15869:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2819, + "nodeType": "ExpressionStatement", + "src": "15869:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2823, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2821, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16209:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2822, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2719, + "src": "16226:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16209:28:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 2824, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16239:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 2820, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16201:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2825, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16201:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2826, + "nodeType": "ExpressionStatement", + "src": "16201:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2835, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2827, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16265:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2829, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16265:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2831, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16289:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2832, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16289:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2833, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16307:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2830, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "16284:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2834, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16284:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16265:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2836, + "nodeType": "ExpressionStatement", + "src": "16265:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2845, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2837, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16331:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2839, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16331:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2841, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16356:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2842, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16356:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2843, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16375:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2840, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "16351:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16351:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16331:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2846, + "nodeType": "ExpressionStatement", + "src": "16331:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2847, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16401:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2849, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16465:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16465:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2851, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2758, + "src": "16515:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2852, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16515:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2853, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16564:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2854, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "16564:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2855, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2766, + "src": "16615:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2856, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "16615:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2857, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "16665:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2848, + "name": "calcSpotPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 324, + "src": "16418:13:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16418:285:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16401:302:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2860, + "nodeType": "ExpressionStatement", + "src": "16401:302:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2864, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2862, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16721:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2863, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "16739:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16721:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16756:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2861, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16713:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16713:61:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2867, + "nodeType": "ExpressionStatement", + "src": "16713:61:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2871, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2869, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "16792:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 2870, + "name": "maxPrice", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2725, + "src": "16810:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16792:26:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f5052494345", + "id": 2872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16820:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + }, + "value": "ERR_LIMIT_PRICE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_b5544ff618944f1e1eee76066a3c4ee71ebb3e4c80a9b96ceaf365ff27739eb5", + "typeString": "literal_string \"ERR_LIMIT_PRICE\"" + } + ], + "id": 2868, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16784:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2873, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16784:54:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2874, + "nodeType": "ExpressionStatement", + "src": "16784:54:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2881, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2876, + "name": "spotPriceBefore", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2785, + "src": "16856:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2878, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16880:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2879, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "16895:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2877, + "name": "bdiv", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1057, + "src": "16875:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16875:35:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "16856:54:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 2882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "16912:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 2875, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "16848:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16848:82:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2884, + "nodeType": "ExpressionStatement", + "src": "16848:82:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2886, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "16955:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2887, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "16955:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2888, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "16967:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2889, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "16976:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2890, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "16986:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2891, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "17001:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2885, + "name": "LOG_SWAP", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1335, + "src": "16946:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,uint256,uint256)" + } + }, + "id": 2892, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "16946:70:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2893, + "nodeType": "EmitStatement", + "src": "16941:75:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2895, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2717, + "src": "17043:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2896, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "17052:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "17052:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2898, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "17064:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2894, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "17027:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17027:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2900, + "nodeType": "ExpressionStatement", + "src": "17027:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2902, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2721, + "src": "17104:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2903, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "17114:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2904, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "17114:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2905, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2723, + "src": "17126:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2901, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "17088:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17088:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2907, + "nodeType": "ExpressionStatement", + "src": "17088:53:5" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "id": 2908, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2732, + "src": "17160:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2909, + "name": "spotPriceAfter", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2734, + "src": "17175:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 2910, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "17159:31:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", + "typeString": "tuple(uint256,uint256)" + } + }, + "functionReturnParameters": 2735, + "id": 2911, + "nodeType": "Return", + "src": "17152:38:5" + } + ] + }, + "documentation": null, + "id": 2913, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2728, + "modifierName": { + "argumentTypes": null, + "id": 2727, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "14965:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14965:6:5" + }, + { + "arguments": null, + "id": 2730, + "modifierName": { + "argumentTypes": null, + "id": 2729, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "14980:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "14980:6:5" + } + ], + "name": "swapExactAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2726, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2717, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14814:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2716, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14814:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2719, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14839:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2718, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14839:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2721, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14865:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2720, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "14865:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2723, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14891:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2722, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14891:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2725, + "name": "maxPrice", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "14920:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2724, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "14920:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "14804:135:5" + }, + "returnParameters": { + "id": 2735, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2732, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "15005:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2731, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15005:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2734, + "name": "spotPriceAfter", + "nodeType": "VariableDeclaration", + "scope": 2913, + "src": "15025:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2733, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "15025:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "15004:41:5" + }, + "scope": 3473, + "src": "14777:2420:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3016, + "nodeType": "Block", + "src": "17385:992:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2929, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "17411:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 2930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17423:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 2928, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17403:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2931, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17403:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2932, + "nodeType": "ExpressionStatement", + "src": "17403:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2934, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17461:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2936, + "indexExpression": { + "argumentTypes": null, + "id": 2935, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17470:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17461:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2937, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "17461:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 2938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17486:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 2933, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17453:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2939, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17453:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2940, + "nodeType": "ExpressionStatement", + "src": "17453:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2950, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2942, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "17520:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2944, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17542:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2946, + "indexExpression": { + "argumentTypes": null, + "id": 2945, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17551:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17542:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 2947, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "17542:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2948, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "17569:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2943, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "17537:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2949, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17537:45:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17520:62:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 2951, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "17584:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 2941, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "17512:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17512:91:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2953, + "nodeType": "ExpressionStatement", + "src": "17512:91:5" + }, + { + "assignments": [ + 2955 + ], + "declarations": [ + { + "constant": false, + "id": 2955, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3016, + "src": "17614:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 2954, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "17614:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 2959, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 2956, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "17640:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 2958, + "indexExpression": { + "argumentTypes": null, + "id": 2957, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "17649:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "17640:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "17614:43:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2971, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 2960, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "17668:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2962, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "17738:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2963, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "17738:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2964, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "17784:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2965, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "17784:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2966, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "17829:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2967, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "17871:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2968, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "17913:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2969, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "17956:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2961, + "name": "calcPoolOutGivenSingleIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 550, + "src": "17684:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 2970, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "17684:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "17668:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2972, + "nodeType": "ExpressionStatement", + "src": "17668:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 2976, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 2974, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18009:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 2975, + "name": "minPoolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2919, + "src": "18026:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18009:33:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 2977, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18044:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 2973, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18001:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 2978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18001:59:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2979, + "nodeType": "ExpressionStatement", + "src": "18001:59:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 2988, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2980, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "18071:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2982, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18071:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2984, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2955, + "src": "18095:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 2985, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18095:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 2986, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18113:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2983, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "18090:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 2987, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18090:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18071:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 2989, + "nodeType": "ExpressionStatement", + "src": "18071:56:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 2991, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18152:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 2992, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18152:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 2993, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "18164:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 2994, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18173:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2990, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "18143:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 2995, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18143:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 2996, + "nodeType": "EmitStatement", + "src": "18138:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 2998, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18213:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 2997, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "18198:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 2999, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18198:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3000, + "nodeType": "ExpressionStatement", + "src": "18198:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3002, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18252:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18252:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3004, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18264:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3001, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "18237:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3005, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18237:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3006, + "nodeType": "ExpressionStatement", + "src": "18237:41:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3008, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2915, + "src": "18304:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3009, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "18313:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3010, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "18313:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3011, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2917, + "src": "18325:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3007, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "18288:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3012, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18288:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3013, + "nodeType": "ExpressionStatement", + "src": "18288:51:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3014, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2926, + "src": "18357:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 2927, + "id": 3015, + "nodeType": "Return", + "src": "18350:20:5" + } + ] + }, + "documentation": null, + "id": 3017, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 2922, + "modifierName": { + "argumentTypes": null, + "id": 2921, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "17321:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "17321:6:5" + }, + { + "arguments": null, + "id": 2924, + "modifierName": { + "argumentTypes": null, + "id": 2923, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "17336:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "17336:6:5" + } + ], + "name": "joinswapExternAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2920, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2915, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17236:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2914, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "17236:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2917, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17253:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2916, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17253:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 2919, + "name": "minPoolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17273:21:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2918, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17273:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "17235:60:5" + }, + "returnParameters": { + "id": 2927, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 2926, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3017, + "src": "17360:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 2925, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "17360:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "17359:20:5" + }, + "scope": 3473, + "src": "17204:1173:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3127, + "nodeType": "Block", + "src": "18557:1043:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3033, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "18575:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3034, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18587:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3032, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18567:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3035, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18567:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3036, + "nodeType": "ExpressionStatement", + "src": "18567:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3038, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "18625:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3040, + "indexExpression": { + "argumentTypes": null, + "id": 3039, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "18634:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18625:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3041, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "18625:23:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "18650:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3037, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "18617:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3043, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18617:49:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3044, + "nodeType": "ExpressionStatement", + "src": "18617:49:5" + }, + { + "assignments": [ + 3046 + ], + "declarations": [ + { + "constant": false, + "id": 3046, + "name": "inRecord", + "nodeType": "VariableDeclaration", + "scope": 3127, + "src": "18677:23:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3045, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "18677:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3050, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3047, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "18703:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3049, + "indexExpression": { + "argumentTypes": null, + "id": 3048, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "18712:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "18703:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "18677:43:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3062, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3051, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "18731:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3053, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "18801:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3054, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "18801:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3055, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "18847:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3056, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "18847:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3057, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "18892:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3058, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "18934:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3059, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "18976:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3060, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "19019:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3052, + "name": "calcSingleInGivenPoolOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "18747:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3061, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "18747:306:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "18731:322:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3063, + "nodeType": "ExpressionStatement", + "src": "18731:322:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3067, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3065, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19072:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3066, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19089:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "19072:18:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3068, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19092:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 3064, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19064:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3069, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19064:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3070, + "nodeType": "ExpressionStatement", + "src": "19064:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3074, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3072, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19128:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3073, + "name": "maxAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3023, + "src": "19145:11:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19128:28:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3075, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19158:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 3071, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19120:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3076, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19120:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3077, + "nodeType": "ExpressionStatement", + "src": "19120:53:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3087, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3079, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19200:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3081, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19222:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3083, + "indexExpression": { + "argumentTypes": null, + "id": 3082, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19231:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19222:17:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3084, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19222:25:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3085, + "name": "MAX_IN_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 99, + "src": "19249:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3080, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "19217:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19217:45:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19200:62:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f494e5f524154494f", + "id": 3088, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19264:18:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + }, + "value": "ERR_MAX_IN_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_3050677a696f4e0f0af7fbd29d6f24f52a3873a4edbfdfefdc5ce1465c444acf", + "typeString": "literal_string \"ERR_MAX_IN_RATIO\"" + } + ], + "id": 3078, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19192:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3089, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19192:91:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3090, + "nodeType": "ExpressionStatement", + "src": "19192:91:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3099, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3091, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "19294:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3093, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19294:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3095, + "name": "inRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3046, + "src": "19318:8:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3096, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "19318:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3097, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19336:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3094, + "name": "badd", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 887, + "src": "19313:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3098, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19313:37:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19294:56:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3100, + "nodeType": "ExpressionStatement", + "src": "19294:56:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3102, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19375:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19375:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3104, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19387:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3105, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19396:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3101, + "name": "LOG_JOIN", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1343, + "src": "19366:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19366:44:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3107, + "nodeType": "EmitStatement", + "src": "19361:49:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3109, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "19436:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3108, + "name": "_mintPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3462, + "src": "19421:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19421:29:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3111, + "nodeType": "ExpressionStatement", + "src": "19421:29:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3113, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19475:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3114, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19475:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3115, + "name": "poolAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3021, + "src": "19487:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3112, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "19460:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19460:41:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3117, + "nodeType": "ExpressionStatement", + "src": "19460:41:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3119, + "name": "tokenIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3019, + "src": "19527:7:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3120, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "19536:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "19536:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3122, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19548:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3118, + "name": "_pullUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3401, + "src": "19511:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3123, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19511:51:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3124, + "nodeType": "ExpressionStatement", + "src": "19511:51:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3125, + "name": "tokenAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3030, + "src": "19580:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3031, + "id": 3126, + "nodeType": "Return", + "src": "19573:20:5" + } + ] + }, + "documentation": null, + "id": 3128, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3026, + "modifierName": { + "argumentTypes": null, + "id": 3025, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "18494:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18494:6:5" + }, + { + "arguments": null, + "id": 3028, + "modifierName": { + "argumentTypes": null, + "id": 3027, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "18509:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "18509:6:5" + } + ], + "name": "joinswapPoolAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3024, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3019, + "name": "tokenIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18414:15:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3018, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "18414:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3021, + "name": "poolAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18431:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3020, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18431:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3023, + "name": "maxAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18451:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3022, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18451:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18413:55:5" + }, + "returnParameters": { + "id": 3031, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3030, + "name": "tokenAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3128, + "src": "18533:18:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3029, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "18533:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "18532:20:5" + }, + "scope": 3473, + "src": "18383:1217:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3246, + "nodeType": "Block", + "src": "19781:1117:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3144, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "19799:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3145, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19811:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3143, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19791:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19791:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3147, + "nodeType": "ExpressionStatement", + "src": "19791:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3149, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19849:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3151, + "indexExpression": { + "argumentTypes": null, + "id": 3150, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "19858:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19849:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3152, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "19849:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "19875:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3148, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "19841:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3154, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19841:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3155, + "nodeType": "ExpressionStatement", + "src": "19841:50:5" + }, + { + "assignments": [ + 3157 + ], + "declarations": [ + { + "constant": false, + "id": 3157, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3246, + "src": "19902:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3156, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "19902:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3161, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3158, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "19929:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3160, + "indexExpression": { + "argumentTypes": null, + "id": 3159, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "19938:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "19929:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "19902:45:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3162, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "19958:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3164, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20029:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3165, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20029:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3166, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20076:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3167, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "20076:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3168, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "20122:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3169, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "20164:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3170, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20206:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3171, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "20248:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3163, + "name": "calcSingleOutGivenPoolIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 734, + "src": "19975:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3172, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "19975:307:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "19958:324:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3174, + "nodeType": "ExpressionStatement", + "src": "19958:324:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3176, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20301:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 3177, + "name": "minAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3134, + "src": "20319:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20301:30:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f4f5554", + "id": 3179, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20333:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + }, + "value": "ERR_LIMIT_OUT" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_665ff818e83fa8776541f5756d1025222aecfe18eeb105729691884778497705", + "typeString": "literal_string \"ERR_LIMIT_OUT\"" + } + ], + "id": 3175, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "20293:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3180, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20293:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3181, + "nodeType": "ExpressionStatement", + "src": "20293:56:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3183, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20376:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3185, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "20399:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3187, + "indexExpression": { + "argumentTypes": null, + "id": 3186, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20408:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "20399:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3188, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20399:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3189, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "20427:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3184, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "20394:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20394:47:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20376:65:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3192, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "20443:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 3182, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "20368:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3193, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20368:95:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3194, + "nodeType": "ExpressionStatement", + "src": "20368:95:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3203, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3195, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20474:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3197, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20474:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3199, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3157, + "src": "20499:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3200, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "20499:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3201, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20518:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3198, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "20494:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3202, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20494:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "20474:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3204, + "nodeType": "ExpressionStatement", + "src": "20474:59:5" + }, + { + "assignments": [ + 3206 + ], + "declarations": [ + { + "constant": false, + "id": 3206, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3246, + "src": "20544:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3205, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20544:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3211, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3208, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20564:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3209, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "20578:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3207, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "20559:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20559:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "20544:43:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3213, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20612:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3214, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20612:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3215, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20624:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3216, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20634:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3212, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "20603:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3217, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20603:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3218, + "nodeType": "EmitStatement", + "src": "20598:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3220, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20675:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20675:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3222, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20687:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3219, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "20660:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20660:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3224, + "nodeType": "ExpressionStatement", + "src": "20660:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3227, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3132, + "src": "20730:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3228, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3206, + "src": "20744:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3226, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "20725:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20725:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3225, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "20710:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20710:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3231, + "nodeType": "ExpressionStatement", + "src": "20710:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3233, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "20778:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3234, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3206, + "src": "20788:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3232, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "20763:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3235, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20763:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3236, + "nodeType": "ExpressionStatement", + "src": "20763:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3238, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3130, + "src": "20822:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3239, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "20832:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "20832:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3241, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20844:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3237, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "20806:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "20806:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3243, + "nodeType": "ExpressionStatement", + "src": "20806:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3244, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3141, + "src": "20877:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3142, + "id": 3245, + "nodeType": "Return", + "src": "20870:21:5" + } + ] + }, + "documentation": null, + "id": 3247, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3137, + "modifierName": { + "argumentTypes": null, + "id": 3136, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "19717:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19717:6:5" + }, + { + "arguments": null, + "id": 3139, + "modifierName": { + "argumentTypes": null, + "id": 3138, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "19732:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "19732:6:5" + } + ], + "name": "exitswapPoolAmountIn", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3135, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3130, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19636:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3129, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "19636:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3132, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19654:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3131, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19654:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3134, + "name": "minAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19673:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3133, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19673:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19635:56:5" + }, + "returnParameters": { + "id": 3142, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3141, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3247, + "src": "19756:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3140, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "19756:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "19755:21:5" + }, + "scope": 3473, + "src": "19606:1292:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3372, + "nodeType": "Block", + "src": "21085:1169:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3263, + "name": "_finalized", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1412, + "src": "21103:10:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f46494e414c495a4544", + "id": 3264, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21115:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + }, + "value": "ERR_NOT_FINALIZED" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_8e0a50e0802c41001c819a1d72124e98da239dcaeee85bac2236e5d8595f284f", + "typeString": "literal_string \"ERR_NOT_FINALIZED\"" + } + ], + "id": 3262, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21095:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21095:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3266, + "nodeType": "ExpressionStatement", + "src": "21095:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3268, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21153:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3270, + "indexExpression": { + "argumentTypes": null, + "id": 3269, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21162:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21153:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3271, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "bound", + "nodeType": "MemberAccess", + "referencedDeclaration": 1316, + "src": "21153:24:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4e4f545f424f554e44", + "id": 3272, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21179:15:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + }, + "value": "ERR_NOT_BOUND" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_86a01019fb9a24504897a9ddf06d43e29c7ad173d46588f4f7aa1ef14d3c847c", + "typeString": "literal_string \"ERR_NOT_BOUND\"" + } + ], + "id": 3267, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21145:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21145:50:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3274, + "nodeType": "ExpressionStatement", + "src": "21145:50:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3276, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21213:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3278, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21236:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3280, + "indexExpression": { + "argumentTypes": null, + "id": 3279, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21245:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21236:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "id": 3281, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21236:26:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3282, + "name": "MAX_OUT_RATIO", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 107, + "src": "21264:13:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3277, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "21231:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3283, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21231:47:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21213:65:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d41585f4f55545f524154494f", + "id": 3285, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21280:19:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + }, + "value": "ERR_MAX_OUT_RATIO" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_863cb4bcd0b8884f90860e9fca5a02b421b5bc6a33c8399eb7f6df0648d0555a", + "typeString": "literal_string \"ERR_MAX_OUT_RATIO\"" + } + ], + "id": 3275, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21205:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21205:95:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3287, + "nodeType": "ExpressionStatement", + "src": "21205:95:5" + }, + { + "assignments": [ + 3289 + ], + "declarations": [ + { + "constant": false, + "id": 3289, + "name": "outRecord", + "nodeType": "VariableDeclaration", + "scope": 3372, + "src": "21311:24:5", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + }, + "typeName": { + "contractScope": null, + "id": 3288, + "name": "Record", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 1323, + "src": "21311:6:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3293, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 3290, + "name": "_records", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1419, + "src": "21338:8:5", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Record_$1323_storage_$", + "typeString": "mapping(address => struct BPool.Record storage ref)" + } + }, + "id": 3292, + "indexExpression": { + "argumentTypes": null, + "id": 3291, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21347:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "21338:18:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage", + "typeString": "struct BPool.Record storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21311:45:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 3294, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21367:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3296, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21436:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3297, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21436:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3298, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21483:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3299, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "denorm", + "nodeType": "MemberAccess", + "referencedDeclaration": 1320, + "src": "21483:16:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3300, + "name": "_totalSupply", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3557, + "src": "21529:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3301, + "name": "_totalWeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1421, + "src": "21571:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3302, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21613:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3303, + "name": "_swapFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1410, + "src": "21657:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3295, + "name": "calcPoolInGivenSingleOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 830, + "src": "21382:24:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256,uint256,uint256,uint256,uint256) pure returns (uint256)" + } + }, + "id": 3304, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21382:309:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21367:324:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3306, + "nodeType": "ExpressionStatement", + "src": "21367:324:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3308, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21710:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 3309, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21726:1:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "21710:17:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4d4154485f415050524f58", + "id": 3311, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21729:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + }, + "value": "ERR_MATH_APPROX" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_38839817361c628b17e457bae64f619c23ab542714e93cfb021dbd3ddd466187", + "typeString": "literal_string \"ERR_MATH_APPROX\"" + } + ], + "id": 3307, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21702:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3312, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21702:45:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3313, + "nodeType": "ExpressionStatement", + "src": "21702:45:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 3317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 3315, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21765:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "argumentTypes": null, + "id": 3316, + "name": "maxPoolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3253, + "src": "21781:15:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21765:31:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f4c494d49545f494e", + "id": 3318, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "21798:14:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + }, + "value": "ERR_LIMIT_IN" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7f6da07481837924baab3a15f838b3df11e328050f73de905838535dd369af68", + "typeString": "literal_string \"ERR_LIMIT_IN\"" + } + ], + "id": 3314, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "21757:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21757:56:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3320, + "nodeType": "ExpressionStatement", + "src": "21757:56:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3321, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21824:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3323, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21824:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3325, + "name": "outRecord", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3289, + "src": "21849:9:5", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Record_$1323_storage_ptr", + "typeString": "struct BPool.Record storage pointer" + } + }, + "id": 3326, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": 1322, + "src": "21849:17:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3327, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21868:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3324, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "21844:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3328, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21844:39:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "21824:59:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 3330, + "nodeType": "ExpressionStatement", + "src": "21824:59:5" + }, + { + "assignments": [ + 3332 + ], + "declarations": [ + { + "constant": false, + "id": 3332, + "name": "exitFee", + "nodeType": "VariableDeclaration", + "scope": 3372, + "src": "21894:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3331, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21894:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3337, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3334, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "21914:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3335, + "name": "EXIT_FEE", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 51, + "src": "21928:8:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3333, + "name": "bmul", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 997, + "src": "21909:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3336, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21909:28:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "21894:43:5" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3339, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "21962:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "21962:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3341, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "21974:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3342, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "21984:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3338, + "name": "LOG_EXIT", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1351, + "src": "21953:8:5", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "21953:46:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3344, + "nodeType": "EmitStatement", + "src": "21948:51:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3346, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "22025:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22025:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3348, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22037:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3345, + "name": "_pullPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3439, + "src": "22010:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22010:40:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3350, + "nodeType": "ExpressionStatement", + "src": "22010:40:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3353, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22080:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 3354, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3332, + "src": "22094:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3352, + "name": "bsub", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 914, + "src": "22075:4:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 3355, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22075:27:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3351, + "name": "_burnPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3472, + "src": "22060:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3356, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22060:43:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3357, + "nodeType": "ExpressionStatement", + "src": "22060:43:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3359, + "name": "_factory", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1404, + "src": "22128:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3360, + "name": "exitFee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3332, + "src": "22138:7:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3358, + "name": "_pushPoolShare", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3452, + "src": "22113:14:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22113:33:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3362, + "nodeType": "ExpressionStatement", + "src": "22113:33:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3364, + "name": "tokenOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3249, + "src": "22172:8:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 3365, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5250, + "src": "22182:3:5", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 3366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "22182:10:5", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 3367, + "name": "tokenAmountOut", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3251, + "src": "22194:14:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3363, + "name": "_pushUnderlying", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3426, + "src": "22156:15:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256)" + } + }, + "id": 3368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22156:53:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3369, + "nodeType": "ExpressionStatement", + "src": "22156:53:5" + }, + { + "expression": { + "argumentTypes": null, + "id": 3370, + "name": "poolAmountIn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3260, + "src": "22235:12:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 3261, + "id": 3371, + "nodeType": "Return", + "src": "22228:19:5" + } + ] + }, + "documentation": null, + "id": 3373, + "implemented": true, + "kind": "function", + "modifiers": [ + { + "arguments": null, + "id": 3256, + "modifierName": { + "argumentTypes": null, + "id": 3255, + "name": "_logs_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1372, + "src": "21023:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21023:6:5" + }, + { + "arguments": null, + "id": 3258, + "modifierName": { + "argumentTypes": null, + "id": 3257, + "name": "_lock_", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1390, + "src": "21038:6:5", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "21038:6:5" + } + ], + "name": "exitswapExternAmountOut", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3254, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3249, + "name": "tokenOut", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20937:16:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3248, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "20937:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3251, + "name": "tokenAmountOut", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20955:19:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3250, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20955:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3253, + "name": "maxPoolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "20976:20:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3252, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "20976:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "20936:61:5" + }, + "returnParameters": { + "id": 3261, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3260, + "name": "poolAmountIn", + "nodeType": "VariableDeclaration", + "scope": 3373, + "src": "21062:17:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3259, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "21062:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "21061:19:5" + }, + "scope": 3473, + "src": "20904:1350:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "external" + }, + { + "body": { + "id": 3400, + "nodeType": "Block", + "src": "22508:126:5", + "statements": [ + { + "assignments": [ + 3383 + ], + "declarations": [ + { + "constant": false, + "id": 3383, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 3400, + "src": "22518:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3382, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "22518:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3394, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3388, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3377, + "src": "22557:4:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3390, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5280, + "src": "22571:4:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_BPool_$3473", + "typeString": "contract BPool" + } + ], + "id": 3389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "22563:7:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 3391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22563:13:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3392, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3379, + "src": "22578:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3385, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3375, + "src": "22537:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3384, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "22530:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 3386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22530:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 3387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 3542, + "src": "22530:26:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" + } + }, + "id": 3393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22530:55:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22518:67:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3396, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3383, + "src": "22603:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 3397, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22609:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + }, + "value": "ERR_ERC20_FALSE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + } + ], + "id": 3395, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "22595:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3398, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22595:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3399, + "nodeType": "ExpressionStatement", + "src": "22595:32:5" + } + ] + }, + "documentation": null, + "id": 3401, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3380, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3375, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22445:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3374, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22445:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3377, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22460:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3376, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22460:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3379, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3401, + "src": "22474:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3378, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22474:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22444:42:5" + }, + "returnParameters": { + "id": 3381, + "nodeType": "ParameterList", + "parameters": [], + "src": "22508:0:5" + }, + "scope": 3473, + "src": "22420:214:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3425, + "nodeType": "Block", + "src": "22726:105:5", + "statements": [ + { + "assignments": [ + 3411 + ], + "declarations": [ + { + "constant": false, + "id": 3411, + "name": "xfer", + "nodeType": "VariableDeclaration", + "scope": 3425, + "src": "22736:9:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 3410, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "22736:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 3419, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3416, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3405, + "src": "22771:2:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3417, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3407, + "src": "22775:6:5", + "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": 3413, + "name": "erc20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3403, + "src": "22755:5:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 3412, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3543, + "src": "22748:6:5", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$3543_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 3414, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22748:13:5", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$3543", + "typeString": "contract IERC20" + } + }, + "id": 3415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": 3531, + "src": "22748:22:5", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 3418, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22748:34:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "22736:46:5" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3421, + "name": "xfer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3411, + "src": "22800:4:5", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "4552525f45524332305f46414c5345", + "id": 3422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "22806:17:5", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + }, + "value": "ERR_ERC20_FALSE" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_cfe847c677cf42c21ce03ee8e7625272fdefc571a2ce6d0eacad2e7c6f42fc3f", + "typeString": "literal_string \"ERR_ERC20_FALSE\"" + } + ], + "id": 3420, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 5253, + 5254 + ], + "referencedDeclaration": 5254, + "src": "22792:7:5", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 3423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22792:32:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3424, + "nodeType": "ExpressionStatement", + "src": "22792:32:5" + } + ] + }, + "documentation": null, + "id": 3426, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushUnderlying", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3408, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3403, + "name": "erc20", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22665:13:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3402, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22665:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3405, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22680:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3404, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22680:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3407, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3426, + "src": "22692:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3406, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22692:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22664:40:5" + }, + "returnParameters": { + "id": 3409, + "nodeType": "ParameterList", + "parameters": [], + "src": "22726:0:5" + }, + "scope": 3473, + "src": "22640:191:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3438, + "nodeType": "Block", + "src": "22909:36:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3434, + "name": "from", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3428, + "src": "22925:4:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3435, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3430, + "src": "22931:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3433, + "name": "_pull", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3739, + "src": "22919:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "22919:19:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3437, + "nodeType": "ExpressionStatement", + "src": "22919:19:5" + } + ] + }, + "documentation": null, + "id": 3439, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pullPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3431, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3428, + "name": "from", + "nodeType": "VariableDeclaration", + "scope": 3439, + "src": "22861:12:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3427, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22861:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3430, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3439, + "src": "22875:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3429, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22875:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22860:27:5" + }, + "returnParameters": { + "id": 3432, + "nodeType": "ParameterList", + "parameters": [], + "src": "22909:0:5" + }, + "scope": 3473, + "src": "22837:108:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3451, + "nodeType": "Block", + "src": "23021:34:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3447, + "name": "to", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3441, + "src": "23037:2:5", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 3448, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3443, + "src": "23041:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3446, + "name": "_push", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3723, + "src": "23031:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256)" + } + }, + "id": 3449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23031:17:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3450, + "nodeType": "ExpressionStatement", + "src": "23031:17:5" + } + ] + }, + "documentation": null, + "id": 3452, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_pushPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3444, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3441, + "name": "to", + "nodeType": "VariableDeclaration", + "scope": 3452, + "src": "22975:10:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3440, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "22975:7:5", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 3443, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3452, + "src": "22987:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3442, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "22987:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "22974:25:5" + }, + "returnParameters": { + "id": 3445, + "nodeType": "ParameterList", + "parameters": [], + "src": "23021:0:5" + }, + "scope": 3473, + "src": "22951:104:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3461, + "nodeType": "Block", + "src": "23119:30:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3458, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3454, + "src": "23135:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3457, + "name": "_mint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3611, + "src": "23129:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3459, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23129:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3460, + "nodeType": "ExpressionStatement", + "src": "23129:13:5" + } + ] + }, + "documentation": null, + "id": 3462, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_mintPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3455, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3454, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3462, + "src": "23085:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3453, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23085:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23084:13:5" + }, + "returnParameters": { + "id": 3456, + "nodeType": "ParameterList", + "parameters": [], + "src": "23119:0:5" + }, + "scope": 3473, + "src": "23061:88:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 3471, + "nodeType": "Block", + "src": "23213:30:5", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 3468, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3464, + "src": "23229:6:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 3467, + "name": "_burn", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "23223:5:5", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 3469, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "23223:13:5", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 3470, + "nodeType": "ExpressionStatement", + "src": "23223:13:5" + } + ] + }, + "documentation": null, + "id": 3472, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_burnPoolShare", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 3465, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3464, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 3472, + "src": "23179:11:5", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 3463, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "23179:4:5", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "23178:13:5" + }, + "returnParameters": { + "id": 3466, + "nodeType": "ParameterList", + "parameters": [], + "src": "23213:0:5" + }, + "scope": 3473, + "src": "23155:88:5", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "internal" + } + ], + "scope": 3474, + "src": "714:22532:5" + } + ], + "src": "643:22604:5" + }, + "compiler": { + "name": "solc", + "version": "0.5.12+commit.7709ece9.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.0.16", + "updatedAt": "2020-06-15T08:14:20.627Z", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": { + "calcInGivenOut(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcInGivenOut // // aI = tokenAmountIn // // bO = tokenBalanceOut / / bO \\ (wO / wI) \\ // // bI = tokenBalanceIn bI * | | ------------ | ^ - 1 | // // aO = tokenAmountOut aI = \\ \\ ( bO - aO ) / / // // wI = tokenWeightIn -------------------------------------------- // // wO = tokenWeightOut ( 1 - sF ) // // sF = swapFee //*********************************************************************************************" + }, + "calcOutGivenIn(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcOutGivenIn // // aO = tokenAmountOut // // bO = tokenBalanceOut // // bI = tokenBalanceIn / / bI \\ (wI / wO) \\ // // aI = tokenAmountIn aO = bO * | 1 - | -------------------------- | ^ | // // wI = tokenWeightIn \\ \\ ( bI + ( aI * ( 1 - sF )) / / // // wO = tokenWeightOut // // sF = swapFee //*********************************************************************************************" + }, + "calcPoolInGivenSingleOut(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcPoolInGivenSingleOut // // pAi = poolAmountIn // / tAo \\\\ / wO \\ \\ // // bO = tokenBalanceOut // | bO - -------------------------- |\\ | ---- | \\ // // tAo = tokenAmountOut pS - || \\ 1 - ((1 - (tO / tW)) * sF)/ | ^ \\ tW / * pS | // // ps = poolSupply \\\\ -----------------------------------/ / // // wO = tokenWeightOut pAi = \\\\ bO / / // // tW = totalWeight ------------------------------------------------------------- // // sF = swapFee ( 1 - eF ) // // eF = exitFee //*********************************************************************************************" + }, + "calcPoolOutGivenSingleIn(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcPoolOutGivenSingleIn // // pAo = poolAmountOut / \\ // // tAi = tokenAmountIn /// / // wI \\ \\\\ \\ wI \\ // // wI = tokenWeightIn //| tAi *| 1 - || 1 - -- | * sF || + tBi \\ -- \\ // // tW = totalWeight pAo=|| \\ \\ \\\\ tW / // | ^ tW | * pS - pS // // tBi = tokenBalanceIn \\\\ ------------------------------------- / / // // pS = poolSupply \\\\ tBi / / // // sF = swapFee \\ / //*********************************************************************************************" + }, + "calcSingleInGivenPoolOut(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcSingleInGivenPoolOut // // tAi = tokenAmountIn //(pS + pAo)\\ / 1 \\\\ // // pS = poolSupply || --------- | ^ | --------- || * bI - bI // // pAo = poolAmountOut \\\\ pS / \\(wI / tW)// // // bI = balanceIn tAi = -------------------------------------------- // // wI = weightIn / wI \\ // // tW = totalWeight | 1 - ---- | * sF // // sF = swapFee \\ tW / //*********************************************************************************************" + }, + "calcSingleOutGivenPoolIn(uint256,uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcSingleOutGivenPoolIn // // tAo = tokenAmountOut / / \\\\ // // bO = tokenBalanceOut / // pS - (pAi * (1 - eF)) \\ / 1 \\ \\\\ // // pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || // // ps = poolSupply \\ \\\\ pS / \\(wO / tW)/ // // // wI = tokenWeightIn tAo = \\ \\ // // // tW = totalWeight / / wO \\ \\ // // sF = swapFee * | 1 - | 1 - ---- | * sF | // // eF = exitFee \\ \\ tW / / //*********************************************************************************************" + }, + "calcSpotPrice(uint256,uint256,uint256,uint256,uint256)": { + "notice": "******************************************************************************************** // calcSpotPrice // // sP = spotPrice // // bI = tokenBalanceIn ( bI / wI ) 1 // // bO = tokenBalanceOut sP = ----------- * ---------- // // wI = tokenWeightIn ( bO / wO ) ( 1 - sF ) // // wO = tokenWeightOut // // sF = swapFee //*********************************************************************************************" + } + } + } +} \ No newline at end of file diff --git a/src/balancer/balancerlib.ts b/src/balancer/balancerlib.ts new file mode 100644 index 00000000..c8aca9e1 --- /dev/null +++ b/src/balancer/balancerlib.ts @@ -0,0 +1,941 @@ +import * as jsonFactoryABI from './artifacts/BFactory.json' +import * as jsonPoolABI from './artifacts/BPool.json' + +/** + * Provides a interface to Balancer BPool & BFactory + + */ + +export interface TokensToAdd { + address: string + amount: string + weight: string +} + +export class Balancer { + private GASLIMIT_DEFAULT: number = 5000000 + private web3: any = null + private FactoryABI: any + private PoolABI: any + private factoryAddress: any + private account: string = null + private pool: any = null + public poolAddress: string = null + public oceanAddress: string = null + public dtAddress: string = null + constructor( + web3: any, + account: string, + FactoryABI: any = null, + PoolABI: any = null, + factoryAddress: string = null, + oceanAddress: string = null + ) { + this.web3 = web3 + this.account = account + if (FactoryABI) this.FactoryABI = FactoryABI + else this.FactoryABI = jsonFactoryABI.abi + if (PoolABI) this.PoolABI = PoolABI + else this.PoolABI = jsonPoolABI.abi + if (factoryAddress) { + this.factoryAddress = factoryAddress + } + if (oceanAddress) { + this.oceanAddress = oceanAddress + } + } + + async getNetworkAddresses(): Promise { + if (this.factoryAddress && this.oceanAddress) { + return + } + const netId = await this.web3.eth.net.getId() + switch (netId) { + case 1: + if (!this.factoryAddress) + this.factoryAddress = '0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd' + if (!this.oceanAddress) + this.oceanAddress = '0x985dd3D42De1e256d09e1c10F112bCCB8015AD41' + break + case 42: + if (!this.factoryAddress) + this.factoryAddress = '0x8f7F78080219d4066A8036ccD30D588B416a40DB' + if (!this.oceanAddress) this.oceanAddress = null + break + default: + this.factoryAddress = null + this.oceanAddress = null + } + } + + /** + * Creates a new pool + */ + async newPool(): Promise { + await this.getNetworkAddresses() + if (this.web3 == null) { + console.error('Web3 object is null') + return null + } + if (this.account == null) { + console.error('Account is null') + return null + } + if (this.factoryAddress == null) { + console.error('bfactoryAddress is null') + return null + } + const factory = new this.web3.eth.Contract(this.FactoryABI, this.factoryAddress, { + from: this.account + }) + const transactiondata = await factory.methods + .newBPool() + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + let pooladdress = null + try { + pooladdress = transactiondata.events.LOG_NEW_POOL.returnValues[1] + this.poolAddress = pooladdress + this.pool = new this.web3.eth.Contract(this.PoolABI, pooladdress, { + from: this.account + }) + } catch (e) { + console.error(e) + } + return pooladdress + } + + /** + * Loads a new pool + */ + async loadPool(address: string): Promise { + await this.getNetworkAddresses() + if (this.web3 == null) { + console.error('Web3 object is null') + return null + } + if (this.account == null) { + console.error('Account is null') + return null + } + if (this.factoryAddress == null) { + console.error('Cannot init. Maybe wrong network?') + return null + } + try { + this.pool = new this.web3.eth.Contract(this.PoolABI, address, { + from: this.account + }) + this.poolAddress = address + return address + } catch (e) { + console.error(e) + return null + } + } + + /** + * Approve spender to spent amount tokens + * @param {String} tokenAddress + * @param {String} spender + * @param {String} amount (always expressed as wei) + */ + async approve(tokenAddress: string, spender: string, amount: string): Promise { + const minABI = [ + { + constant: false, + inputs: [ + { + name: '_spender', + type: 'address' + }, + { + name: '_value', + type: 'uint256' + } + ], + name: 'approve', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + } + ] + const token = new this.web3.eth.Contract(minABI, tokenAddress, { + from: this.account + }) + let result = null + try { + result = await token.methods + .approve(spender, amount) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Adds tokens to pool + * @param {Array} tokens Array of token object { address,amount,weight} + */ + async addToPool(tokens: TokensToAdd[]): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let token + for (token of tokens) { + try { + // approve spending first + await this.approve( + token.address, + this.poolAddress, + this.web3.utils.toWei(token.amount) + ) + await this.pool.methods + .bind( + token.address, + this.web3.utils.toWei(token.amount), + this.web3.utils.toWei(token.weight) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + } + } + + /** + * Set pool fee + * @param {String} fee (will be converted to wei) + */ + async setSwapFee(fee: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .setSwapFee(this.web3.utils.toWei(fee)) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Finalize a pool + */ + async finalize(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .finalize() + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get number of tokens composing this pool + */ + async getNumTokens(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.getNumTokens().call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get tokens composing this pool + * @return {Array} + */ + async getCurrentTokens(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.getCurrentTokens().call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get the final tokens composing this pool + * @return {Array} + */ + async getFinalTokens(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.getFinalTokens().call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get controller address of this pool + * @return {String} + */ + async getController(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.getController().call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Set controller address of this pool + * @param {String} address + * @return {String} + */ + async setController(address: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .setController(address) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get if a token is bounded to a pool + * @param {String} token Address of the token + * @return {Boolean} + */ + async isBound(token: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.isBound(token).call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get how many tokens are in the pool + * @param {String} token Address of the token + * @return {Boolean} + */ + async getBalance(token: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let amount = null + try { + const result = await this.pool.methods.getBalance(token).call() + amount = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return amount + } + + /** + * Get if a pool is finalized + * @return {Boolean} + */ + async isFinalized(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods.isFinalized().call() + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get pool fee + * @return {String} + */ + async getSwapFee(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let fee = null + try { + const result = await this.pool.methods.getSwapFee().call() + fee = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return fee + } + + /** + * The normalized weight of a token. The combined normalized weights of all tokens will sum up to 1. (Note: the actual sum may be 1 plus or minus a few wei due to division precision loss) + * @param {String} token + * @return {Number} + */ + async getNormalizedWeight(token: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let weight = null + try { + const result = await this.pool.methods.getNormalizedWeight(token).call() + weight = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return weight + } + + /** + * getDenormalizedWeight of a token in pool + * @param {String} token + * @return {Number} + */ + async getDenormalizedWeight(token: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let weight = null + try { + const result = await this.pool.methods.getDenormalizedWeight(token).call() + weight = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return weight + } + + /** + * getTotalDenormalizedWeight in pool + * @return {Number} + */ + async getTotalDenormalizedWeight(): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let weight = null + try { + const result = await this.pool.methods.getTotalDenormalizedWeight().call() + weight = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return weight + } + + /** + * swapExactAmountIn - Trades an exact tokenAmountIn of tokenIn taken from the caller by the pool, in exchange for at least minAmountOut of tokenOut given to the caller from the pool, with a maximum marginal price of maxPrice. Returns (tokenAmountOut, spotPriceAfter), where tokenAmountOut is the amount of token that came out of the pool, and spotPriceAfter is the new marginal spot price, ie, the result of getSpotPrice after the call. (These values are what are limited by the arguments; you are guaranteed tokenAmountOut >= minAmountOut and spotPriceAfter <= maxPrice). + * @param {String} tokenIn + * @param {String} tokenAmountIn will be converted to wei + * @param {String} tokenOut + * @param {String} minAmountOut will be converted to wei + * @param {String} maxPrice will be converted to wei + * @return {any} + */ + async swapExactAmountIn( + tokenIn: string, + tokenAmountIn: string, + tokenOut: string, + minAmountOut: string, + maxPrice: string + ): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .swapExactAmountIn( + tokenIn, + this.web3.utils.toWei(tokenAmountIn), + tokenOut, + this.web3.utils.toWei(minAmountOut), + this.web3.utils.toWei(maxPrice) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * swapExactAmountOut + * @param {String} tokenIn + * @param {String} maxAmountIn will be converted to wei + * @param {String} tokenOut + * @param {String} minAmountOut will be converted to wei + * @param {String} maxPrice will be converted to wei + * @return {any} + */ + async swapExactAmountOut( + tokenIn: string, + maxAmountIn: string, + tokenOut: string, + minAmountOut: string, + maxPrice: string + ): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .swapExactAmountOut( + tokenIn, + this.web3.utils.toWei(maxAmountIn), + tokenOut, + this.web3.utils.toWei(minAmountOut), + this.web3.utils.toWei(maxPrice) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Join the pool, getting poolAmountOut pool tokens. This will pull some of each of the currently trading tokens in the pool, meaning you must have called approve for each token for this pool. These values are limited by the array of maxAmountsIn in the order of the pool tokens. + * @param {String} poolAmountOut will be converted to wei + * @param {String} maxAmountsIn array holding maxAmount per each token, will be converted to wei + * @return {any} + */ + async joinPool(poolAmountOut: string, maxAmountsIn: any): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + const weiMaxAmountsIn = [] + let amount + for (amount of maxAmountsIn) { + weiMaxAmountsIn.push(this.web3.utils.toWei(amount)) + } + let result = null + try { + result = await this.pool.methods + .joinPool(this.web3.utils.toWei(poolAmountOut), weiMaxAmountsIn) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Exit the pool, paying poolAmountIn pool tokens and getting some of each of the currently trading tokens in return. These values are limited by the array of minAmountsOut in the order of the pool tokens. + * @param {String} poolAmountIn will be converted to wei + * @param {String} maxAmountsIn array holding maxAmount per each token, will be converted to wei + * @return {any} + */ + async exitPool(poolAmountIn: string, minAmountsOut: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + const weiMinAmountsOut = [] + let amount + for (amount of minAmountsOut) { + weiMinAmountsOut.push(this.web3.utils.toWei(amount)) + } + let result = null + try { + result = await this.pool.methods + .exitPool(this.web3.utils.toWei(poolAmountIn), weiMinAmountsOut) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Pay tokenAmountIn of token tokenIn to join the pool, getting poolAmountOut of the pool shares. + * @param {String} tokenIn + * @param {String} tokenAmountIn will be converted to wei + * @param {String} minPoolAmountOut will be converted to wei + * @return {any} + */ + async joinswapExternAmountIn( + tokenIn: string, + tokenAmountIn: string, + minPoolAmountOut: string + ): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .joinswapExternAmountIn( + tokenIn, + this.web3.utils.toWei(tokenAmountIn), + this.web3.utils.toWei(minPoolAmountOut) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Specify poolAmountOut pool shares that you want to get, and a token tokenIn to pay with. This costs tokenAmountIn tokens (these went into the pool). + * @param {String} tokenIn + * @param {String} poolAmountOut will be converted to wei + * @param {String} maxAmountIn will be converted to wei + * @return {any} + */ + async joinswapPoolAmountOut( + tokenIn: string, + poolAmountOut: string, + maxAmountIn: string + ): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .joinswapPoolAmountOut( + tokenIn, + this.web3.utils.toWei(poolAmountOut), + this.web3.utils.toWei(maxAmountIn) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Pay poolAmountIn pool shares into the pool, getting minTokenAmountOut of the given token tokenOut out of the pool. + * @param {String} tokenOut + * @param {String} poolAmountIn will be converted to wei + * @param {String} minTokenAmountOut will be converted to wei + * @return {any} + */ + async exitswapPoolAmountIn( + tokenOut: string, + poolAmountIn: string, + minTokenAmountOut: string + ): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let result = null + try { + result = await this.pool.methods + .exitswapPoolAmountIn( + tokenOut, + this.web3.utils.toWei(poolAmountIn), + this.web3.utils.toWei(minTokenAmountOut) + ) + .send({ from: this.account, gas: this.GASLIMIT_DEFAULT }) + } catch (e) { + console.error(e) + } + return result + } + + /** + * Get Spot Price of swaping tokenIn to tokenOut + * @param {String} tokenIn + * @param {String} tokenOut + * @return {any} + */ + async getSpotPrice(tokenIn: string, tokenOut: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let price = null + try { + const result = await this.pool.methods.getSpotPrice(tokenIn, tokenOut).call() + price = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return price + } + + /** + * Get Spot Price of swaping tokenIn to tokenOut without fees + * @param {String} tokenIn + * @param {String} tokenOut + * @return {any} + */ + async getSpotPriceSansFee(tokenIn: string, tokenOut: string): Promise { + if (this.pool == null) { + console.error('BPool not initialiez. Maybe you missed newPool or loadPool ?') + return null + } + let price = null + try { + const result = await this.pool.methods + .getSpotPriceSansFee(tokenIn, tokenOut) + .call() + price = this.web3.utils.fromWei(result) + } catch (e) { + console.error(e) + } + return price + } + + /** Ocean related functions */ + /** + * create DataToken pool + * @param {String} token Data Token Address + * @param {String} amount Data Token Amount + * @param {String} weight Data Token Weight + * @return {any} + */ + public async createDTPool( + token: string, + amount: string, + weight: string, + fee: string, + finalize: boolean = true + ): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + if (parseFloat(weight) > 9 || parseFloat(weight) < 1) { + console.error('Weight out of bounds (min 1, max9)') + return null + } + const address = await this.newPool() + const oceanWeight = 10 - parseFloat(weight) + const oceanAmount = (parseFloat(amount) * oceanWeight) / parseFloat(weight) + const tokens = [ + { + address: token, + amount: String(amount), + weight: String(weight) + }, + { + address: this.oceanAddress, + amount: String(oceanAmount), + weight: String(oceanWeight) + } + ] + this.dtAddress = token + await this.addToPool(tokens) + await this.setSwapFee(fee) + if (finalize) await this.finalize() + return address + } + + /** + * Load a previous created DataToken pool + * @param {String} address Data Token Address + * @return {any} + */ + public async loadDTPool(address: string): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + await this.loadPool(address) + const tokens = await this.getCurrentTokens() + let token + for (token of tokens) { + if (token !== this.oceanAddress) this.dtAddress = token + } + return this + } + + /** + * Get Ocean Token balance of a pool + * @return {any} + */ + public async getOceanBalance(): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + return this.getBalance(this.oceanAddress) + } + + /** + * Get Data Token balance of a pool + * @return {any} + */ + public async getDTBalance(): Promise { + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + return this.getBalance(this.dtAddress) + } + + /** + * Buy Data Token from a pool + * @param {String} amount Data Token Amount + * @param {String} oceanAmount Ocean Token Amount payed + * @param {String} maxPrice Maximum Price to pay + * @return {any} + */ + public async buyDT( + amount: string, + oceanAmount: string, + maxPrice: string + ): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + + // TODO - check balances first + await this.approve( + this.oceanAddress, + this.poolAddress, + this.web3.utils.toWei(oceanAmount) + ) + + return this.swapExactAmountOut( + this.oceanAddress, + oceanAmount, + this.dtAddress, + amount, + maxPrice + ) + } + + /** + * Sell Data Token + * @param {String} amount Data Token Amount + * @param {String} oceanAmount Ocean Token Amount expected + * @param {String} maxPrice Minimum Price to sell + * @return {any} + */ + public async sellDT( + amount: string, + oceanAmount: string, + minPrice: string + ): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + return this.swapExactAmountOut( + this.dtAddress, + amount, + this.oceanAddress, + oceanAmount, + minPrice + ) + } + + /** + * Add Data Token amount to pool liquidity + * @param {String} amount Data Token Amount + * @param {String} maxOceanAmount Maximum Ocean Token Amount required + * @return {any} + */ + public addDTLiquidity(amount: string, maxOceanAmount: string): Promise { + const amounts = [amount, maxOceanAmount] + return this.joinPool('0', amounts) + } + + /** + * Remove Data Token amount from pool liquidity + * @param {String} amount pool Liquidity Amount + * @return {any} + */ + public removeDTLiquidity(amount: string): Promise { + return this.exitPool(amount, '0') + } + + /** + * Get Data Token Price from pool + * @return {any} + */ + public async getDTPrice(): Promise { + if (this.oceanAddress == null) { + console.error('oceanAddress is not defined') + return null + } + if (this.dtAddress == null) { + console.error( + 'dtAddress is not defined. Did you do loadDTPool or createDTPool ?' + ) + return null + } + return this.getSpotPrice(this.dtAddress, this.oceanAddress) + } +} diff --git a/test/BalancerContractHandler.ts b/test/BalancerContractHandler.ts new file mode 100644 index 00000000..f5080043 --- /dev/null +++ b/test/BalancerContractHandler.ts @@ -0,0 +1,48 @@ +import { Contract } from 'web3-eth-contract' + +export class BalancerContractHandler { + public factory: Contract + public pool: Contract + public accounts: string[] + public poolBytecode: string + public factoryBytecode: string + public factoryAddress: string + public poolAddress: string + public web3: any + + constructor(factoryABI: Contract, factoryBytecode: string, web3: any) { + this.web3 = web3 + this.factory = new this.web3.eth.Contract(factoryABI) + this.factoryBytecode = factoryBytecode + } + + public async getAccounts() { + this.accounts = await this.web3.eth.getAccounts() + } + + public async deployContracts(minter: string) { + const estGas = await this.factory + .deploy({ + data: this.factoryBytecode, + arguments: [] + }) + .estimateGas(function (err, estGas) { + if (err) console.log('DeployContracts: ' + err) + return estGas + }) + // deploy the contract and get it's address + this.factoryAddress = await this.factory + .deploy({ + data: this.factoryBytecode, + arguments: [] + }) + .send({ + from: minter, + gas: estGas + 1, + gasPrice: '3000000000' + }) + .then(function (contract) { + return contract.options.address + }) + } +} diff --git a/test/unit/balancer/Balancer.test.ts b/test/unit/balancer/Balancer.test.ts new file mode 100644 index 00000000..ee63ac6d --- /dev/null +++ b/test/unit/balancer/Balancer.test.ts @@ -0,0 +1,164 @@ +import { assert } from 'chai' +import { TestContractHandler } from '../../TestContractHandler' +import { BalancerContractHandler } from '../../BalancerContractHandler' +import { DataTokens } from '../../../src/datatokens/Datatokens' +import { Balancer } from '../../../src/balancer/balancerlib' +import { Ocean } from '../../../src/ocean/Ocean' +import { Config } from '../../../src/models/Config' + +const Web3 = require('web3') +const web3 = new Web3('http://127.0.0.1:8545') +const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json') +const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json') + +// this will be replaced by our SFactory/SPool +const balancerFactory = require('../../../src/balancer/artifacts/BFactory.json') +const balancerPool = require('../../../src/balancer/artifacts/BPool.json') + +describe('Balancer flow', () => { + let oceanTokenAddress + let balancerFactoryAddress + let balancer + let balancerContracts + let oceandatatoken + let alicePool + let alicePoolAddress + let bobPool + let currentDtPrice + let owner + let bob + let alice + let contracts + let datatoken + let tokenAddress + let transactionId + const tokenAmount = web3.utils.toWei('1000') + const transferAmount = web3.utils.toWei('200') + const blob = 'http://localhost:8030/api/v1/services/consume' + describe('#test', () => { + it('Initialize Ocean contracts v3', async () => { + contracts = new TestContractHandler( + factory.abi, + datatokensTemplate.abi, + datatokensTemplate.bytecode, + factory.bytecode, + web3 + ) + await contracts.getAccounts() + owner = contracts.accounts[0] + alice = contracts.accounts[1] + bob = contracts.accounts[2] + await contracts.deployContracts(owner) + }) + it('should initialize datatokens class', async () => { + datatoken = new DataTokens( + contracts.factoryAddress, + factory.abi, + datatokensTemplate.abi, + web3 + ) + assert(datatoken !== null) + }) + + it('should create datatokens smart contract', async () => { + tokenAddress = await datatoken.create(blob, alice) + assert(tokenAddress !== null) + }) + it('Create a dummy OceanToken', async () => { + // Alice creates a Datatoken + oceandatatoken = new DataTokens( + contracts.factoryAddress, + factory.abi, + datatokensTemplate.abi, + web3 + ) + oceanTokenAddress = await oceandatatoken.create(blob, alice) + }) + it('Deploy Balancer Factory', async () => { + balancerContracts = new BalancerContractHandler( + balancerFactory.abi, + balancerFactory.bytecode, + web3 + ) + await balancerContracts.getAccounts() + owner = balancerContracts.accounts[0] + await balancerContracts.deployContracts(owner) + balancerFactoryAddress = balancerContracts.factoryAddress + assert(balancerFactoryAddress !== null) + }) + it('should initialize balancer class', async () => { + balancer = new Balancer( + web3, + alice, + balancerFactory.abi, + balancerPool.abi, + balancerFactoryAddress, + oceanTokenAddress + ) + assert(balancer !== null) + }) + + it('Alice mints 1000 tokens', async () => { + await datatoken.mint(tokenAddress, alice, tokenAmount) + }) + it('Alice mints 1000 Ocean tokens', async () => { + await oceandatatoken.mint(oceanTokenAddress, alice, tokenAmount) + }) + it('Alice transfers 200 ocean token to Bob', async () => { + const ts = await datatoken.transfer( + oceanTokenAddress, + bob, + transferAmount, + alice + ) + transactionId = ts.transactionHash + }) + it('Alice creates a new balancer pool', async () => { + /// new pool with total DT = 45 , dt weight=90% with swap fee 2% + alicePoolAddress = await balancer.createDTPool(tokenAddress, 45, 9, '0.02') + alicePool = await balancer.loadDTPool(alicePoolAddress) + assert(alicePool !== null) + }) + it('Get pool information', async () => { + const currentTokens = await alicePool.getCurrentTokens() + assert(currentTokens.length === 2) + assert(currentTokens.includes(tokenAddress)) + assert(currentTokens.includes(oceanTokenAddress)) + }) + it('Get pool swap fee', async () => { + const currentSwapFee = await alicePool.getSwapFee() + assert(currentSwapFee === '0.02') + }) + it('Get dtPrice from the pool ', async () => { + currentDtPrice = await alicePool.getDTPrice() + assert(currentDtPrice > 0) + }) + it('Get dtToken pool reserve ', async () => { + const currentDtReserve = await alicePool.getBalance(tokenAddress) + assert(currentDtReserve > 0) + }) + it('Get dtToken pool reserve ', async () => { + const currentOceanReserve = await alicePool.getOceanBalance() + assert(currentOceanReserve > 0) + }) + it("Bob should load Alice's pool ", async () => { + bobPool = new Balancer( + web3, + bob, + balancerFactory.abi, + balancerPool.abi, + balancerFactoryAddress, + oceanTokenAddress + ) + await bobPool.loadDTPool(alicePoolAddress) + }) + it('Bob should buy a DT ', async () => { + const maxPrice = parseFloat(currentDtPrice) * 2 + await bobPool.buyDT('1', '2', String(maxPrice)) + const bobDtBalance = await datatoken.balance(tokenAddress, bob) + const bobOceanBalance = await datatoken.balance(oceanTokenAddress, bob) + assert(bobDtBalance > 0) + assert(bobOceanBalance > 0) + }) + }) +})